Appearance
Evaluate Method
Definition
- Namespace:
JASE.Expressions - Assembly:
JASE.Expressions.dll
Overloads
| Name | Description |
|---|---|
object Evaluate(AstNode node) | Evaluates a compiled abstract syntax tree (AST) rooted at the specified node. |
object Evaluate(ParsedExpression parsed) | Evaluates a previously parsed expression. |
object Evaluate(string expression) | |
T Evaluate(AstNode node) | Parses and evaluates an expression and converts the result to T. |
T Evaluate(ParsedExpression parsed) | Evaluates a previously parsed expression and converts the result. |
T Evaluate(string expression) | Parses and evaluates an expression and converts the result to T. |
object Evaluate(AstNode node)
csharp
object Evaluate(AstNode node)Evaluates a compiled abstract syntax tree (AST) rooted at the specified node.
Parameters
| Name | Description |
|---|---|
node | The root node of the AST to evaluate. |
Returns
The result of evaluating the expression represented by node.
object Evaluate(ParsedExpression parsed)
csharp
object Evaluate(ParsedExpression parsed)Evaluates a previously parsed expression.
object Evaluate(string expression)
csharp
object Evaluate(string expression)Remarks
This method combines tokenization, parsing, and evaluation into a single call. For advanced scenarios, you can work with Tokenizer, Parser, and AstEvaluator directly.
T Evaluate(AstNode node)
csharp
T Evaluate(AstNode node)Parses and evaluates an expression and converts the result to T.
Type parameters
| Name | Description |
|---|---|
T | The expected result type. |
Parameters
| Name | Description |
|---|---|
node | The root node of the AST to evaluate. |
Returns
The evaluated result converted to T.
T Evaluate(ParsedExpression parsed)
csharp
T Evaluate(ParsedExpression parsed)Evaluates a previously parsed expression and converts the result.
T Evaluate(string expression)
csharp
T Evaluate(string expression)Parses and evaluates an expression and converts the result to T.
Type parameters
| Name | Description |
|---|---|
T | The expected result type. |
Parameters
| Name | Description |
|---|---|
expression | The expression to parse and evaluate. |
Returns
The evaluated result converted to T.