aspclassic-core/AspClassic.Parser/RemoveHandlerAccessorDeclarati.cs
Jelle Luteijn 484dbfc9d9 progress
2022-05-15 11:19:49 +02:00

67 lines
2.3 KiB
C#

using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a RemoveHandler property accessor.
/// </summary>
public sealed class RemoveHandlerAccessorDeclaration : ModifiedDeclaration
{
private readonly Location _RemoveHandlerLocation;
private readonly ParameterCollection _Parameters;
private readonly StatementCollection _Statements;
private readonly EndBlockDeclaration _EndStatement;
/// <summary>
/// The location of the 'RemoveHandler'.
/// </summary>
public Location RemoveHandlerLocation => _RemoveHandlerLocation;
/// <summary>
/// The accessor's parameters.
/// </summary>
public ParameterCollection Parameters => _Parameters;
/// <summary>
/// The statements in the accessor.
/// </summary>
public StatementCollection Statements => _Statements;
/// <summary>
/// The End declaration for the accessor.
/// </summary>
public EndBlockDeclaration EndStatement => _EndStatement;
/// <summary>
/// Constructs a new parse tree for a property accessor.
/// </summary>
/// <param name="attributes">The attributes for the parse tree.</param>
/// <param name="removeHandlerLocation">The location of the 'RemoveHandler'.</param>
/// <param name="parameters">The parameters of the declaration.</param>
/// <param name="statements">The statements in the declaration.</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 RemoveHandlerAccessorDeclaration(AttributeBlockCollection attributes, Location removeHandlerLocation, ParameterCollection parameters, StatementCollection statements, EndBlockDeclaration endStatement, Span span, IList<Comment> comments)
: base(TreeType.RemoveHandlerAccessorDeclaration, attributes, null, span, comments)
{
SetParent(parameters);
SetParent(statements);
SetParent(endStatement);
_Parameters = parameters;
_RemoveHandlerLocation = removeHandlerLocation;
_Statements = statements;
_EndStatement = endStatement;
}
protected override void GetChildTrees(IList<Tree> childList)
{
base.GetChildTrees(childList);
Tree.AddChild(childList, Parameters);
Tree.AddChild(childList, Statements);
Tree.AddChild(childList, EndStatement);
}
}