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

40 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for an Inherits declaration.
/// </summary>
public sealed class InheritsDeclaration : Declaration
{
private readonly TypeNameCollection _InheritedTypes;
/// <summary>
/// The list of types.
/// </summary>
public TypeNameCollection InheritedTypes => _InheritedTypes;
/// <summary>
/// Constructs a parse tree for an Inherits declaration.
/// </summary>
/// <param name="inheritedTypes">The types inherited or implemented.</param>
/// <param name="span">The location of the parse tree.</param>
/// <param name="comments">The comments for the parse tree.</param>
public InheritsDeclaration(TypeNameCollection inheritedTypes, Span span, IList<Comment> comments)
: base(TreeType.InheritsDeclaration, span, comments)
{
if (inheritedTypes == null)
{
throw new ArgumentNullException("inheritedTypes");
}
SetParent(inheritedTypes);
_InheritedTypes = inheritedTypes;
}
protected override void GetChildTrees(IList<Tree> childList)
{
base.GetChildTrees(childList);
Tree.AddChild(childList, InheritedTypes);
}
}