|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.plotnix.jex.Interpreter
|
+--com.plotnix.jex.adapters.CompilingInterpreter
A wrapper for a compiler that makes it behave like an interpreter. Each expression evaluation method first compiles the expression and then invokes the resulting compiled expression.
The syntax checking methods invoke the compiler and throw away the resulting compiled expression.
| Constructor Summary | |
CompilingInterpreter(Compiler compiler)
|
|
| Method Summary | |
void |
assign(Context context,
java.lang.String expression,
java.lang.Object value,
java.lang.Object[] arguments)
Modifies a value in the specified context according to the expression and the supplied arguments. |
java.lang.Object |
evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
Evaluates the expression in the supplied context. |
java.lang.Object |
evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments,
java.lang.Class valueType)
Evaluates the expression and casts the result to the supplied type. |
java.util.Iterator |
iterate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
Produces the iterator described by the expression in the specified context. |
void |
validateExpression(java.lang.String expression)
Checks the syntax of an expression intended for evaluation with evaluate and throws an exception
if there is an error. |
void |
validateIterationExpression(java.lang.String expression)
Checks the syntax of an expression intended for evaluation with iterate and throws an exception
if there is an error. |
void |
validateVariableExpression(java.lang.String expression)
Checks the syntax of an expression intended for evaluation with assign and throws an exception
if there is an error. |
| Methods inherited from class com.plotnix.jex.Interpreter |
getInterpreter, getInterpreterImplementation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CompilingInterpreter(Compiler compiler)
compiler - is the compiler that needs to be wrapped| Method Detail |
public java.lang.Object evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
Interpreterevaluate in class InterpreterInterpreter.evaluate(Context, String, Object[])
public java.lang.Object evaluate(Context context,
java.lang.String expression,
java.lang.Object[] arguments,
java.lang.Class valueType)
Interpreterevaluate in class InterpreterInterpreter.evaluate(Context, String, Object[], Class)
public java.util.Iterator iterate(Context context,
java.lang.String expression,
java.lang.Object[] arguments)
Interpreteriterate in class InterpreterInterpreter.iterate(Context, String, Object[])
public void assign(Context context,
java.lang.String expression,
java.lang.Object value,
java.lang.Object[] arguments)
Interpreterassign in class InterpreterInterpreter.assign(Context, String, Object, Object[])public void validateExpression(java.lang.String expression)
Interpreterevaluate and throws an exception
if there is an error.validateExpression in class InterpreterInterpreter.validateExpression(String)public void validateIterationExpression(java.lang.String expression)
Interpreteriterate and throws an exception
if there is an error.validateIterationExpression in class InterpreterInterpreter.validateIterationExpression(String)public void validateVariableExpression(java.lang.String expression)
Interpreterassign and throws an exception
if there is an error.validateVariableExpression in class InterpreterInterpreter.validateVariableExpression(String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||