Class JJTQLParserState
java.lang.Object
org.apache.cayenne.ql.JJTQLParserState
The stack that
QLParser builds expression trees on. An entry is a node or a plain literal value; the
values become operands of the node that closes over them. Adapted from the JJTree-generated tree state and
maintained by hand, together with the node classes it operates on. The class name is what the generated parser
expects.- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcloseNodeScope(Expression n, boolean condition) A conditional node is constructed if its condition is true.voidcloseNodeScope(Expression n, int num) A definite node is constructed from a specified number of children.intReturns the number of children on the stack in the current node scope.booleanDetermines whether the current node was actually closed and pushed.voidpeekNode()Same aspopNode(), wrapping a literal value in a scalar node.popNode()Returns the entry on the top of the stack, removing it from the stack.voidPushes a node or a literal value.voidreset()Reinitializes the node stack.rootNode()Returns the root of the tree, wrapping a lone literal in a scalar node.
-
Constructor Details
-
JJTQLParserState
public JJTQLParserState()
-
-
Method Details
-
nodeCreated
public boolean nodeCreated()Determines whether the current node was actually closed and pushed. This should only be called in the final user action of a node scope. -
reset
public void reset()Reinitializes the node stack. Called by the parser's ReInit() method. -
rootNode
Returns the root of the tree, wrapping a lone literal in a scalar node. Only makes sense after a successful parse. -
pushNode
Pushes a node or a literal value. -
popNode
Returns the entry on the top of the stack, removing it from the stack. -
popExpression
Same aspopNode(), wrapping a literal value in a scalar node. -
peekNode
-
nodeArity
public int nodeArity()Returns the number of children on the stack in the current node scope. -
clearNodeScope
-
openNodeScope
-
closeNodeScope
A definite node is constructed from a specified number of children. That many nodes are popped from the stack and made the children of the definite node, which is then pushed on to the stack. -
closeNodeScope
A conditional node is constructed if its condition is true. All the nodes that have been pushed since the node was opened are made children of the conditional node, which is then pushed on to the stack. If the condition is false the node is not constructed and they are left on the stack.
-