progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
38
AspClassic.Parser/Expression.cs
Normal file
38
AspClassic.Parser/Expression.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
#define DEBUG
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an expression.
|
||||
/// </summary>
|
||||
public class Expression : Tree
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the expression is constant or not.
|
||||
/// </summary>
|
||||
public virtual bool IsConstant => false;
|
||||
|
||||
public override bool IsBad => base.Type == TreeType.SyntaxError;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a bad expression.
|
||||
/// </summary>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
/// <returns>A bad expression.</returns>
|
||||
public static Expression GetBadExpression(Span span)
|
||||
{
|
||||
return new Expression(span);
|
||||
}
|
||||
|
||||
protected Expression(TreeType type, Span span)
|
||||
: base(type, span)
|
||||
{
|
||||
Debug.Assert(type >= TreeType.SimpleNameExpression && type <= TreeType.GetTypeExpression);
|
||||
}
|
||||
|
||||
private Expression(Span span)
|
||||
: base(TreeType.SyntaxError, span)
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue