1 /* Generated By:JavaCC: Do not edit this line. HTMLParserTokenManager.java */
2 package org.apache.lucene.benchmark.byTask.feeds.demohtml;
4 import java.util.Locale;
5 import java.util.Properties;
8 public class HTMLParserTokenManager implements HTMLParserConstants
12 public java.io.PrintStream debugStream = System.out;
13 /** Set debug output. */
14 public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
15 private final int jjStopStringLiteralDfa_0(int pos, long active0)
20 if ((active0 & 0x32L) != 0L)
24 if ((active0 & 0x2L) != 0L)
26 if (jjmatchedPos != 1)
33 if ((active0 & 0x30L) != 0L)
37 if ((active0 & 0x2L) != 0L)
45 if ((active0 & 0x2L) != 0L)
53 if ((active0 & 0x2L) != 0L)
61 if ((active0 & 0x2L) != 0L)
72 private final int jjStartNfa_0(int pos, long active0)
74 return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
76 private int jjStopAtPos(int pos, int kind)
82 private int jjMoveStringLiteralDfa0_0()
87 return jjMoveStringLiteralDfa1_0(0x32L);
89 return jjMoveNfa_0(11, 0);
92 private int jjMoveStringLiteralDfa1_0(long active0)
94 try { curChar = input_stream.readChar(); }
95 catch(java.io.IOException e) {
96 jjStopStringLiteralDfa_0(0, active0);
102 if ((active0 & 0x20L) != 0L)
107 return jjMoveStringLiteralDfa2_0(active0, 0x10L);
109 return jjMoveStringLiteralDfa2_0(active0, 0x2L);
113 return jjStartNfa_0(0, active0);
115 private int jjMoveStringLiteralDfa2_0(long old0, long active0)
117 if (((active0 &= old0)) == 0L)
118 return jjStartNfa_0(0, old0);
119 try { curChar = input_stream.readChar(); }
120 catch(java.io.IOException e) {
121 jjStopStringLiteralDfa_0(1, active0);
127 return jjMoveStringLiteralDfa3_0(active0, 0x10L);
129 return jjMoveStringLiteralDfa3_0(active0, 0x2L);
133 return jjStartNfa_0(1, active0);
135 private int jjMoveStringLiteralDfa3_0(long old0, long active0)
137 if (((active0 &= old0)) == 0L)
138 return jjStartNfa_0(1, old0);
139 try { curChar = input_stream.readChar(); }
140 catch(java.io.IOException e) {
141 jjStopStringLiteralDfa_0(2, active0);
147 if ((active0 & 0x10L) != 0L)
148 return jjStopAtPos(3, 4);
151 return jjMoveStringLiteralDfa4_0(active0, 0x2L);
155 return jjStartNfa_0(2, active0);
157 private int jjMoveStringLiteralDfa4_0(long old0, long active0)
159 if (((active0 &= old0)) == 0L)
160 return jjStartNfa_0(2, old0);
161 try { curChar = input_stream.readChar(); }
162 catch(java.io.IOException e) {
163 jjStopStringLiteralDfa_0(3, active0);
169 return jjMoveStringLiteralDfa5_0(active0, 0x2L);
173 return jjStartNfa_0(3, active0);
175 private int jjMoveStringLiteralDfa5_0(long old0, long active0)
177 if (((active0 &= old0)) == 0L)
178 return jjStartNfa_0(3, old0);
179 try { curChar = input_stream.readChar(); }
180 catch(java.io.IOException e) {
181 jjStopStringLiteralDfa_0(4, active0);
187 return jjMoveStringLiteralDfa6_0(active0, 0x2L);
191 return jjStartNfa_0(4, active0);
193 private int jjMoveStringLiteralDfa6_0(long old0, long active0)
195 if (((active0 &= old0)) == 0L)
196 return jjStartNfa_0(4, old0);
197 try { curChar = input_stream.readChar(); }
198 catch(java.io.IOException e) {
199 jjStopStringLiteralDfa_0(5, active0);
205 if ((active0 & 0x2L) != 0L)
206 return jjStartNfaWithStates_0(6, 1, 23);
211 return jjStartNfa_0(5, active0);
213 private int jjStartNfaWithStates_0(int pos, int kind, int state)
215 jjmatchedKind = kind;
217 try { curChar = input_stream.readChar(); }
218 catch(java.io.IOException e) { return pos + 1; }
219 return jjMoveNfa_0(state, pos + 1);
221 static final long[] jjbitVec0 = {
222 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
224 static final long[] jjbitVec2 = {
225 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
227 private int jjMoveNfa_0(int startState, int curPos)
232 jjstateSet[0] = startState;
233 int kind = 0x7fffffff;
236 if (++jjround == 0x7fffffff)
240 long l = 1L << curChar;
243 switch(jjstateSet[--i])
247 jjstateSet[jjnewStateCnt++] = 25;
248 else if (curChar == 47)
252 if ((0x3ff000000000000L & l) != 0L)
253 jjCheckNAddTwoStates(7, 2);
254 else if ((0x100002600L & l) != 0L)
260 else if (curChar == 60)
261 jjCheckNAddStates(0, 2);
262 else if (curChar == 38)
264 else if (curChar == 36)
265 jjstateSet[jjnewStateCnt++] = 1;
266 if ((0x3ff000000000000L & l) != 0L)
270 jjCheckNAddStates(6, 10);
275 jjstateSet[jjnewStateCnt++] = 1;
278 if ((0x3ff000000000000L & l) != 0L)
282 if ((0x500000000000L & l) != 0L)
283 jjstateSet[jjnewStateCnt++] = 3;
287 if ((0x3ff000000000000L & l) == 0L)
291 jjCheckNAddStates(11, 13);
294 if ((0x3ff000000000000L & l) == 0L)
298 jjCheckNAddStates(6, 10);
301 if ((0x880000000000L & l) == 0L)
305 jjCheckNAddStates(14, 17);
308 if ((0x3ff000000000000L & l) != 0L)
309 jjCheckNAddTwoStates(7, 2);
316 jjCheckNAddStates(11, 13);
319 if ((0x208000000000L & l) != 0L)
320 jjstateSet[jjnewStateCnt++] = 9;
323 if ((0x100002600L & l) == 0L)
329 if (curChar == 59 && kind > 10)
337 if ((0x3ff000000000000L & l) == 0L)
341 jjCheckNAddTwoStates(15, 13);
345 jjstateSet[jjnewStateCnt++] = 17;
348 if ((0x3ff000000000000L & l) == 0L)
352 jjCheckNAddTwoStates(18, 13);
356 jjCheckNAddStates(0, 2);
359 if ((0x9fffff7affffd9ffL & l) == 0L)
366 if ((0x9ffffffeffffd9ffL & l) == 0L)
374 jjstateSet[jjnewStateCnt++] = 25;
377 if ((0x9fffff7affffd9ffL & l) == 0L)
384 if ((0x9ffffffeffffd9ffL & l) == 0L)
392 } while(i != startsAt);
394 else if (curChar < 128)
396 long l = 1L << (curChar & 077);
399 switch(jjstateSet[--i])
403 if ((0x7fffffe07fffffeL & l) == 0L)
407 jjstateSet[jjnewStateCnt++] = 22;
411 if ((0x7fffffe07fffffeL & l) == 0L)
415 jjCheckNAddStates(6, 10);
418 if ((0x7fffffe07fffffeL & l) == 0L)
422 jjCheckNAddStates(11, 13);
425 if ((0x7fffffe07fffffeL & l) == 0L)
429 jjCheckNAddTwoStates(12, 13);
432 if ((0x100000001000000L & l) != 0L)
436 if ((0x7e0000007eL & l) == 0L)
440 jjCheckNAddTwoStates(18, 13);
449 if ((0x7fffffe07fffffeL & l) == 0L)
453 jjstateSet[jjnewStateCnt++] = 26;
463 } while(i != startsAt);
467 int hiByte = (int)(curChar >> 8);
468 int i1 = hiByte >> 6;
469 long l1 = 1L << (hiByte & 077);
470 int i2 = (curChar & 0xff) >> 6;
471 long l2 = 1L << (curChar & 077);
474 switch(jjstateSet[--i])
478 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
486 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
494 } while(i != startsAt);
496 if (kind != 0x7fffffff)
498 jjmatchedKind = kind;
499 jjmatchedPos = curPos;
503 if ((i = jjnewStateCnt) == (startsAt = 28 - (jjnewStateCnt = startsAt)))
505 try { curChar = input_stream.readChar(); }
506 catch(java.io.IOException e) { return curPos; }
509 private int jjMoveStringLiteralDfa0_5()
511 return jjMoveNfa_5(1, 0);
513 private int jjMoveNfa_5(int startState, int curPos)
518 jjstateSet[0] = startState;
519 int kind = 0x7fffffff;
522 if (++jjround == 0x7fffffff)
526 long l = 1L << curChar;
529 switch(jjstateSet[--i])
532 if ((0xfffffffbffffffffL & l) != 0L)
538 else if (curChar == 34)
545 if ((0xfffffffbffffffffL & l) == 0L)
552 } while(i != startsAt);
554 else if (curChar < 128)
556 long l = 1L << (curChar & 077);
559 switch(jjstateSet[--i])
568 } while(i != startsAt);
572 int hiByte = (int)(curChar >> 8);
573 int i1 = hiByte >> 6;
574 long l1 = 1L << (hiByte & 077);
575 int i2 = (curChar & 0xff) >> 6;
576 long l2 = 1L << (curChar & 077);
579 switch(jjstateSet[--i])
583 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
591 } while(i != startsAt);
593 if (kind != 0x7fffffff)
595 jjmatchedKind = kind;
596 jjmatchedPos = curPos;
600 if ((i = jjnewStateCnt) == (startsAt = 2 - (jjnewStateCnt = startsAt)))
602 try { curChar = input_stream.readChar(); }
603 catch(java.io.IOException e) { return curPos; }
606 private final int jjStopStringLiteralDfa_7(int pos, long active0)
614 private final int jjStartNfa_7(int pos, long active0)
616 return jjMoveNfa_7(jjStopStringLiteralDfa_7(pos, active0), pos + 1);
618 private int jjMoveStringLiteralDfa0_7()
623 return jjStopAtPos(0, 30);
625 return jjMoveNfa_7(0, 0);
628 private int jjMoveNfa_7(int startState, int curPos)
633 jjstateSet[0] = startState;
634 int kind = 0x7fffffff;
637 if (++jjround == 0x7fffffff)
641 long l = 1L << curChar;
644 switch(jjstateSet[--i])
647 if ((0xbfffffffffffffffL & l) == 0L)
650 jjstateSet[jjnewStateCnt++] = 0;
654 } while(i != startsAt);
656 else if (curChar < 128)
658 long l = 1L << (curChar & 077);
661 switch(jjstateSet[--i])
665 jjstateSet[jjnewStateCnt++] = 0;
669 } while(i != startsAt);
673 int hiByte = (int)(curChar >> 8);
674 int i1 = hiByte >> 6;
675 long l1 = 1L << (hiByte & 077);
676 int i2 = (curChar & 0xff) >> 6;
677 long l2 = 1L << (curChar & 077);
680 switch(jjstateSet[--i])
683 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
687 jjstateSet[jjnewStateCnt++] = 0;
691 } while(i != startsAt);
693 if (kind != 0x7fffffff)
695 jjmatchedKind = kind;
696 jjmatchedPos = curPos;
700 if ((i = jjnewStateCnt) == (startsAt = 1 - (jjnewStateCnt = startsAt)))
702 try { curChar = input_stream.readChar(); }
703 catch(java.io.IOException e) { return curPos; }
706 private int jjMoveStringLiteralDfa0_4()
708 return jjMoveNfa_4(1, 0);
710 private int jjMoveNfa_4(int startState, int curPos)
715 jjstateSet[0] = startState;
716 int kind = 0x7fffffff;
719 if (++jjround == 0x7fffffff)
723 long l = 1L << curChar;
726 switch(jjstateSet[--i])
729 if ((0xffffff7fffffffffL & l) != 0L)
735 else if (curChar == 39)
742 if ((0xffffff7fffffffffL & l) == 0L)
749 } while(i != startsAt);
751 else if (curChar < 128)
753 long l = 1L << (curChar & 077);
756 switch(jjstateSet[--i])
765 } while(i != startsAt);
769 int hiByte = (int)(curChar >> 8);
770 int i1 = hiByte >> 6;
771 long l1 = 1L << (hiByte & 077);
772 int i2 = (curChar & 0xff) >> 6;
773 long l2 = 1L << (curChar & 077);
776 switch(jjstateSet[--i])
780 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
788 } while(i != startsAt);
790 if (kind != 0x7fffffff)
792 jjmatchedKind = kind;
793 jjmatchedPos = curPos;
797 if ((i = jjnewStateCnt) == (startsAt = 2 - (jjnewStateCnt = startsAt)))
799 try { curChar = input_stream.readChar(); }
800 catch(java.io.IOException e) { return curPos; }
803 private final int jjStopStringLiteralDfa_3(int pos, long active0)
811 private final int jjStartNfa_3(int pos, long active0)
813 return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0), pos + 1);
815 private int jjMoveStringLiteralDfa0_3()
820 return jjStopAtPos(0, 21);
822 return jjStopAtPos(0, 20);
824 return jjMoveNfa_3(0, 0);
827 private int jjMoveNfa_3(int startState, int curPos)
832 jjstateSet[0] = startState;
833 int kind = 0x7fffffff;
836 if (++jjround == 0x7fffffff)
840 long l = 1L << curChar;
843 switch(jjstateSet[--i])
846 if ((0x9fffff7affffd9ffL & l) != 0L)
852 else if ((0x100002600L & l) != 0L)
860 if ((0xbffffffeffffd9ffL & l) == 0L)
867 if ((0x100002600L & l) == 0L)
874 } while(i != startsAt);
876 else if (curChar < 128)
878 long l = 1L << (curChar & 077);
881 switch(jjstateSet[--i])
891 } while(i != startsAt);
895 int hiByte = (int)(curChar >> 8);
896 int i1 = hiByte >> 6;
897 long l1 = 1L << (hiByte & 077);
898 int i2 = (curChar & 0xff) >> 6;
899 long l2 = 1L << (curChar & 077);
902 switch(jjstateSet[--i])
906 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
914 } while(i != startsAt);
916 if (kind != 0x7fffffff)
918 jjmatchedKind = kind;
919 jjmatchedPos = curPos;
923 if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
925 try { curChar = input_stream.readChar(); }
926 catch(java.io.IOException e) { return curPos; }
929 private final int jjStopStringLiteralDfa_6(int pos, long active0)
934 if ((active0 & 0x10000000L) != 0L)
941 if ((active0 & 0x10000000L) != 0L)
943 if (jjmatchedPos == 0)
955 private final int jjStartNfa_6(int pos, long active0)
957 return jjMoveNfa_6(jjStopStringLiteralDfa_6(pos, active0), pos + 1);
959 private int jjMoveStringLiteralDfa0_6()
964 return jjMoveStringLiteralDfa1_6(0x10000000L);
966 return jjMoveNfa_6(1, 0);
969 private int jjMoveStringLiteralDfa1_6(long active0)
971 try { curChar = input_stream.readChar(); }
972 catch(java.io.IOException e) {
973 jjStopStringLiteralDfa_6(0, active0);
979 return jjMoveStringLiteralDfa2_6(active0, 0x10000000L);
983 return jjStartNfa_6(0, active0);
985 private int jjMoveStringLiteralDfa2_6(long old0, long active0)
987 if (((active0 &= old0)) == 0L)
988 return jjStartNfa_6(0, old0);
989 try { curChar = input_stream.readChar(); }
990 catch(java.io.IOException e) {
991 jjStopStringLiteralDfa_6(1, active0);
997 if ((active0 & 0x10000000L) != 0L)
998 return jjStopAtPos(2, 28);
1003 return jjStartNfa_6(1, active0);
1005 private int jjMoveNfa_6(int startState, int curPos)
1010 jjstateSet[0] = startState;
1011 int kind = 0x7fffffff;
1014 if (++jjround == 0x7fffffff)
1018 long l = 1L << curChar;
1021 switch(jjstateSet[--i])
1024 if ((0xffffdfffffffffffL & l) != 0L)
1030 else if (curChar == 45)
1037 if ((0xffffdfffffffffffL & l) == 0L)
1044 } while(i != startsAt);
1046 else if (curChar < 128)
1048 long l = 1L << (curChar & 077);
1051 switch(jjstateSet[--i])
1060 } while(i != startsAt);
1064 int hiByte = (int)(curChar >> 8);
1065 int i1 = hiByte >> 6;
1066 long l1 = 1L << (hiByte & 077);
1067 int i2 = (curChar & 0xff) >> 6;
1068 long l2 = 1L << (curChar & 077);
1071 switch(jjstateSet[--i])
1075 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
1083 } while(i != startsAt);
1085 if (kind != 0x7fffffff)
1087 jjmatchedKind = kind;
1088 jjmatchedPos = curPos;
1092 if ((i = jjnewStateCnt) == (startsAt = 2 - (jjnewStateCnt = startsAt)))
1094 try { curChar = input_stream.readChar(); }
1095 catch(java.io.IOException e) { return curPos; }
1098 private int jjMoveStringLiteralDfa0_1()
1100 return jjMoveNfa_1(1, 0);
1102 private int jjMoveNfa_1(int startState, int curPos)
1107 jjstateSet[0] = startState;
1108 int kind = 0x7fffffff;
1111 if (++jjround == 0x7fffffff)
1115 long l = 1L << curChar;
1118 switch(jjstateSet[--i])
1121 if ((0xafffffffffffffffL & l) != 0L)
1127 else if ((0x5000000000000000L & l) != 0L)
1133 jjstateSet[jjnewStateCnt++] = 10;
1136 if ((0xafffffffffffffffL & l) == 0L)
1143 if ((0xafffffffffffffffL & l) != 0L)
1144 jjAddStates(18, 19);
1147 if (curChar == 62 && kind > 15)
1152 jjstateSet[jjnewStateCnt++] = 9;
1156 jjstateSet[jjnewStateCnt++] = 10;
1160 } while(i != startsAt);
1162 else if (curChar < 128)
1164 long l = 1L << (curChar & 077);
1167 switch(jjstateSet[--i])
1177 jjCheckNAddTwoStates(3, 4);
1180 jjCheckNAddTwoStates(3, 4);
1184 jjstateSet[jjnewStateCnt++] = 2;
1188 jjstateSet[jjnewStateCnt++] = 5;
1192 jjstateSet[jjnewStateCnt++] = 6;
1196 jjstateSet[jjnewStateCnt++] = 7;
1200 jjstateSet[jjnewStateCnt++] = 8;
1204 } while(i != startsAt);
1208 int hiByte = (int)(curChar >> 8);
1209 int i1 = hiByte >> 6;
1210 long l1 = 1L << (hiByte & 077);
1211 int i2 = (curChar & 0xff) >> 6;
1212 long l2 = 1L << (curChar & 077);
1215 switch(jjstateSet[--i])
1219 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
1226 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
1227 jjAddStates(18, 19);
1231 } while(i != startsAt);
1233 if (kind != 0x7fffffff)
1235 jjmatchedKind = kind;
1236 jjmatchedPos = curPos;
1240 if ((i = jjnewStateCnt) == (startsAt = 12 - (jjnewStateCnt = startsAt)))
1242 try { curChar = input_stream.readChar(); }
1243 catch(java.io.IOException e) { return curPos; }
1246 private final int jjStopStringLiteralDfa_2(int pos, long active0)
1254 private final int jjStartNfa_2(int pos, long active0)
1256 return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1);
1258 private int jjMoveStringLiteralDfa0_2()
1263 return jjStopAtPos(0, 21);
1265 return jjStopAtPos(0, 20);
1267 return jjStartNfaWithStates_2(0, 17, 3);
1269 return jjMoveNfa_2(0, 0);
1272 private int jjStartNfaWithStates_2(int pos, int kind, int state)
1274 jjmatchedKind = kind;
1276 try { curChar = input_stream.readChar(); }
1277 catch(java.io.IOException e) { return pos + 1; }
1278 return jjMoveNfa_2(state, pos + 1);
1280 private int jjMoveNfa_2(int startState, int curPos)
1285 jjstateSet[0] = startState;
1286 int kind = 0x7fffffff;
1289 if (++jjround == 0x7fffffff)
1293 long l = 1L << curChar;
1296 switch(jjstateSet[--i])
1299 if ((0x9fffff7affffd9ffL & l) != 0L)
1305 else if ((0x100002600L & l) != 0L)
1311 else if (curChar == 61)
1312 jjstateSet[jjnewStateCnt++] = 3;
1313 else if (curChar == 62)
1320 if ((0x9ffffffeffffd9ffL & l) == 0L)
1328 if (curChar == 62 && kind > 18)
1333 jjstateSet[jjnewStateCnt++] = 3;
1336 if ((0x100002600L & l) == 0L)
1343 } while(i != startsAt);
1345 else if (curChar < 128)
1347 long l = 1L << (curChar & 077);
1350 switch(jjstateSet[--i])
1360 } while(i != startsAt);
1364 int hiByte = (int)(curChar >> 8);
1365 int i1 = hiByte >> 6;
1366 long l1 = 1L << (hiByte & 077);
1367 int i2 = (curChar & 0xff) >> 6;
1368 long l2 = 1L << (curChar & 077);
1371 switch(jjstateSet[--i])
1375 if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
1383 } while(i != startsAt);
1385 if (kind != 0x7fffffff)
1387 jjmatchedKind = kind;
1388 jjmatchedPos = curPos;
1392 if ((i = jjnewStateCnt) == (startsAt = 6 - (jjnewStateCnt = startsAt)))
1394 try { curChar = input_stream.readChar(); }
1395 catch(java.io.IOException e) { return curPos; }
1398 static final int[] jjnextStates = {
1399 20, 21, 24, 12, 14, 16, 5, 8, 0, 4, 6, 0, 4, 6, 5, 0,
1402 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
1407 return ((jjbitVec2[i2] & l2) != 0L);
1409 if ((jjbitVec0[i1] & l1) != 0L)
1415 /** Token literal values. */
1416 public static final String[] jjstrLiteralImages = {
1417 "", "\74\163\143\162\151\160\164", null, null, "\74\41\55\55", "\74\41", null,
1418 null, null, null, null, null, null, null, null, null, null, "\75", null, null,
1419 "\47", "\42", null, null, null, null, null, null, "\55\55\76", null, "\76", };
1421 /** Lexer state names. */
1422 public static final String[] lexStateNames = {
1433 /** Lex State array. */
1434 public static final int[] jjnewLexState = {
1435 -1, 1, 2, 2, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 3, 0, 2, 4, 5, -1, -1, 2,
1436 -1, 2, -1, 0, -1, 0,
1438 static final long[] jjtoToken = {
1441 static final long[] jjtoSkip = {
1444 protected SimpleCharStream input_stream;
1445 private final int[] jjrounds = new int[28];
1446 private final int[] jjstateSet = new int[56];
1447 protected char curChar;
1449 public HTMLParserTokenManager(SimpleCharStream stream){
1450 if (SimpleCharStream.staticFlag)
1451 throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
1452 input_stream = stream;
1456 public HTMLParserTokenManager(SimpleCharStream stream, int lexState){
1461 /** Reinitialise parser. */
1462 public void ReInit(SimpleCharStream stream)
1464 jjmatchedPos = jjnewStateCnt = 0;
1465 curLexState = defaultLexState;
1466 input_stream = stream;
1469 private void ReInitRounds()
1472 jjround = 0x80000001;
1473 for (i = 28; i-- > 0;)
1474 jjrounds[i] = 0x80000000;
1477 /** Reinitialise parser. */
1478 public void ReInit(SimpleCharStream stream, int lexState)
1484 /** Switch to specified lex state. */
1485 public void SwitchTo(int lexState)
1487 if (lexState >= 8 || lexState < 0)
1488 throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
1490 curLexState = lexState;
1493 protected Token jjFillToken()
1496 final String curTokenImage;
1497 final int beginLine;
1499 final int beginColumn;
1500 final int endColumn;
1501 String im = jjstrLiteralImages[jjmatchedKind];
1502 curTokenImage = (im == null) ? input_stream.GetImage() : im;
1503 beginLine = input_stream.getBeginLine();
1504 beginColumn = input_stream.getBeginColumn();
1505 endLine = input_stream.getEndLine();
1506 endColumn = input_stream.getEndColumn();
1507 t = Token.newToken(jjmatchedKind, curTokenImage);
1509 t.beginLine = beginLine;
1510 t.endLine = endLine;
1511 t.beginColumn = beginColumn;
1512 t.endColumn = endColumn;
1517 int curLexState = 0;
1518 int defaultLexState = 0;
1524 /** Get the next Token. */
1525 public Token getNextToken()
1535 curChar = input_stream.BeginToken();
1537 catch(java.io.IOException e)
1540 matchedToken = jjFillToken();
1541 return matchedToken;
1547 jjmatchedKind = 0x7fffffff;
1549 curPos = jjMoveStringLiteralDfa0_0();
1550 if (jjmatchedPos == 0 && jjmatchedKind > 13)
1556 jjmatchedKind = 0x7fffffff;
1558 curPos = jjMoveStringLiteralDfa0_1();
1561 jjmatchedKind = 0x7fffffff;
1563 curPos = jjMoveStringLiteralDfa0_2();
1566 jjmatchedKind = 0x7fffffff;
1568 curPos = jjMoveStringLiteralDfa0_3();
1571 jjmatchedKind = 0x7fffffff;
1573 curPos = jjMoveStringLiteralDfa0_4();
1576 jjmatchedKind = 0x7fffffff;
1578 curPos = jjMoveStringLiteralDfa0_5();
1581 jjmatchedKind = 0x7fffffff;
1583 curPos = jjMoveStringLiteralDfa0_6();
1586 jjmatchedKind = 0x7fffffff;
1588 curPos = jjMoveStringLiteralDfa0_7();
1591 if (jjmatchedKind != 0x7fffffff)
1593 if (jjmatchedPos + 1 < curPos)
1594 input_stream.backup(curPos - jjmatchedPos - 1);
1595 if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
1597 matchedToken = jjFillToken();
1598 if (jjnewLexState[jjmatchedKind] != -1)
1599 curLexState = jjnewLexState[jjmatchedKind];
1600 return matchedToken;
1604 if (jjnewLexState[jjmatchedKind] != -1)
1605 curLexState = jjnewLexState[jjmatchedKind];
1609 int error_line = input_stream.getEndLine();
1610 int error_column = input_stream.getEndColumn();
1611 String error_after = null;
1612 boolean EOFSeen = false;
1613 try { input_stream.readChar(); input_stream.backup(1); }
1614 catch (java.io.IOException e1) {
1616 error_after = curPos <= 1 ? "" : input_stream.GetImage();
1617 if (curChar == '\n' || curChar == '\r') {
1625 input_stream.backup(1);
1626 error_after = curPos <= 1 ? "" : input_stream.GetImage();
1628 throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
1632 private void jjCheckNAdd(int state)
1634 if (jjrounds[state] != jjround)
1636 jjstateSet[jjnewStateCnt++] = state;
1637 jjrounds[state] = jjround;
1640 private void jjAddStates(int start, int end)
1643 jjstateSet[jjnewStateCnt++] = jjnextStates[start];
1644 } while (start++ != end);
1646 private void jjCheckNAddTwoStates(int state1, int state2)
1648 jjCheckNAdd(state1);
1649 jjCheckNAdd(state2);
1652 private void jjCheckNAddStates(int start, int end)
1655 jjCheckNAdd(jjnextStates[start]);
1656 } while (start++ != end);