|
|||||||||
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 wrappedMethod Detail |
public java.lang.Object evaluate(Context context, java.lang.String expression, java.lang.Object[] arguments)
Interpreter
evaluate
in class Interpreter
Interpreter.evaluate(Context, String, Object[])
public java.lang.Object evaluate(Context context, java.lang.String expression, java.lang.Object[] arguments, java.lang.Class valueType)
Interpreter
evaluate
in class Interpreter
Interpreter.evaluate(Context, String, Object[], Class)
public java.util.Iterator iterate(Context context, java.lang.String expression, java.lang.Object[] arguments)
Interpreter
iterate
in class Interpreter
Interpreter.iterate(Context, String, Object[])
public void assign(Context context, java.lang.String expression, java.lang.Object value, java.lang.Object[] arguments)
Interpreter
assign
in class Interpreter
Interpreter.assign(Context, String, Object, Object[])
public void validateExpression(java.lang.String expression)
Interpreter
evaluate
and throws an exception
if there is an error.validateExpression
in class Interpreter
Interpreter.validateExpression(String)
public void validateIterationExpression(java.lang.String expression)
Interpreter
iterate
and throws an exception
if there is an error.validateIterationExpression
in class Interpreter
Interpreter.validateIterationExpression(String)
public void validateVariableExpression(java.lang.String expression)
Interpreter
assign
and throws an exception
if there is an error.validateVariableExpression
in class Interpreter
Interpreter.validateVariableExpression(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |