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

41 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a Catch block statement.
/// </summary>
public sealed class CatchBlockStatement : BlockStatement
{
private readonly CatchStatement _CatchStatement;
/// <summary>
/// The Catch statement.
/// </summary>
public CatchStatement CatchStatement => _CatchStatement;
/// <summary>
/// Constructs a new parse tree for a Catch block statement.
/// </summary>
/// <param name="catchStatement">The Catch statement.</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 for the parse tree.</param>
public CatchBlockStatement(CatchStatement catchStatement, StatementCollection statements, Span span, IList<Comment> comments)
: base(TreeType.CatchBlockStatement, statements, span, comments)
{
if (catchStatement == null)
{
throw new ArgumentNullException("catchStatement");
}
SetParent(catchStatement);
_CatchStatement = catchStatement;
}
protected override void GetChildTrees(IList<Tree> childList)
{
Tree.AddChild(childList, CatchStatement);
base.GetChildTrees(childList);
}
}