public class Expression
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private PreprocessorContext |
context
The variable contains the preprocessor context for the expression, it can be null
|
private ExpressionTree |
expressionTree
The variable contains the expression tree
|
private static java.lang.Class<?>[] |
OPERATOR_SIGNATURE_1
Precreated array for speed up operations
|
private static java.lang.Class<?>[] |
OPERATOR_SIGNATURE_2
Precreated array for speed up operations
|
| Modifier | Constructor and Description |
|---|---|
private |
Expression(PreprocessorContext context,
ExpressionTree tree) |
| Modifier and Type | Method and Description |
|---|---|
private ExpressionTreeElement |
calculateTreeElement(ExpressionTreeElement element,
PreprocessingState state) |
private Value |
eval(PreprocessingState state) |
static Value |
evalExpression(java.lang.String expression,
PreprocessorContext context)
Evaluate expression
|
private ExpressionTreeElement |
evalFunction(ExpressionTreeElement functionElement,
PreprocessingState state) |
private ExpressionTreeElement |
evalOperator(ExpressionTreeElement operatorElement,
PreprocessingState state) |
static Value |
evalTree(ExpressionTree tree,
PreprocessorContext context)
Evaluate an expression tree
|
private static final java.lang.Class<?>[] OPERATOR_SIGNATURE_1
private static final java.lang.Class<?>[] OPERATOR_SIGNATURE_2
private final PreprocessorContext context
private final ExpressionTree expressionTree
private Expression(PreprocessorContext context, ExpressionTree tree)
public static Value evalExpression(java.lang.String expression, PreprocessorContext context)
expression - the expression as a String, must not be nullcontext - a preprocessor context to be used for expression operationspublic static Value evalTree(ExpressionTree tree, PreprocessorContext context)
tree - an expression tree, it must not be nullcontext - a preprocessor context to be used for expression operationsprivate ExpressionTreeElement evalFunction(ExpressionTreeElement functionElement, PreprocessingState state)
private ExpressionTreeElement evalOperator(ExpressionTreeElement operatorElement, PreprocessingState state)
private ExpressionTreeElement calculateTreeElement(ExpressionTreeElement element, PreprocessingState state)
private Value eval(PreprocessingState state)