progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
54
AspClassic.Parser/IntrinsicCastExpression.cs
Normal file
54
AspClassic.Parser/IntrinsicCastExpression.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an intrinsic conversion expression.
|
||||
/// </summary>
|
||||
public sealed class IntrinsicCastExpression : UnaryExpression
|
||||
{
|
||||
private readonly IntrinsicType _IntrinsicType;
|
||||
|
||||
private readonly Location _LeftParenthesisLocation;
|
||||
|
||||
private readonly Location _RightParenthesisLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The intrinsic type conversion.
|
||||
/// </summary>
|
||||
public IntrinsicType IntrinsicType => _IntrinsicType;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the '('.
|
||||
/// </summary>
|
||||
public Location LeftParenthesisLocation => _LeftParenthesisLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the ')'.
|
||||
/// </summary>
|
||||
public Location RightParenthesisLocation => _RightParenthesisLocation;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for an intrinsic conversion expression.
|
||||
/// </summary>
|
||||
/// <param name="intrinsicType">The intrinsic type conversion.</param>
|
||||
/// <param name="leftParenthesisLocation">The location of the '('.</param>
|
||||
/// <param name="operand">The expression to convert.</param>
|
||||
/// <param name="rightParenthesisLocation">The location of the ')'.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
public IntrinsicCastExpression(IntrinsicType intrinsicType, Location leftParenthesisLocation, Expression operand, Location rightParenthesisLocation, Span span)
|
||||
: base(TreeType.IntrinsicCastExpression, operand, span)
|
||||
{
|
||||
if (intrinsicType < IntrinsicType.Boolean || intrinsicType > IntrinsicType.Object)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("intrinsicType");
|
||||
}
|
||||
if (operand == null)
|
||||
{
|
||||
throw new ArgumentNullException("operand");
|
||||
}
|
||||
_IntrinsicType = intrinsicType;
|
||||
_LeftParenthesisLocation = leftParenthesisLocation;
|
||||
_RightParenthesisLocation = rightParenthesisLocation;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue