org.datanucleus.query.compiler
Class JPQLParser

java.lang.Object
  extended by org.datanucleus.query.compiler.JPQLParser
All Implemented Interfaces:
Parser

public class JPQLParser
extends java.lang.Object
implements Parser

Implementation of a parser for JPQL query language.


Constructor Summary
JPQLParser(java.util.Map options)
          Constructor for a JPQL Parser.
 
Method Summary
 Node compile(java.lang.String expression)
           
protected  void compileAdditiveExpression()
           
 Node[] compileFrom(java.lang.String expression)
          Method to compile the "from" clause, but JDOQL has no "from" so do nothing.
protected  boolean compileLiteral()
          A literal is one value of any type.
protected  void compileMultiplicativeExpression()
           
 Node[] compileOrder(java.lang.String expression)
           
 Node[][] compileParameters(java.lang.String expression)
           
protected  void compilePrimary()
          Compiles the primary.
 Node[] compileTupple(java.lang.String expression)
           
protected  void compileUnaryExpression()
           
protected  void compileUnaryExpressionNotPlusMinus()
           
 Node compileVariable(java.lang.String expression)
           
 Node[][] compileVariables(java.lang.String expression)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPQLParser

public JPQLParser(java.util.Map options)
Constructor for a JPQL Parser.

Parameters:
options - parser options
Method Detail

compile

public Node compile(java.lang.String expression)
Specified by:
compile in interface Parser

compileVariable

public Node compileVariable(java.lang.String expression)
Specified by:
compileVariable in interface Parser

compileFrom

public Node[] compileFrom(java.lang.String expression)
Method to compile the "from" clause, but JDOQL has no "from" so do nothing.

Specified by:
compileFrom in interface Parser
Parameters:
expression - From string
Returns:
Node trees for this from clause

compileOrder

public Node[] compileOrder(java.lang.String expression)
Specified by:
compileOrder in interface Parser

compileTupple

public Node[] compileTupple(java.lang.String expression)
Specified by:
compileTupple in interface Parser

compileVariables

public Node[][] compileVariables(java.lang.String expression)
Specified by:
compileVariables in interface Parser

compileParameters

public Node[][] compileParameters(java.lang.String expression)
Specified by:
compileParameters in interface Parser

compileAdditiveExpression

protected void compileAdditiveExpression()

compileMultiplicativeExpression

protected void compileMultiplicativeExpression()

compileUnaryExpression

protected void compileUnaryExpression()

compileUnaryExpressionNotPlusMinus

protected void compileUnaryExpressionNotPlusMinus()

compilePrimary

protected void compilePrimary()
Compiles the primary. First look for a literal (e.g. "text"), then an identifier(e.g. variable) In the next step, call a function, if executing a function, on the literal or the identifier found.


compileLiteral

protected boolean compileLiteral()
A literal is one value of any type. Supported literals are of types String, Floating Point, Integer, Character, Boolean and null e.g. 'J', "String", 1, 1.8, true, false, null.

Returns:
The compiled literal


Copyright © 2009. All Rights Reserved.