| Matching Statements |
| File1 Line# |
File2 Line# |
Statement |
| 13 | 6 | private java.util.Stack nodes |
| 14 | 7 | private java.util.Stack marks |
| 16 | 9 | private int sp |
| 17 | 10 | private int mk |
| 18 | 11 | private boolean node_created |
| 21 | 14 | nodes = new java.util.Stack() |
| 22 | 15 | marks = new java.util.Stack() |
23 39 | 16 32 | sp = 0 |
24 40 | 17 33 | mk = 0 |
| 30 | 23 | boolean nodeCreated() { |
| 31 | 24 | return node_created |
| 36 | 29 | void reset() { |
| 37 | 30 | nodes.removeAllElements() |
| 38 | 31 | marks.removeAllElements() |
| 45 | 38 | Node rootNode() { |
| 46 | 39 | return (Node)nodes.elementAt(0) |
| 50 | 43 | void pushNode(Node n) { |
| 51 | 44 | nodes.push(n) |
| 52 | 45 | ++sp |
| 57 | 50 | Node popNode() { |
| 58 | 51 | if (--sp < mk) { |
59 80 96 116 126 | 52 73 89 109 119 | mk = ((Integer)marks.pop()).intValue() |
| 61 | 54 | return (Node)nodes.pop() |
| 65 | 58 | Node peekNode() { |
| 66 | 59 | return (Node)nodes.peek() |
| 71 | 64 | int nodeArity() { |
| 72 | 65 | return sp - mk |
| 76 | 69 | void clearNodeScope(Node n) { |
| 77 | 70 | while (sp > mk) { |
| 78 | 71 | popNode() |
| 84 | 77 | void openNodeScope(Node n) { |
| 85 | 78 | marks.push(new Integer(mk)) |
| 86 | 79 | mk = sp |
| 87 | 80 | n.jjtOpen() |
| 95 | 88 | void closeNodeScope(Node n, int num) { |
| 97 | 90 | while (num-- > 0) { |
98 118 | 91 111 | Node c = popNode() |
99 119 | 92 112 | c.jjtSetParent(n) |
| 100 | 93 | n.jjtAddChild(c, num) |
102 122 | 95 115 | n.jjtClose() |
103 123 | 96 116 | pushNode(n) |
104 124 | 97 117 | node_created = true |
| 113 | 106 | void closeNodeScope(Node n, boolean condition) { |
| 114 | 107 | if (condition) { |
| 115 | 108 | int a = nodeArity() |
| 117 | 110 | while (a-- > 0) { |
| 120 | 113 | n.jjtAddChild(c, a) |
| 127 | 120 | node_created = false |
| Matching Comments and Strings |
| File1 Line# |
File2 Line# |
Comment/String |
| 16 | 9 | number of nodes on stack |
| 17 | 10 | current mark |
| 27 | 20 | Determines whether the current node was actually closed and |
| 28 | 21 | pushed. This should only be called in the final user action of a |
| 29 | 22 | node scope. |
| 34 | 27 | Call this to reinitialize the node stack. It is called |
| 35 | 28 | automatically by the parser's ReInit() method. |
| 43 | 36 | Returns the root node of the AST. It only makes sense to call |
| 44 | 37 | this after a successful parse. |
| 49 | 42 | Pushes a node on to the stack. |
| 55 | 48 | Returns the node on the top of the stack, and remove it from the |
| 56 | 49 | stack. |
| 64 | 57 | Returns the node currently on the top of the stack. |
| 69 | 62 | Returns the number of children on the stack in the current node |
| 70 | 63 | scope. |
| 91 | 84 | A definite node is constructed from a specified number of |
| 92 | 85 | children. That number of nodes are popped from the stack and |
| 93 | 86 | made the children of the definite node. Then the definite node |
| 94 | 87 | is pushed on to the stack. |
| 108 | 101 | A conditional node is constructed if its condition is true. All |
| 109 | 102 | the nodes that have been pushed since the node was opened are |
| 110 | 103 | made children of the the conditional node, which is then pushed |
| 111 | 104 | on to the stack. If the condition is false the node is not |
| 112 | 105 | constructed and they are left on the stack. |