40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for an Imports declaration.
|
|
/// </summary>
|
|
public sealed class ImportsDeclaration : Declaration
|
|
{
|
|
private readonly ImportCollection _ImportMembers;
|
|
|
|
/// <summary>
|
|
/// The members imported.
|
|
/// </summary>
|
|
public ImportCollection ImportMembers => _ImportMembers;
|
|
|
|
/// <summary>
|
|
/// Constructs a parse tree for an Imports declaration.
|
|
/// </summary>
|
|
/// <param name="importMembers">The members imported.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
/// <param name="comments">The comments for the parse tree.</param>
|
|
public ImportsDeclaration(ImportCollection importMembers, Span span, IList<Comment> comments)
|
|
: base(TreeType.ImportsDeclaration, span, comments)
|
|
{
|
|
if (importMembers == null)
|
|
{
|
|
throw new ArgumentNullException("importMembers");
|
|
}
|
|
SetParent(importMembers);
|
|
_ImportMembers = importMembers;
|
|
}
|
|
|
|
protected override void GetChildTrees(IList<Tree> childList)
|
|
{
|
|
base.GetChildTrees(childList);
|
|
Tree.AddChild(childList, ImportMembers);
|
|
}
|
|
}
|