|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| JJTMobisnapSQLState.java | 0% | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/* Generated By:JJTree: Do not edit this line. JJTMobisnapSQLState.java */
|
|
| 2 |
|
|
| 3 |
package mobisnap.mobile_trx;
|
|
| 4 |
|
|
| 5 |
class JJTMobisnapSQLState {
|
|
| 6 |
private java.util.Stack nodes;
|
|
| 7 |
private java.util.Stack marks;
|
|
| 8 |
|
|
| 9 |
private int sp; // number of nodes on stack |
|
| 10 |
private int mk; // current mark |
|
| 11 |
private boolean node_created; |
|
| 12 |
|
|
| 13 | 0 |
JJTMobisnapSQLState() {
|
| 14 | 0 |
nodes = new java.util.Stack();
|
| 15 | 0 |
marks = new java.util.Stack();
|
| 16 | 0 |
sp = 0; |
| 17 | 0 |
mk = 0; |
| 18 |
} |
|
| 19 |
|
|
| 20 |
/* Determines whether the current node was actually closed and
|
|
| 21 |
pushed. This should only be called in the final user action of a
|
|
| 22 |
node scope. */
|
|
| 23 | 0 |
boolean nodeCreated() {
|
| 24 | 0 |
return node_created;
|
| 25 |
} |
|
| 26 |
|
|
| 27 |
/* Call this to reinitialize the node stack. It is called
|
|
| 28 |
automatically by the parser's ReInit() method. */
|
|
| 29 | 0 |
void reset() {
|
| 30 | 0 |
nodes.removeAllElements(); |
| 31 | 0 |
marks.removeAllElements(); |
| 32 | 0 |
sp = 0; |
| 33 | 0 |
mk = 0; |
| 34 |
} |
|
| 35 |
|
|
| 36 |
/* Returns the root node of the AST. It only makes sense to call
|
|
| 37 |
this after a successful parse. */
|
|
| 38 | 0 |
Node rootNode() {
|
| 39 | 0 |
return (Node)nodes.elementAt(0);
|
| 40 |
} |
|
| 41 |
|
|
| 42 |
/* Pushes a node on to the stack. */
|
|
| 43 | 0 |
void pushNode(Node n) {
|
| 44 | 0 |
nodes.push(n); |
| 45 | 0 |
++sp; |
| 46 |
} |
|
| 47 |
|
|
| 48 |
/* Returns the node on the top of the stack, and remove it from the
|
|
| 49 |
stack. */
|
|
| 50 | 0 |
Node popNode() {
|
| 51 | 0 |
if (--sp < mk) {
|
| 52 | 0 |
mk = ((Integer)marks.pop()).intValue(); |
| 53 |
} |
|
| 54 | 0 |
return (Node)nodes.pop();
|
| 55 |
} |
|
| 56 |
|
|
| 57 |
/* Returns the node currently on the top of the stack. */
|
|
| 58 | 0 |
Node peekNode() {
|
| 59 | 0 |
return (Node)nodes.peek();
|
| 60 |
} |
|
| 61 |
|
|
| 62 |
/* Returns the number of children on the stack in the current node
|
|
| 63 |
scope. */
|
|
| 64 | 0 |
int nodeArity() {
|
| 65 | 0 |
return sp - mk;
|
| 66 |
} |
|
| 67 |
|
|
| 68 |
|
|
| 69 | 0 |
void clearNodeScope(Node n) {
|
| 70 | 0 |
while (sp > mk) {
|
| 71 | 0 |
popNode(); |
| 72 |
} |
|
| 73 | 0 |
mk = ((Integer)marks.pop()).intValue(); |
| 74 |
} |
|
| 75 |
|
|
| 76 |
|
|
| 77 | 0 |
void openNodeScope(Node n) {
|
| 78 | 0 |
marks.push(new Integer(mk));
|
| 79 | 0 |
mk = sp; |
| 80 | 0 |
n.jjtOpen(); |
| 81 |
} |
|
| 82 |
|
|
| 83 |
|
|
| 84 |
/* A definite node is constructed from a specified number of
|
|
| 85 |
children. That number of nodes are popped from the stack and
|
|
| 86 |
made the children of the definite node. Then the definite node
|
|
| 87 |
is pushed on to the stack. */
|
|
| 88 | 0 |
void closeNodeScope(Node n, int num) { |
| 89 | 0 |
mk = ((Integer)marks.pop()).intValue(); |
| 90 | 0 |
while (num-- > 0) {
|
| 91 | 0 |
Node c = popNode(); |
| 92 | 0 |
c.jjtSetParent(n); |
| 93 | 0 |
n.jjtAddChild(c, num); |
| 94 |
} |
|
| 95 | 0 |
n.jjtClose(); |
| 96 | 0 |
pushNode(n); |
| 97 | 0 |
node_created = true;
|
| 98 |
} |
|
| 99 |
|
|
| 100 |
|
|
| 101 |
/* A conditional node is constructed if its condition is true. All
|
|
| 102 |
the nodes that have been pushed since the node was opened are
|
|
| 103 |
made children of the the conditional node, which is then pushed
|
|
| 104 |
on to the stack. If the condition is false the node is not
|
|
| 105 |
constructed and they are left on the stack. */
|
|
| 106 | 0 |
void closeNodeScope(Node n, boolean condition) { |
| 107 | 0 |
if (condition) {
|
| 108 | 0 |
int a = nodeArity();
|
| 109 | 0 |
mk = ((Integer)marks.pop()).intValue(); |
| 110 | 0 |
while (a-- > 0) {
|
| 111 | 0 |
Node c = popNode(); |
| 112 | 0 |
c.jjtSetParent(n); |
| 113 | 0 |
n.jjtAddChild(c, a); |
| 114 |
} |
|
| 115 | 0 |
n.jjtClose(); |
| 116 | 0 |
pushNode(n); |
| 117 | 0 |
node_created = true;
|
| 118 |
} else {
|
|
| 119 | 0 |
mk = ((Integer)marks.pop()).intValue(); |
| 120 | 0 |
node_created = false;
|
| 121 |
} |
|
| 122 |
} |
|
| 123 |
} |
|
| 124 |
|
|
||||||||||