com.plotnix.jex.adapters
Class InterpretingCompiler
java.lang.Object
|
+--com.plotnix.jex.Compiler
|
+--com.plotnix.jex.adapters.InterpretingCompiler
- public class InterpretingCompiler
- extends Compiler
A wrapper for an interpreter that makes it behave like a compiler.
Each compilation method checks the syntax of the expression and
wraps the expression into an InterpretedExpression
, which is a wrapper for the expression string.
- Version:
- $Revision$
- Author:
- Dmitri Plotnikov
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InterpretingCompiler
public InterpretingCompiler(Interpreter interpreter)
- Parameters:
interpreter
- is the interpreter that needs to be wrapped
compileExpression
public Expression compileExpression(java.lang.String expression)
- Description copied from class:
Compiler
- Compiles an expression intended for evaluation
that produces a value. For example,
"2+2"
will be a valid argument for this method
for many expression languages.
May throw an UnsupportedOperationException.
- Overrides:
compileExpression
in class Compiler
- See Also:
Compiler.compileExpression(String)
compileIterationExpression
public IterationExpression compileIterationExpression(java.lang.String expression)
- Description copied from class:
Compiler
- Compiles an expression describing an iteration.
For example,
"addressBook//phone"
is a valid
argument for this method for an XPath compiler.
May throw an UnsupportedOperationException.
- Overrides:
compileIterationExpression
in class Compiler
- See Also:
Compiler.compileIterationExpression(String)
compileVariableExpression
public VariableExpression compileVariableExpression(java.lang.String expression)
- Description copied from class:
Compiler
- Compiles an expression describing the left hand side
of an assignment.
For example,
"addressBook/contact[name="John Doe"]/phone"
is a valid argument for this method for an XPath compiler.
May throw an UnsupportedOperationException.
- Overrides:
compileVariableExpression
in class Compiler
- See Also:
Compiler.compileVariableExpression(String)
Copyright (c) 2002 - Plotnix, Inc