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