ExpressionEvaluator class

Information on how to evaluate an expression.

Constructors

ExpressionEvaluator(string, EvaluateExpressionDelegate, ReturnType, ValidateExpressionDelegate)

Initializes a new instance of the class.

Properties

negation

Gets the evaluator that is a negation of this one. Sets the evaluator that is a negation of this one.

returnType

Type expected by evaluating the expression.

type

Gets the expression type for evaluator.

Methods

tryEvaluate(Expression, MemoryInterface, Options)

Evaluate an expression.

validateExpression(Expression)

Validate an expression.

Constructor Details

ExpressionEvaluator(string, EvaluateExpressionDelegate, ReturnType, ValidateExpressionDelegate)

Initializes a new instance of the class.

new ExpressionEvaluator(type: string, evaluator: EvaluateExpressionDelegate, returnType: ReturnType, validator?: ValidateExpressionDelegate)

Parameters

type

string

Expression type.

evaluator
EvaluateExpressionDelegate

Delegate to evaluate an expression.

returnType
ReturnType

Type expected from evaluation.

validator
ValidateExpressionDelegate

Static validation of expression.

Property Details

negation

Gets the evaluator that is a negation of this one. Sets the evaluator that is a negation of this one.

ExpressionEvaluator negation

Property Value

The evaluator that is a negation of this one.

returnType

Type expected by evaluating the expression.

returnType: ReturnType

Property Value

type

Gets the expression type for evaluator.

type: string

Property Value

string

Method Details

tryEvaluate(Expression, MemoryInterface, Options)

Evaluate an expression.

function tryEvaluate(expression: Expression, state: MemoryInterface, options: Options): ValueWithError

Parameters

expression
Expression

Expression to evaluate.

state
MemoryInterface

Global state information.

options
Options

Options used in the evaluation.

Returns

The value and error string that is non-null if there is an error.

validateExpression(Expression)

Validate an expression.

function validateExpression(expression: Expression)

Parameters

expression
Expression

Expression to validate.