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

38 lines
1,004 B
C#

using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a declaration with modifiers.
/// </summary>
public abstract class ModifiedDeclaration : Declaration
{
private readonly AttributeBlockCollection _Attributes;
private readonly ModifierCollection _Modifiers;
/// <summary>
/// The attributes on the declaration.
/// </summary>
public AttributeBlockCollection Attributes => _Attributes;
/// <summary>
/// The modifiers on the declaration.
/// </summary>
public ModifierCollection Modifiers => _Modifiers;
protected ModifiedDeclaration(TreeType type, AttributeBlockCollection attributes, ModifierCollection modifiers, Span span, IList<Comment> comments)
: base(type, span, comments)
{
SetParent(attributes);
SetParent(modifiers);
_Attributes = attributes;
_Modifiers = modifiers;
}
protected override void GetChildTrees(IList<Tree> childList)
{
Tree.AddChild(childList, Attributes);
Tree.AddChild(childList, Modifiers);
}
}