using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for an Enum declaration.
///
public sealed class EnumDeclaration : BlockDeclaration
{
private readonly Location _AsLocation;
private readonly TypeName _ElementType;
///
/// The location of the 'As', if any.
///
public Location AsLocation => _AsLocation;
///
/// The element type of the enumerated type, if any.
///
public TypeName ElementType => _ElementType;
///
/// Constructs a parse tree for an Enum declaration.
///
/// The attributes for the parse tree.
/// The modifiers for the parse tree.
/// The location of the keyword.
/// The name of the declaration.
/// The location of the 'As', if any.
/// The element type of the enumerated type, if any.
/// The enumerated values.
/// The end block declaration, if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public EnumDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, Location asLocation, TypeName elementType, DeclarationCollection declarations, EndBlockDeclaration endStatement, Span span, IList comments)
: base(TreeType.EnumDeclaration, attributes, modifiers, keywordLocation, name, declarations, endStatement, span, comments)
{
SetParent(elementType);
_AsLocation = asLocation;
_ElementType = elementType;
}
protected override void GetChildTrees(IList childList)
{
base.GetChildTrees(childList);
Tree.AddChild(childList, ElementType);
}
}