progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
74
AspClassic.Parser/CatchStatement.cs
Normal file
74
AspClassic.Parser/CatchStatement.cs
Normal file
|
@ -0,0 +1,74 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for a Catch statement.
|
||||
/// </summary>
|
||||
public sealed class CatchStatement : Statement
|
||||
{
|
||||
private readonly SimpleName _Name;
|
||||
|
||||
private readonly Location _AsLocation;
|
||||
|
||||
private readonly TypeName _ExceptionType;
|
||||
|
||||
private readonly Location _WhenLocation;
|
||||
|
||||
private readonly Expression _FilterExpression;
|
||||
|
||||
/// <summary>
|
||||
/// The name of the catch variable, if any.
|
||||
/// </summary>
|
||||
public SimpleName Name => _Name;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the 'As', if any.
|
||||
/// </summary>
|
||||
public Location AsLocation => _AsLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The type of the catch variable, if any.
|
||||
/// </summary>
|
||||
public TypeName ExceptionType => _ExceptionType;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the 'When', if any.
|
||||
/// </summary>
|
||||
public Location WhenLocation => _WhenLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The filter expression, if any.
|
||||
/// </summary>
|
||||
public Expression FilterExpression => _FilterExpression;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for a Catch statement.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the catch variable, if any.</param>
|
||||
/// <param name="asLocation">The location of the 'As', if any.</param>
|
||||
/// <param name="exceptionType">The type of the catch variable, if any.</param>
|
||||
/// <param name="whenLocation">The location of the 'When', if any.</param>
|
||||
/// <param name="filterExpression">The filter expression, if any.</param>
|
||||
/// <param name="span">The location of the parse tree, if any.</param>
|
||||
/// <param name="comments">The comments for the parse tree, if any.</param>
|
||||
public CatchStatement(SimpleName name, Location asLocation, TypeName exceptionType, Location whenLocation, Expression filterExpression, Span span, IList<Comment> comments)
|
||||
: base(TreeType.CatchStatement, span, comments)
|
||||
{
|
||||
SetParent(name);
|
||||
SetParent(exceptionType);
|
||||
SetParent(filterExpression);
|
||||
_Name = name;
|
||||
_AsLocation = asLocation;
|
||||
_ExceptionType = exceptionType;
|
||||
_WhenLocation = whenLocation;
|
||||
_FilterExpression = filterExpression;
|
||||
}
|
||||
|
||||
protected override void GetChildTrees(IList<Tree> childList)
|
||||
{
|
||||
Tree.AddChild(childList, Name);
|
||||
Tree.AddChild(childList, ExceptionType);
|
||||
Tree.AddChild(childList, FilterExpression);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue