32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
#define DEBUG
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for a possibly generic block declaration.
|
|
/// </summary>
|
|
public abstract class GenericBlockDeclaration : BlockDeclaration
|
|
{
|
|
private readonly TypeParameterCollection _TypeParameters;
|
|
|
|
/// <summary>
|
|
/// The type parameters of the type, if any.
|
|
/// </summary>
|
|
public TypeParameterCollection TypeParameters => _TypeParameters;
|
|
|
|
protected GenericBlockDeclaration(TreeType type, AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, TypeParameterCollection typeParameters, DeclarationCollection declarations, EndBlockDeclaration endStatement, Span span, IList<Comment> comments)
|
|
: base(type, attributes, modifiers, keywordLocation, name, declarations, endStatement, span, comments)
|
|
{
|
|
Debug.Assert(type == TreeType.ClassDeclaration || type == TreeType.InterfaceDeclaration || type == TreeType.StructureDeclaration);
|
|
SetParent(typeParameters);
|
|
_TypeParameters = typeParameters;
|
|
}
|
|
|
|
protected override void GetChildTrees(IList<Tree> childList)
|
|
{
|
|
base.GetChildTrees(childList);
|
|
Tree.AddChild(childList, TypeParameters);
|
|
}
|
|
}
|