org.datanucleus.query.compiler
Class JDOQLParser

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

public class JDOQLParser
extends java.lang.Object
implements Parser

Implementation of a parser for JDOQL query language. Generates Node tree(s) by use of the various compileXXX() methods.


Field Summary
protected static Localiser LOCALISER
          Localiser for messages.
 
Constructor Summary
JDOQLParser(java.util.Map options)
          Constructor for a JDOQL 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
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localiser for messages.

Constructor Detail

JDOQLParser

public JDOQLParser(java.util.Map options)
Constructor for a JDOQL Parser. Supports "jdoql.level" option so can have strict JDO2 syntax, or flexible.

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.