progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
58
AspClassic.Parser/TryBlockStatement.cs
Normal file
58
AspClassic.Parser/TryBlockStatement.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for a Try statement.
|
||||
/// </summary>
|
||||
public sealed class TryBlockStatement : BlockStatement
|
||||
{
|
||||
private readonly StatementCollection _CatchBlockStatements;
|
||||
|
||||
private readonly FinallyBlockStatement _FinallyBlockStatement;
|
||||
|
||||
private readonly EndBlockStatement _EndStatement;
|
||||
|
||||
/// <summary>
|
||||
/// The Catch statements.
|
||||
/// </summary>
|
||||
public StatementCollection CatchBlockStatements => _CatchBlockStatements;
|
||||
|
||||
/// <summary>
|
||||
/// The Finally statement, if any.
|
||||
/// </summary>
|
||||
public FinallyBlockStatement FinallyBlockStatement => _FinallyBlockStatement;
|
||||
|
||||
/// <summary>
|
||||
/// The End Try statement, if any.
|
||||
/// </summary>
|
||||
public EndBlockStatement EndStatement => _EndStatement;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for a Try statement.
|
||||
/// </summary>
|
||||
/// <param name="statements">The statements in the Try block.</param>
|
||||
/// <param name="catchBlockStatements">The Catch statements.</param>
|
||||
/// <param name="finallyBlockStatement">The Finally statement, if any.</param>
|
||||
/// <param name="endStatement">The End Try statement, if any.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
/// <param name="comments">The comments of the parse tree.</param>
|
||||
public TryBlockStatement(StatementCollection statements, StatementCollection catchBlockStatements, FinallyBlockStatement finallyBlockStatement, EndBlockStatement endStatement, Span span, IList<Comment> comments)
|
||||
: base(TreeType.TryBlockStatement, statements, span, comments)
|
||||
{
|
||||
SetParent(catchBlockStatements);
|
||||
SetParent(finallyBlockStatement);
|
||||
SetParent(endStatement);
|
||||
_CatchBlockStatements = catchBlockStatements;
|
||||
_FinallyBlockStatement = finallyBlockStatement;
|
||||
_EndStatement = endStatement;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
base.GetChildTrees(childList);
|
||||
Tree.AddChild(childList, CatchBlockStatements);
|
||||
Tree.AddChild(childList, FinallyBlockStatement);
|
||||
Tree.AddChild(childList, EndStatement);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue