using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for a Set property accessor.
///
public sealed class SetAccessorDeclaration : ModifiedDeclaration
{
private readonly Location _SetLocation;
private readonly ParameterCollection _Parameters;
private readonly StatementCollection _Statements;
private readonly EndBlockDeclaration _EndDeclaration;
///
/// The location of the 'Set'.
///
public Location SetLocation => _SetLocation;
///
/// The accessor's parameters.
///
public ParameterCollection Parameters => _Parameters;
///
/// The statements in the accessor.
///
public StatementCollection Statements => _Statements;
///
/// The End declaration for the accessor.
///
public EndBlockDeclaration EndDeclaration => _EndDeclaration;
///
/// Constructs a new parse tree for a property accessor.
///
/// The attributes for the parse tree.
/// The modifiers for the parse tree.
/// The location of the 'Set'.
/// The parameters of the declaration.
/// The statements in the declaration.
/// The end block declaration, if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public SetAccessorDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location setLocation, ParameterCollection parameters, StatementCollection statements, EndBlockDeclaration endDeclaration, Span span, IList comments)
: base(TreeType.SetAccessorDeclaration, attributes, modifiers, span, comments)
{
SetParent(parameters);
SetParent(statements);
SetParent(endDeclaration);
_Parameters = parameters;
_SetLocation = setLocation;
_Statements = statements;
_EndDeclaration = endDeclaration;
}
protected override void GetChildTrees(IList childList)
{
base.GetChildTrees(childList);
Tree.AddChild(childList, Parameters);
Tree.AddChild(childList, Statements);
Tree.AddChild(childList, EndDeclaration);
}
}