using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for a property declaration.
///
public sealed class PropertyDeclaration : SignatureDeclaration
{
private readonly NameCollection _ImplementsList;
private readonly DeclarationCollection _Accessors;
private readonly EndBlockDeclaration _EndDeclaration;
///
/// The list of implemented members.
///
public NameCollection ImplementsList => _ImplementsList;
///
/// The property accessors.
///
public DeclarationCollection Accessors => _Accessors;
///
/// The End Property declaration, if any.
///
public EndBlockDeclaration EndDeclaration => _EndDeclaration;
///
/// Constructs a new parse tree for a property declaration.
///
/// The attributes on the declaration.
/// The modifiers on the declaration.
/// The location of the keyword.
/// The name of the property.
/// The parameters of the property.
/// The location of the 'As', if any.
/// The attributes on the result type.
/// The result type, if any.
/// The implements list.
/// The property accessors.
/// The End Property declaration, if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public PropertyDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, ParameterCollection parameters, Location asLocation, AttributeBlockCollection resultTypeAttributes, TypeName resultType, NameCollection implementsList, DeclarationCollection accessors, EndBlockDeclaration endDeclaration, Span span, IList comments)
: base(TreeType.PropertyDeclaration, attributes, modifiers, keywordLocation, name, null, parameters, asLocation, resultTypeAttributes, resultType, span, comments)
{
SetParent(accessors);
SetParent(endDeclaration);
SetParent(implementsList);
_ImplementsList = implementsList;
_Accessors = accessors;
_EndDeclaration = endDeclaration;
}
protected override void GetChildTrees(IList childList)
{
base.GetChildTrees(childList);
Tree.AddChild(childList, ImplementsList);
Tree.AddChild(childList, Accessors);
Tree.AddChild(childList, EndDeclaration);
}
}