ExpressionClassExpression, LiteralExpressionpublic abstract class BaseExpression extends Object implements Expression
| Modifier and Type | Field | Description |
|---|---|---|
static String |
FUNC_PARAMS_VAR |
|
protected AviatorEvaluatorInstance |
instance |
|
protected SymbolTable |
symbolTable |
| Constructor | Description |
|---|---|
BaseExpression(AviatorEvaluatorInstance instance,
List<String> varNames,
SymbolTable symbolTable) |
| Modifier and Type | Method | Description |
|---|---|---|
String |
addSymbol(String name) |
Adds the specified symbol to the symbol table and returns a reference to the unique symbol.
|
Object |
execute() |
Execute expression with empty environment
|
Object |
execute(Map<String,Object> map) |
Execute expression with environment
|
abstract Object |
executeDirectly(Map<String,Object> env) |
|
protected Env |
genTopEnv(Map<String,Object> map) |
|
Env |
getCompileEnv() |
|
String |
getExpression() |
Returns the expression string when turn on
Options.TRACE_EVAL option, else returns
null. |
AviatorEvaluatorInstance.StringSegments |
getStringSegements(String lexeme) |
|
List<String> |
getVariableFullNames() |
Returns this expression's all variable full names in order when using AviatorEvaluator.EVAL
mode,else returns empty set
|
List<String> |
getVariableNames() |
Returns this expression's all variable names in order when using AviatorEvaluator.EVAL
mode,else returns empty set
|
Map<String,Object> |
newEnv(Object... args) |
Created a faster env map(compare variable names by reference).The arguments should be a
sequence of pair
|
protected Env |
newEnv(Map<String,Object> map) |
|
protected Env |
newEnv(Map<String,Object> map,
boolean direct) |
|
void |
setCompileEnv(Env compileEnv) |
|
void |
setExpression(String expression) |
|
void |
setFuncsArgs(Map<Integer,List<FunctionArgument>> funcsArgs) |
public static final String FUNC_PARAMS_VAR
protected AviatorEvaluatorInstance instance
protected SymbolTable symbolTable
public BaseExpression(AviatorEvaluatorInstance instance, List<String> varNames, SymbolTable symbolTable)
public AviatorEvaluatorInstance.StringSegments getStringSegements(String lexeme)
public Map<String,Object> newEnv(Object... args)
ExpressionnewEnv in interface Expressionpublic Object execute(Map<String,Object> map)
Expressionexecute in interface Expressionmap - Binding variable environmentpublic void setFuncsArgs(Map<Integer,List<FunctionArgument>> funcsArgs)
public Env getCompileEnv()
public void setCompileEnv(Env compileEnv)
public String getExpression()
Options.TRACE_EVAL option, else returns
null.public void setExpression(String expression)
public String addSymbol(String name)
ExpressionaddSymbol in interface Expressionname - The symbol name.public Object execute()
Expressionexecute in interface Expressionpublic List<String> getVariableFullNames()
ExpressiongetVariableFullNames in interface Expressionpublic List<String> getVariableNames()
ExpressiongetVariableNames in interface ExpressionAviatorEvaluator.EVALCopyright © 2022–2023. All rights reserved.