progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
50
AspClassic.Parser/EnumDeclaration.cs
Normal file
50
AspClassic.Parser/EnumDeclaration.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an Enum declaration.
|
||||
/// </summary>
|
||||
public sealed class EnumDeclaration : BlockDeclaration
|
||||
{
|
||||
private readonly Location _AsLocation;
|
||||
|
||||
private readonly TypeName _ElementType;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the 'As', if any.
|
||||
/// </summary>
|
||||
public Location AsLocation => _AsLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The element type of the enumerated type, if any.
|
||||
/// </summary>
|
||||
public TypeName ElementType => _ElementType;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a parse tree for an Enum declaration.
|
||||
/// </summary>
|
||||
/// <param name="attributes">The attributes for the parse tree.</param>
|
||||
/// <param name="modifiers">The modifiers for the parse tree.</param>
|
||||
/// <param name="keywordLocation">The location of the keyword.</param>
|
||||
/// <param name="name">The name of the declaration.</param>
|
||||
/// <param name="asLocation">The location of the 'As', if any.</param>
|
||||
/// <param name="elementType">The element type of the enumerated type, if any.</param>
|
||||
/// <param name="declarations">The enumerated values.</param>
|
||||
/// <param name="endStatement">The end block declaration, if any.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
/// <param name="comments">The comments for the parse tree.</param>
|
||||
public EnumDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, Location asLocation, TypeName elementType, DeclarationCollection declarations, EndBlockDeclaration endStatement, Span span, IList<Comment> comments)
|
||||
: base(TreeType.EnumDeclaration, attributes, modifiers, keywordLocation, name, declarations, endStatement, span, comments)
|
||||
{
|
||||
SetParent(elementType);
|
||||
_AsLocation = asLocation;
|
||||
_ElementType = elementType;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
base.GetChildTrees(childList);
|
||||
Tree.AddChild(childList, ElementType);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue