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

41 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for the block of a Case Else statement.
/// </summary>
public sealed class CaseElseBlockStatement : BlockStatement
{
private readonly CaseElseStatement _CaseElseStatement;
/// <summary>
/// The Case Else statement that started the block.
/// </summary>
public CaseElseStatement CaseElseStatement => _CaseElseStatement;
/// <summary>
/// Constructs a new parse tree for the block of a Case Else statement.
/// </summary>
/// <param name="caseElseStatement">The Case Else statement that started the block.</param>
/// <param name="statements">The statements in the block.</param>
/// <param name="span">The location of the parse tree.</param>
/// <param name="comments">The comments of the tree.</param>
public CaseElseBlockStatement(CaseElseStatement caseElseStatement, StatementCollection statements, Span span, IList<Comment> comments)
: base(TreeType.CaseElseBlockStatement, statements, span, comments)
{
if (caseElseStatement == null)
{
throw new ArgumentNullException("caseElseStatement");
}
SetParent(caseElseStatement);
_CaseElseStatement = caseElseStatement;
}
protected override void GetChildTrees(IList<Tree> childList)
{
Tree.AddChild(childList, CaseElseStatement);
base.GetChildTrees(childList);
}
}