#define DEBUG using System.Collections.Generic; using System.Diagnostics; namespace AspClassic.Parser; /// /// A parse tree for a possibly generic block declaration. /// public abstract class GenericBlockDeclaration : BlockDeclaration { private readonly TypeParameterCollection _TypeParameters; /// /// The type parameters of the type, if any. /// 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 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 childList) { base.GetChildTrees(childList); Tree.AddChild(childList, TypeParameters); } }