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