This commit is contained in:
Jelle Luteijn 2022-05-15 11:19:49 +02:00
parent 16e76d6b31
commit 484dbfc9d9
529 changed files with 113694 additions and 0 deletions

View file

@ -0,0 +1,39 @@
#define DEBUG
using System.Collections.Generic;
using System.Diagnostics;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a statement that refers to a label.
/// </summary>
public abstract class LabelReferenceStatement : Statement
{
private readonly SimpleName _Name;
private readonly bool _IsLineNumber;
/// <summary>
/// The name of the label being referred to.
/// </summary>
public SimpleName Name => _Name;
/// <summary>
/// Whether the label is a line number.
/// </summary>
public bool IsLineNumber => _IsLineNumber;
protected LabelReferenceStatement(TreeType type, SimpleName name, bool isLineNumber, Span span, IList<Comment> comments)
: base(type, span, comments)
{
Debug.Assert(type == TreeType.GotoStatement || type == TreeType.LabelStatement || type == TreeType.OnErrorStatement || type == TreeType.ResumeStatement);
SetParent(name);
_Name = name;
_IsLineNumber = isLineNumber;
}
protected override void GetChildTrees(IList<Tree> childList)
{
Tree.AddChild(childList, Name);
}
}