progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
65
AspClassic.Parser/BlockDeclaration.cs
Normal file
65
AspClassic.Parser/BlockDeclaration.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
#define DEBUG
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for a block declaration.
|
||||
/// </summary>
|
||||
public abstract class BlockDeclaration : ModifiedDeclaration
|
||||
{
|
||||
private readonly Location _KeywordLocation;
|
||||
|
||||
private readonly SimpleName _Name;
|
||||
|
||||
private readonly DeclarationCollection _Declarations;
|
||||
|
||||
private readonly EndBlockDeclaration _EndDeclaration;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the keyword.
|
||||
/// </summary>
|
||||
public Location KeywordLocation => _KeywordLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The name of the declaration.
|
||||
/// </summary>
|
||||
public SimpleName Name => _Name;
|
||||
|
||||
/// <summary>
|
||||
/// The declarations in the block.
|
||||
/// </summary>
|
||||
public DeclarationCollection Declarations => _Declarations;
|
||||
|
||||
/// <summary>
|
||||
/// The End statement for the block.
|
||||
/// </summary>
|
||||
public EndBlockDeclaration EndDeclaration => _EndDeclaration;
|
||||
|
||||
protected BlockDeclaration(TreeType type, AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, DeclarationCollection declarations, EndBlockDeclaration endDeclaration, Span span, IList<Comment> comments)
|
||||
: base(type, attributes, modifiers, span, comments)
|
||||
{
|
||||
Debug.Assert(type == TreeType.ClassDeclaration || type == TreeType.ModuleDeclaration || type == TreeType.InterfaceDeclaration || type == TreeType.StructureDeclaration || type == TreeType.EnumDeclaration);
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
SetParent(name);
|
||||
SetParent(declarations);
|
||||
SetParent(endDeclaration);
|
||||
_KeywordLocation = keywordLocation;
|
||||
_Name = name;
|
||||
_Declarations = declarations;
|
||||
_EndDeclaration = endDeclaration;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
base.GetChildTrees(childList);
|
||||
Tree.AddChild(childList, Name);
|
||||
Tree.AddChild(childList, Declarations);
|
||||
Tree.AddChild(childList, EndDeclaration);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue