progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
39
AspClassic.Parser/LabelReferenceStatement.cs
Normal file
39
AspClassic.Parser/LabelReferenceStatement.cs
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue