- java.lang.Object
-
- org.datanucleus.store.query.compiler.AbstractParser
-
- org.datanucleus.store.query.compiler.JPQLParser
-
- All Implemented Interfaces:
Parser
public class JPQLParser extends AbstractParser
Implementation of a parser for JPQL query language. Generates Node tree(s) by use of the various parseXXX() methods.
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.query.compiler.AbstractParser
lexer, stack, strict
-
-
Constructor Summary
Constructors Constructor Description JPQLParser()
Constructor for a JPQL Parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
parse(String expression)
Node[]
parseFrom(String expression)
Node[]
parseOrder(String expression)
Node[][]
parseParameters(String expression)
Node[]
parseResult(String expression)
Node[]
parseTuple(String expression)
Node[]
parseUpdate(String expression)
Node
parseVariable(String expression)
Node[][]
parseVariables(String expression)
protected void
processAdditiveExpression()
protected boolean
processEntry()
Process an ENTRY construct.protected boolean
processKey()
Process for a KEY construct.protected boolean
processLiteral()
A literal is one value of any type.protected void
processMultiplicativeExpression()
protected void
processPrimary()
Parses the primary.protected boolean
processTreat()
Process a TREAT construct, and put the node on the stack.protected void
processUnaryExpression()
protected boolean
processValue()
Process for a VALUE construct.-
Methods inherited from class org.datanucleus.store.query.compiler.AbstractParser
getLastDescendantNodeForNode, setExplicitParameters, setStrict
-
-
-
-
Method Detail
-
processAdditiveExpression
protected void processAdditiveExpression()
-
processMultiplicativeExpression
protected void processMultiplicativeExpression()
-
processUnaryExpression
protected void processUnaryExpression()
-
processPrimary
protected void processPrimary()
Parses 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.
-
processEntry
protected boolean processEntry()
Process an ENTRY construct. Puts the ENTRY Node on the stack.- Returns:
- Whether a ENTRY construct was found by the lexer.
-
processKey
protected boolean processKey()
Process for a KEY construct. Puts the KEY Node on the stack if one is found.- Returns:
- Whether a KEY construct was found by the lexer.
-
processValue
protected boolean processValue()
Process for a VALUE construct. Puts the VALUE Node on the stack if one is found.- Returns:
- Whether a VALUE construct was found by the lexer.
-
processTreat
protected boolean processTreat()
Process a TREAT construct, and put the node on the stack.- Returns:
- Whether TREAT was found by the lexer.
-
processLiteral
protected boolean processLiteral()
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. Also supports JDBC "escape syntax" for literals.- Returns:
- The compiled literal
-
-