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