#define DEBUG
using System.Collections.Generic;
using System.Diagnostics;
namespace AspClassic.Parser;
///
/// A parse tree for a statement that refers to a label.
///
public abstract class LabelReferenceStatement : Statement
{
private readonly SimpleName _Name;
private readonly bool _IsLineNumber;
///
/// The name of the label being referred to.
///
public SimpleName Name => _Name;
///
/// Whether the label is a line number.
///
public bool IsLineNumber => _IsLineNumber;
protected LabelReferenceStatement(TreeType type, SimpleName name, bool isLineNumber, Span span, IList 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 childList)
{
Tree.AddChild(childList, Name);
}
}