aspclassic-core/AspClassic.Parser/ResumeStatement.cs
Jelle Luteijn 484dbfc9d9 progress
2022-05-15 11:19:49 +02:00

52 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a Resume statement.
/// </summary>
public sealed class ResumeStatement : LabelReferenceStatement
{
private readonly ResumeType _ResumeType;
private readonly Location _NextLocation;
/// <summary>
/// The type of the Resume statement.
/// </summary>
public ResumeType ResumeType => _ResumeType;
/// <summary>
/// The location of the 'Next', if any.
/// </summary>
public Location NextLocation => _NextLocation;
/// <summary>
/// Constructs a parse tree for a Resume statement.
/// </summary>
/// <param name="resumeType">The type of the Resume statement.</param>
/// <param name="nextLocation">The location of the 'Next', if any.</param>
/// <param name="name">The label name, if any.</param>
/// <param name="isLineNumber">Whether the label is a line number.</param>
/// <param name="span">The location of the parse tree.</param>
/// <param name="comments">The comments of the parse tree.</param>
public ResumeStatement(ResumeType resumeType, Location nextLocation, SimpleName name, bool isLineNumber, Span span, IList<Comment> comments)
: base(TreeType.ResumeStatement, name, isLineNumber, span, comments)
{
if (resumeType < ResumeType.None || resumeType > ResumeType.Label)
{
throw new ArgumentOutOfRangeException("resumeType");
}
_ResumeType = resumeType;
_NextLocation = nextLocation;
}
protected override void GetChildTrees(IList<Tree> childList)
{
if (ResumeType == ResumeType.Label)
{
base.GetChildTrees(childList);
}
}
}