progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
32
AspClassic.Parser/UnaryOperatorExpression.cs
Normal file
32
AspClassic.Parser/UnaryOperatorExpression.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an unary operator expression.
|
||||
/// </summary>
|
||||
public sealed class UnaryOperatorExpression : UnaryExpression
|
||||
{
|
||||
private OperatorType _Operator;
|
||||
|
||||
/// <summary>
|
||||
/// The operator.
|
||||
/// </summary>
|
||||
public OperatorType Operator => _Operator;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new unary operator expression parse tree.
|
||||
/// </summary>
|
||||
/// <param name="operator">The type of the unary operator.</param>
|
||||
/// <param name="operand">The operand of the operator.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
public UnaryOperatorExpression(OperatorType @operator, Expression operand, Span span)
|
||||
: base(TreeType.UnaryOperatorExpression, operand, span)
|
||||
{
|
||||
if (@operator < OperatorType.UnaryPlus || @operator > OperatorType.Not)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("operator");
|
||||
}
|
||||
_Operator = @operator;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue