org.xorm.query.jdoql
Class JDOQL

java.lang.Object
  |
  +--org.xorm.query.AbstractQueryLanguage
        |
        +--org.xorm.query.jdoql.JDOQL
All Implemented Interfaces:
Cloneable, JDOQLConstants, QueryLanguage

public class JDOQL
extends AbstractQueryLanguage
implements JDOQLConstants

This class, generated by JavaCC, contains the grammar described in the Java Data Objects specification, transformed from LALR to LL by unrolling any instances of left recursion. For the sake of clarity, I have removed the production name(), which is listed in the JDO spec. At the raw grammar level, we don't have enough contextual information to determine which IDs are fields, parameters, or variables. The symbolic names fieldAccess() and methodInvocation() are dealt with inline in the _primary() production, rather than having top-level names. The output of this parser is an instance of org.xorm.query.Expression that represents the Expression parse tree. Because Expression trees can be created from other sources for use in XORM (for example, the CodeQuery class converts JVM bytecode to Expressions) I felt it was best NOT to use JJTree.

Author:
Wes Biggs

Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 JDOQLTokenManager token_source
           
 
Fields inherited from class org.xorm.query.AbstractQueryLanguage
clazz, paramNameToType, varNameToType
 
Fields inherited from interface org.xorm.query.jdoql.JDOQLConstants
ANDC, ANDL, CHARACTER_LITERAL, COMMA, COMP, DECIMAL_LITERAL, DEFAULT, DIGIT, DIVIDE, DOT, DOUBLESUFFIX, EOF, EOL, EQ, EXPONENT, FALSE, FLOATING_POINT_LITERAL, FLOATSUFFIX, GT, GTE, ID, INTEGER_LITERAL, LETTER, LONGSUFFIX, LPAREN, LT, LTE, MINUS, NE, NOT, NULL, ORC, ORL, PLUS, RPAREN, STRING_LITERAL, THIS, TIMES, tokenImage, TRUE, UNDERSCORE, XOR
 
Fields inherited from interface org.xorm.query.QueryLanguage
LANGUAGE
 
Constructor Summary
JDOQL()
           
JDOQL(InputStream stream)
           
JDOQL(JDOQLTokenManager tm)
           
JDOQL(Reader stream)
           
 
Method Summary
 void _additive()
           
 void _and()
           
 void _argumentList()
           
 void _conditionalAnd()
           
 void _conditionalOr()
           
 void _equality()
           
 void _exclusiveOr()
           
 void _inclusiveOr()
           
 void _multiplicative()
           
 void _primary()
           
 void _relational()
           
 void additive()
           
 void and()
           
 void argumentList()
           
 void cast()
           
 void clear()
          This is an empty-grammar pattern that gives the expression generator a hint that it's now working on a new expression.
 void compile()
          A hint that the implementation should undertake the work of generating the Expression object now for future use.
 void conditionalAnd()
           
 void conditionalOr()
           
 void disable_tracing()
           
 void enable_tracing()
           
 void equality()
           
 void exclusiveOr()
           
 void expression()
          This is the top-level method that gets called to parse the JDOQL filter expression.
 ParseException generateParseException()
           
 Expression getExpression()
          Returns the query expression generated by this object.
 Token getNextToken()
           
 Token getToken(int index)
           
 void inclusiveOr()
           
 void literal()
           
static void main(String[] args)
          Test bootstrap.
 void multiplicative()
           
 void primary()
           
static Character readChar(StringReader reader)
          Returns the character read after escaping, or null if at the end of the input.
 void ReInit(InputStream stream)
           
 void ReInit(JDOQLTokenManager tm)
           
 void ReInit(Reader stream)
           
 void relational()
           
 void setFilter(Object filter)
           
 void type()
           
 void unary()
           
 void unaryNotPlusMinus()
           
 
Methods inherited from class org.xorm.query.AbstractQueryLanguage
addOrdering, declareParameter, declareVariable, getCandidateClass, getOrdering, getParameterNames, getParameterType, getVariableNames, getVariableType, setClass, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

token_source

public JDOQLTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

JDOQL

public JDOQL()

JDOQL

public JDOQL(InputStream stream)

JDOQL

public JDOQL(Reader stream)

JDOQL

public JDOQL(JDOQLTokenManager tm)
Method Detail

main

public static void main(String[] args)
                 throws ParseException,
                        IOException
Test bootstrap. Allows you to enter JDOQL expressions using STDIN and see the results. For the purposes of testing, variables var, var2 and var3 and parameters param, param2, and param3 are declared.

ParseException
IOException

compile

public void compile()
             throws QuerySyntaxException
Description copied from interface: QueryLanguage
A hint that the implementation should undertake the work of generating the Expression object now for future use.

Specified by:
compile in interface QueryLanguage
Specified by:
compile in class AbstractQueryLanguage
QuerySyntaxException

setFilter

public void setFilter(Object filter)
Specified by:
setFilter in class AbstractQueryLanguage

getExpression

public Expression getExpression()
Description copied from interface: QueryLanguage
Returns the query expression generated by this object. This method may return null if compile() has not been called.

Specified by:
getExpression in interface QueryLanguage
Specified by:
getExpression in class AbstractQueryLanguage

readChar

public static Character readChar(StringReader reader)
Returns the character read after escaping, or null if at the end of the input.


literal

public final void literal()
                   throws ParseException
ParseException

clear

public final void clear()
                 throws ParseException
This is an empty-grammar pattern that gives the expression generator a hint that it's now working on a new expression.

ParseException

expression

public final void expression()
                      throws ParseException
This is the top-level method that gets called to parse the JDOQL filter expression.

ParseException

conditionalOr

public final void conditionalOr()
                         throws ParseException
ParseException

_conditionalOr

public final void _conditionalOr()
                          throws ParseException
ParseException

conditionalAnd

public final void conditionalAnd()
                          throws ParseException
ParseException

_conditionalAnd

public final void _conditionalAnd()
                           throws ParseException
ParseException

inclusiveOr

public final void inclusiveOr()
                       throws ParseException
ParseException

_inclusiveOr

public final void _inclusiveOr()
                        throws ParseException
ParseException

exclusiveOr

public final void exclusiveOr()
                       throws ParseException
ParseException

_exclusiveOr

public final void _exclusiveOr()
                        throws ParseException
ParseException

and

public final void and()
               throws ParseException
ParseException

_and

public final void _and()
                throws ParseException
ParseException

equality

public final void equality()
                    throws ParseException
ParseException

_equality

public final void _equality()
                     throws ParseException
ParseException

relational

public final void relational()
                      throws ParseException
ParseException

_relational

public final void _relational()
                       throws ParseException
ParseException

additive

public final void additive()
                    throws ParseException
ParseException

_additive

public final void _additive()
                     throws ParseException
ParseException

multiplicative

public final void multiplicative()
                          throws ParseException
ParseException

_multiplicative

public final void _multiplicative()
                           throws ParseException
ParseException

unary

public final void unary()
                 throws ParseException
ParseException

unaryNotPlusMinus

public final void unaryNotPlusMinus()
                             throws ParseException
ParseException

cast

public final void cast()
                throws ParseException
ParseException

type

public final void type()
                throws ParseException
ParseException

primary

public final void primary()
                   throws ParseException
ParseException

_primary

public final void _primary()
                    throws ParseException
ParseException

argumentList

public final void argumentList()
                        throws ParseException
ParseException

_argumentList

public final void _argumentList()
                         throws ParseException
ParseException

ReInit

public void ReInit(InputStream stream)

ReInit

public void ReInit(Reader stream)

ReInit

public void ReInit(JDOQLTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public final ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/query/jdoql/JDOQL.html,v 1.9 2004/05/30 08:55:09 wbiggs Exp $