Lines Matching refs:node

53     static final int NODE_NULLABLE = 1;                 // True if node is potentially null
141 * Inserts a node with a given opcode and opdata at insertAt. The node relative next
143 * @param opcode Opcode for new node
144 * @param opdata Opdata for new node (only the low 16 bits are currently used)
145 * @param insertAt Index at which to insert the new node in the program
149 // Make room for a new node
161 * Appends a node to the end of a node chain
162 * @param node Start of node chain to traverse
165 void setNextOfEnd(int node, int pointTo)
168 int next = instruction[node + RE.offsetNext];
169 // while the 'node' is not the last in the chain
170 // and the 'node' is not the last in the program.
171 while ( next != 0 && node < lenInstruction )
173 // if the node we are supposed to point to is in the chain then
179 if ( node == pointTo ) {
182 node += next;
183 next = instruction[node + RE.offsetNext];
187 if ( node < lenInstruction ) {
188 // Point the last node in the chain to pointTo.
189 instruction[node + RE.offsetNext] = (char)(short)(pointTo - node);
194 * Adds a new node
195 * @param opcode Opcode for node
196 * @param opdata Opdata for node (only the low 16 bits are currently used)
197 * @return Index of new node in program
199 int node(char opcode, int opdata)
201 // Make room for a new node
204 // Add new node at end
210 // Return index of new node
513 * @return Index of class node
556 // Return new POSIX character class node
557 return node(RE.OP_POSIXCLASS, i.charValue());
564 // Try to build a class. Create OP_ANYOF node
565 int ret = node(RE.OP_ANYOF, 0);
733 * @return Index of new atom node
738 // Create a string node
739 int ret = node(RE.OP_ATOM, 0);
852 * Match a terminal node.
854 * @return Index of terminal node (closeable)
864 return node(pattern.charAt(idx++), 0);
901 return node(RE.OP_ESCAPE, pattern.charAt(idx - 1));
911 return node(RE.OP_BACKREF, backreference);
934 * @return Index of closured node
963 // The current node can be null
1078 node(RE.OP_NOTHING, 0);
1100 setNextOfEnd(ret, node (RE.OP_BRANCH, 0)); // inserted branch to option
1101 int nothing = node (RE.OP_NOTHING, 0); // which is OP_NOTHING
1103 setNextOfEnd(ret + RE.nodeSize, nothing); // point the end of X to OP_NOTHING node
1110 setNextOfEnd(ret + RE.nodeSize, node(RE.OP_BRANCH, 0)); // end of X points to an option
1111 setNextOfEnd(ret + RE.nodeSize, node(RE.OP_GOTO, 0)); // to goto
1113 setNextOfEnd(ret, node(RE.OP_BRANCH, 0)); // the other option is
1114 setNextOfEnd(ret, node(RE.OP_NOTHING, 0)); // OP_NOTHING
1122 branch = node(RE.OP_BRANCH, 0); // a new branch
1124 setNextOfEnd(node(RE.OP_GOTO, 0), ret); // one option is to go back to the start
1125 setNextOfEnd(branch, node(RE.OP_BRANCH, 0)); // the other option
1126 setNextOfEnd(ret, node(RE.OP_NOTHING, 0)); // is OP_NOTHING
1134 setNextOfEnd(ret, node(RE.OP_END, 0));
1161 * @return Pointer to branch node
1167 int node;
1168 int ret = node(RE.OP_BRANCH, 0);
1174 // Get new node
1176 node = closure(closureFlags);
1185 setNextOfEnd(chain, node);
1189 chain = node;
1192 // If we don't run loop, make a nothing node
1195 node(RE.OP_NOTHING, 0);
1215 // Create open paren node unless we were called from the top level (which has no parens)
1226 ret = node( RE.OP_OPEN_CLUSTER, 0 );
1232 ret = node(RE.OP_OPEN, parens++);
1237 // Create a branch node
1256 // Create an ending node (either a close paren or an OP_END)
1270 end = node(RE.OP_CLOSE, closeParens);
1274 end = node( RE.OP_CLOSE_CLUSTER, 0 );
1279 end = node(RE.OP_END, 0);
1282 // Append the ending node to the ret nodelist
1285 // Hook the ends of each branch to the end node
1288 // while the next node o
1291 // If branch, make the end of the branch's operand chain point to the end node.
1300 // Return the node list