33 lines
815 B
C#
33 lines
815 B
C#
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for an entire file.
|
|
/// </summary>
|
|
public sealed class File : Tree
|
|
{
|
|
private readonly DeclarationCollection _Declarations;
|
|
|
|
/// <summary>
|
|
/// The declarations in the file.
|
|
/// </summary>
|
|
public DeclarationCollection Declarations => _Declarations;
|
|
|
|
/// <summary>
|
|
/// Constructs a new file parse tree.
|
|
/// </summary>
|
|
/// <param name="declarations">The declarations in the file.</param>
|
|
/// <param name="span">The location of the tree.</param>
|
|
public File(DeclarationCollection declarations, Span span)
|
|
: base(TreeType.File, span)
|
|
{
|
|
SetParent(declarations);
|
|
_Declarations = declarations;
|
|
}
|
|
|
|
protected override void GetChildTrees(IList<Tree> childList)
|
|
{
|
|
Tree.AddChild(childList, Declarations);
|
|
}
|
|
}
|