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

Constructor Summary
InterpretingCompiler(Interpreter interpreter)
           
 
Method Summary
 Expression compileExpression(java.lang.String expression)
          Compiles an expression intended for evaluation that produces a value.
 IterationExpression compileIterationExpression(java.lang.String expression)
          Compiles an expression describing an iteration.
 VariableExpression compileVariableExpression(java.lang.String expression)
          Compiles an expression describing the left hand side of an assignment.
 
Methods inherited from class com.plotnix.jex.Compiler
getCompiler, getCompilerImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterpretingCompiler

public InterpretingCompiler(Interpreter interpreter)
Parameters:
interpreter - is the interpreter that needs to be wrapped
Method Detail

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