001: /* Generated By:JJTree&JavaCC: Do not edit this line. SpeedoQLTokenManager.java */
002: package org.objectweb.speedo.query.jdo.parser;
003:
004: public class SpeedoQLTokenManager implements SpeedoQLConstants {
005: public java.io.PrintStream debugStream = System.out;
006:
007: public void setDebugStream(java.io.PrintStream ds) {
008: debugStream = ds;
009: }
010:
011: private final int jjStopStringLiteralDfa_0(int pos, long active0) {
012: switch (pos) {
013: case 0:
014: if ((active0 & 0x200000000L) != 0L)
015: return 4;
016: if ((active0 & 0xffe0L) != 0L) {
017: jjmatchedKind = 42;
018: return 28;
019: }
020: return -1;
021: case 1:
022: if ((active0 & 0xffe0L) != 0L) {
023: jjmatchedKind = 42;
024: jjmatchedPos = 1;
025: return 28;
026: }
027: return -1;
028: case 2:
029: if ((active0 & 0x800L) != 0L)
030: return 28;
031: if ((active0 & 0xf7e0L) != 0L) {
032: jjmatchedKind = 42;
033: jjmatchedPos = 2;
034: return 28;
035: }
036: return -1;
037: case 3:
038: if ((active0 & 0x84e0L) != 0L) {
039: jjmatchedKind = 42;
040: jjmatchedPos = 3;
041: return 28;
042: }
043: if ((active0 & 0x7300L) != 0L)
044: return 28;
045: return -1;
046: case 4:
047: if ((active0 & 0x8440L) != 0L)
048: return 28;
049: if ((active0 & 0xa0L) != 0L) {
050: jjmatchedKind = 42;
051: jjmatchedPos = 4;
052: return 28;
053: }
054: return -1;
055: case 5:
056: if ((active0 & 0x80L) != 0L)
057: return 28;
058: if ((active0 & 0x20L) != 0L) {
059: jjmatchedKind = 42;
060: jjmatchedPos = 5;
061: return 28;
062: }
063: return -1;
064: default:
065: return -1;
066: }
067: }
068:
069: private final int jjStartNfa_0(int pos, long active0) {
070: return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0),
071: pos + 1);
072: }
073:
074: private final int jjStopAtPos(int pos, int kind) {
075: jjmatchedKind = kind;
076: jjmatchedPos = pos;
077: return pos + 1;
078: }
079:
080: private final int jjStartNfaWithStates_0(int pos, int kind,
081: int state) {
082: jjmatchedKind = kind;
083: jjmatchedPos = pos;
084: try {
085: curChar = input_stream.readChar();
086: } catch (java.io.IOException e) {
087: return pos + 1;
088: }
089: return jjMoveNfa_0(state, pos + 1);
090: }
091:
092: private final int jjMoveStringLiteralDfa0_0() {
093: switch (curChar) {
094: case 33:
095: jjmatchedKind = 32;
096: return jjMoveStringLiteralDfa1_0(0x2000000L);
097: case 38:
098: jjmatchedKind = 30;
099: return jjMoveStringLiteralDfa1_0(0x8000000L);
100: case 40:
101: return jjStopAtPos(0, 45);
102: case 41:
103: return jjStopAtPos(0, 46);
104: case 42:
105: return jjStopAtPos(0, 22);
106: case 43:
107: return jjStopAtPos(0, 20);
108: case 45:
109: return jjStopAtPos(0, 21);
110: case 46:
111: return jjStartNfaWithStates_0(0, 33, 4);
112: case 47:
113: return jjStopAtPos(0, 23);
114: case 60:
115: jjmatchedKind = 16;
116: return jjMoveStringLiteralDfa1_0(0x40000L);
117: case 61:
118: return jjMoveStringLiteralDfa1_0(0x1000000L);
119: case 62:
120: jjmatchedKind = 17;
121: return jjMoveStringLiteralDfa1_0(0x80000L);
122: case 94:
123: return jjStopAtPos(0, 29);
124: case 98:
125: return jjMoveStringLiteralDfa1_0(0x1020L);
126: case 99:
127: return jjMoveStringLiteralDfa1_0(0x2000L);
128: case 100:
129: return jjMoveStringLiteralDfa1_0(0x80L);
130: case 102:
131: return jjMoveStringLiteralDfa1_0(0x440L);
132: case 105:
133: return jjMoveStringLiteralDfa1_0(0x800L);
134: case 108:
135: return jjMoveStringLiteralDfa1_0(0x4000L);
136: case 110:
137: return jjMoveStringLiteralDfa1_0(0x100L);
138: case 115:
139: return jjMoveStringLiteralDfa1_0(0x8000L);
140: case 116:
141: return jjMoveStringLiteralDfa1_0(0x200L);
142: case 124:
143: jjmatchedKind = 28;
144: return jjMoveStringLiteralDfa1_0(0x4000000L);
145: case 126:
146: return jjStopAtPos(0, 31);
147: default:
148: return jjMoveNfa_0(0, 0);
149: }
150: }
151:
152: private final int jjMoveStringLiteralDfa1_0(long active0) {
153: try {
154: curChar = input_stream.readChar();
155: } catch (java.io.IOException e) {
156: jjStopStringLiteralDfa_0(0, active0);
157: return 1;
158: }
159: switch (curChar) {
160: case 38:
161: if ((active0 & 0x8000000L) != 0L)
162: return jjStopAtPos(1, 27);
163: break;
164: case 61:
165: if ((active0 & 0x40000L) != 0L)
166: return jjStopAtPos(1, 18);
167: else if ((active0 & 0x80000L) != 0L)
168: return jjStopAtPos(1, 19);
169: else if ((active0 & 0x1000000L) != 0L)
170: return jjStopAtPos(1, 24);
171: else if ((active0 & 0x2000000L) != 0L)
172: return jjStopAtPos(1, 25);
173: break;
174: case 97:
175: return jjMoveStringLiteralDfa2_0(active0, 0x400L);
176: case 104:
177: return jjMoveStringLiteralDfa2_0(active0, 0xa000L);
178: case 108:
179: return jjMoveStringLiteralDfa2_0(active0, 0x40L);
180: case 110:
181: return jjMoveStringLiteralDfa2_0(active0, 0x800L);
182: case 111:
183: return jjMoveStringLiteralDfa2_0(active0, 0x40a0L);
184: case 114:
185: return jjMoveStringLiteralDfa2_0(active0, 0x200L);
186: case 117:
187: return jjMoveStringLiteralDfa2_0(active0, 0x100L);
188: case 121:
189: return jjMoveStringLiteralDfa2_0(active0, 0x1000L);
190: case 124:
191: if ((active0 & 0x4000000L) != 0L)
192: return jjStopAtPos(1, 26);
193: break;
194: default:
195: break;
196: }
197: return jjStartNfa_0(0, active0);
198: }
199:
200: private final int jjMoveStringLiteralDfa2_0(long old0, long active0) {
201: if (((active0 &= old0)) == 0L)
202: return jjStartNfa_0(0, old0);
203: try {
204: curChar = input_stream.readChar();
205: } catch (java.io.IOException e) {
206: jjStopStringLiteralDfa_0(1, active0);
207: return 2;
208: }
209: switch (curChar) {
210: case 97:
211: return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
212: case 108:
213: return jjMoveStringLiteralDfa3_0(active0, 0x500L);
214: case 110:
215: return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
216: case 111:
217: return jjMoveStringLiteralDfa3_0(active0, 0x8060L);
218: case 116:
219: if ((active0 & 0x800L) != 0L)
220: return jjStartNfaWithStates_0(2, 11, 28);
221: return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
222: case 117:
223: return jjMoveStringLiteralDfa3_0(active0, 0x280L);
224: default:
225: break;
226: }
227: return jjStartNfa_0(1, active0);
228: }
229:
230: private final int jjMoveStringLiteralDfa3_0(long old0, long active0) {
231: if (((active0 &= old0)) == 0L)
232: return jjStartNfa_0(1, old0);
233: try {
234: curChar = input_stream.readChar();
235: } catch (java.io.IOException e) {
236: jjStopStringLiteralDfa_0(2, active0);
237: return 3;
238: }
239: switch (curChar) {
240: case 97:
241: return jjMoveStringLiteralDfa4_0(active0, 0x40L);
242: case 98:
243: return jjMoveStringLiteralDfa4_0(active0, 0x80L);
244: case 101:
245: if ((active0 & 0x200L) != 0L)
246: return jjStartNfaWithStates_0(3, 9, 28);
247: else if ((active0 & 0x1000L) != 0L)
248: return jjStartNfaWithStates_0(3, 12, 28);
249: break;
250: case 103:
251: if ((active0 & 0x4000L) != 0L)
252: return jjStartNfaWithStates_0(3, 14, 28);
253: break;
254: case 108:
255: if ((active0 & 0x100L) != 0L)
256: return jjStartNfaWithStates_0(3, 8, 28);
257: return jjMoveStringLiteralDfa4_0(active0, 0x20L);
258: case 114:
259: if ((active0 & 0x2000L) != 0L)
260: return jjStartNfaWithStates_0(3, 13, 28);
261: return jjMoveStringLiteralDfa4_0(active0, 0x8000L);
262: case 115:
263: return jjMoveStringLiteralDfa4_0(active0, 0x400L);
264: default:
265: break;
266: }
267: return jjStartNfa_0(2, active0);
268: }
269:
270: private final int jjMoveStringLiteralDfa4_0(long old0, long active0) {
271: if (((active0 &= old0)) == 0L)
272: return jjStartNfa_0(2, old0);
273: try {
274: curChar = input_stream.readChar();
275: } catch (java.io.IOException e) {
276: jjStopStringLiteralDfa_0(3, active0);
277: return 4;
278: }
279: switch (curChar) {
280: case 101:
281: if ((active0 & 0x400L) != 0L)
282: return jjStartNfaWithStates_0(4, 10, 28);
283: return jjMoveStringLiteralDfa5_0(active0, 0x20L);
284: case 108:
285: return jjMoveStringLiteralDfa5_0(active0, 0x80L);
286: case 116:
287: if ((active0 & 0x40L) != 0L)
288: return jjStartNfaWithStates_0(4, 6, 28);
289: else if ((active0 & 0x8000L) != 0L)
290: return jjStartNfaWithStates_0(4, 15, 28);
291: break;
292: default:
293: break;
294: }
295: return jjStartNfa_0(3, active0);
296: }
297:
298: private final int jjMoveStringLiteralDfa5_0(long old0, long active0) {
299: if (((active0 &= old0)) == 0L)
300: return jjStartNfa_0(3, old0);
301: try {
302: curChar = input_stream.readChar();
303: } catch (java.io.IOException e) {
304: jjStopStringLiteralDfa_0(4, active0);
305: return 5;
306: }
307: switch (curChar) {
308: case 97:
309: return jjMoveStringLiteralDfa6_0(active0, 0x20L);
310: case 101:
311: if ((active0 & 0x80L) != 0L)
312: return jjStartNfaWithStates_0(5, 7, 28);
313: break;
314: default:
315: break;
316: }
317: return jjStartNfa_0(4, active0);
318: }
319:
320: private final int jjMoveStringLiteralDfa6_0(long old0, long active0) {
321: if (((active0 &= old0)) == 0L)
322: return jjStartNfa_0(4, old0);
323: try {
324: curChar = input_stream.readChar();
325: } catch (java.io.IOException e) {
326: jjStopStringLiteralDfa_0(5, active0);
327: return 6;
328: }
329: switch (curChar) {
330: case 110:
331: if ((active0 & 0x20L) != 0L)
332: return jjStartNfaWithStates_0(6, 5, 28);
333: break;
334: default:
335: break;
336: }
337: return jjStartNfa_0(5, active0);
338: }
339:
340: private final void jjCheckNAdd(int state) {
341: if (jjrounds[state] != jjround) {
342: jjstateSet[jjnewStateCnt++] = state;
343: jjrounds[state] = jjround;
344: }
345: }
346:
347: private final void jjAddStates(int start, int end) {
348: do {
349: jjstateSet[jjnewStateCnt++] = jjnextStates[start];
350: } while (start++ != end);
351: }
352:
353: private final void jjCheckNAddTwoStates(int state1, int state2) {
354: jjCheckNAdd(state1);
355: jjCheckNAdd(state2);
356: }
357:
358: private final void jjCheckNAddStates(int start, int end) {
359: do {
360: jjCheckNAdd(jjnextStates[start]);
361: } while (start++ != end);
362: }
363:
364: private final void jjCheckNAddStates(int start) {
365: jjCheckNAdd(jjnextStates[start]);
366: jjCheckNAdd(jjnextStates[start + 1]);
367: }
368:
369: static final long[] jjbitVec0 = { 0x0L, 0x0L, 0xffffffffffffffffL,
370: 0xffffffffffffffffL };
371:
372: private final int jjMoveNfa_0(int startState, int curPos) {
373: int[] nextStates;
374: int startsAt = 0;
375: jjnewStateCnt = 48;
376: int i = 1;
377: jjstateSet[0] = startState;
378: int j, kind = 0x7fffffff;
379: for (;;) {
380: if (++jjround == 0x7fffffff)
381: ReInitRounds();
382: if (curChar < 64) {
383: long l = 1L << curChar;
384: MatchLoop: do {
385: switch (jjstateSet[--i]) {
386: case 0:
387: if ((0x3ff000000000000L & l) != 0L)
388: jjCheckNAddStates(0, 6);
389: else if (curChar == 36) {
390: if (kind > 42)
391: kind = 42;
392: jjCheckNAdd(28);
393: } else if (curChar == 34)
394: jjCheckNAddStates(7, 9);
395: else if (curChar == 39)
396: jjAddStates(10, 11);
397: else if (curChar == 46)
398: jjCheckNAdd(4);
399: if ((0x3fe000000000000L & l) != 0L) {
400: if (kind > 34)
401: kind = 34;
402: jjCheckNAddTwoStates(1, 2);
403: } else if (curChar == 48) {
404: if (kind > 34)
405: kind = 34;
406: jjCheckNAddStates(12, 14);
407: }
408: break;
409: case 1:
410: if ((0x3ff000000000000L & l) == 0L)
411: break;
412: if (kind > 34)
413: kind = 34;
414: jjCheckNAddTwoStates(1, 2);
415: break;
416: case 3:
417: if (curChar == 46)
418: jjCheckNAdd(4);
419: break;
420: case 4:
421: if ((0x3ff000000000000L & l) == 0L)
422: break;
423: if (kind > 38)
424: kind = 38;
425: jjCheckNAddStates(15, 17);
426: break;
427: case 6:
428: if ((0x280000000000L & l) != 0L)
429: jjCheckNAdd(7);
430: break;
431: case 7:
432: if ((0x3ff000000000000L & l) == 0L)
433: break;
434: if (kind > 38)
435: kind = 38;
436: jjCheckNAddTwoStates(7, 8);
437: break;
438: case 9:
439: if (curChar == 39)
440: jjAddStates(10, 11);
441: break;
442: case 10:
443: if ((0xffffff7fffffdbffL & l) != 0L)
444: jjCheckNAdd(11);
445: break;
446: case 11:
447: if (curChar == 39 && kind > 40)
448: kind = 40;
449: break;
450: case 13:
451: if ((0x8400000000L & l) != 0L)
452: jjCheckNAdd(11);
453: break;
454: case 14:
455: if ((0xff000000000000L & l) != 0L)
456: jjCheckNAddTwoStates(15, 11);
457: break;
458: case 15:
459: if ((0xff000000000000L & l) != 0L)
460: jjCheckNAdd(11);
461: break;
462: case 16:
463: if ((0xf000000000000L & l) != 0L)
464: jjstateSet[jjnewStateCnt++] = 17;
465: break;
466: case 17:
467: if ((0xff000000000000L & l) != 0L)
468: jjCheckNAdd(15);
469: break;
470: case 18:
471: if (curChar == 34)
472: jjCheckNAddStates(7, 9);
473: break;
474: case 19:
475: if ((0xfffffffbffffdbffL & l) != 0L)
476: jjCheckNAddStates(7, 9);
477: break;
478: case 21:
479: if ((0x8400000000L & l) != 0L)
480: jjCheckNAddStates(7, 9);
481: break;
482: case 22:
483: if (curChar == 34 && kind > 41)
484: kind = 41;
485: break;
486: case 23:
487: if ((0xff000000000000L & l) != 0L)
488: jjCheckNAddStates(18, 21);
489: break;
490: case 24:
491: if ((0xff000000000000L & l) != 0L)
492: jjCheckNAddStates(7, 9);
493: break;
494: case 25:
495: if ((0xf000000000000L & l) != 0L)
496: jjstateSet[jjnewStateCnt++] = 26;
497: break;
498: case 26:
499: if ((0xff000000000000L & l) != 0L)
500: jjCheckNAdd(24);
501: break;
502: case 27:
503: if (curChar != 36)
504: break;
505: if (kind > 42)
506: kind = 42;
507: jjCheckNAdd(28);
508: break;
509: case 28:
510: if ((0x3ff001000000000L & l) == 0L)
511: break;
512: if (kind > 42)
513: kind = 42;
514: jjCheckNAdd(28);
515: break;
516: case 29:
517: if ((0x3ff000000000000L & l) != 0L)
518: jjCheckNAddStates(0, 6);
519: break;
520: case 30:
521: if ((0x3ff000000000000L & l) != 0L)
522: jjCheckNAddTwoStates(30, 31);
523: break;
524: case 31:
525: if (curChar != 46)
526: break;
527: if (kind > 38)
528: kind = 38;
529: jjCheckNAddStates(22, 24);
530: break;
531: case 32:
532: if ((0x3ff000000000000L & l) == 0L)
533: break;
534: if (kind > 38)
535: kind = 38;
536: jjCheckNAddStates(22, 24);
537: break;
538: case 34:
539: if ((0x280000000000L & l) != 0L)
540: jjCheckNAdd(35);
541: break;
542: case 35:
543: if ((0x3ff000000000000L & l) == 0L)
544: break;
545: if (kind > 38)
546: kind = 38;
547: jjCheckNAddTwoStates(35, 8);
548: break;
549: case 36:
550: if ((0x3ff000000000000L & l) != 0L)
551: jjCheckNAddTwoStates(36, 37);
552: break;
553: case 38:
554: if ((0x280000000000L & l) != 0L)
555: jjCheckNAdd(39);
556: break;
557: case 39:
558: if ((0x3ff000000000000L & l) == 0L)
559: break;
560: if (kind > 38)
561: kind = 38;
562: jjCheckNAddTwoStates(39, 8);
563: break;
564: case 40:
565: if ((0x3ff000000000000L & l) != 0L)
566: jjCheckNAddStates(25, 27);
567: break;
568: case 42:
569: if ((0x280000000000L & l) != 0L)
570: jjCheckNAdd(43);
571: break;
572: case 43:
573: if ((0x3ff000000000000L & l) != 0L)
574: jjCheckNAddTwoStates(43, 8);
575: break;
576: case 44:
577: if (curChar != 48)
578: break;
579: if (kind > 34)
580: kind = 34;
581: jjCheckNAddStates(12, 14);
582: break;
583: case 46:
584: if ((0x3ff000000000000L & l) == 0L)
585: break;
586: if (kind > 34)
587: kind = 34;
588: jjCheckNAddTwoStates(46, 2);
589: break;
590: case 47:
591: if ((0xff000000000000L & l) == 0L)
592: break;
593: if (kind > 34)
594: kind = 34;
595: jjCheckNAddTwoStates(47, 2);
596: break;
597: default:
598: break;
599: }
600: } while (i != startsAt);
601: } else if (curChar < 128) {
602: long l = 1L << (curChar & 077);
603: MatchLoop: do {
604: switch (jjstateSet[--i]) {
605: case 0:
606: case 28:
607: if ((0x7fffffe87fffffeL & l) == 0L)
608: break;
609: if (kind > 42)
610: kind = 42;
611: jjCheckNAdd(28);
612: break;
613: case 2:
614: if ((0x100000001000L & l) != 0L && kind > 34)
615: kind = 34;
616: break;
617: case 5:
618: if ((0x2000000020L & l) != 0L)
619: jjAddStates(28, 29);
620: break;
621: case 8:
622: if ((0x5000000050L & l) != 0L && kind > 38)
623: kind = 38;
624: break;
625: case 10:
626: if ((0xffffffffefffffffL & l) != 0L)
627: jjCheckNAdd(11);
628: break;
629: case 12:
630: if (curChar == 92)
631: jjAddStates(30, 32);
632: break;
633: case 13:
634: if ((0x14404410000000L & l) != 0L)
635: jjCheckNAdd(11);
636: break;
637: case 19:
638: if ((0xffffffffefffffffL & l) != 0L)
639: jjCheckNAddStates(7, 9);
640: break;
641: case 20:
642: if (curChar == 92)
643: jjAddStates(33, 35);
644: break;
645: case 21:
646: if ((0x14404410000000L & l) != 0L)
647: jjCheckNAddStates(7, 9);
648: break;
649: case 33:
650: if ((0x2000000020L & l) != 0L)
651: jjAddStates(36, 37);
652: break;
653: case 37:
654: if ((0x2000000020L & l) != 0L)
655: jjAddStates(38, 39);
656: break;
657: case 41:
658: if ((0x2000000020L & l) != 0L)
659: jjAddStates(40, 41);
660: break;
661: case 45:
662: if ((0x100000001000000L & l) != 0L)
663: jjCheckNAdd(46);
664: break;
665: case 46:
666: if ((0x7e0000007eL & l) == 0L)
667: break;
668: if (kind > 34)
669: kind = 34;
670: jjCheckNAddTwoStates(46, 2);
671: break;
672: default:
673: break;
674: }
675: } while (i != startsAt);
676: } else {
677: int i2 = (curChar & 0xff) >> 6;
678: long l2 = 1L << (curChar & 077);
679: MatchLoop: do {
680: switch (jjstateSet[--i]) {
681: case 10:
682: if ((jjbitVec0[i2] & l2) != 0L)
683: jjstateSet[jjnewStateCnt++] = 11;
684: break;
685: case 19:
686: if ((jjbitVec0[i2] & l2) != 0L)
687: jjAddStates(7, 9);
688: break;
689: default:
690: break;
691: }
692: } while (i != startsAt);
693: }
694: if (kind != 0x7fffffff) {
695: jjmatchedKind = kind;
696: jjmatchedPos = curPos;
697: kind = 0x7fffffff;
698: }
699: ++curPos;
700: if ((i = jjnewStateCnt) == (startsAt = 48 - (jjnewStateCnt = startsAt)))
701: return curPos;
702: try {
703: curChar = input_stream.readChar();
704: } catch (java.io.IOException e) {
705: return curPos;
706: }
707: }
708: }
709:
710: static final int[] jjnextStates = { 30, 31, 36, 37, 40, 41, 8, 19,
711: 20, 22, 10, 12, 45, 47, 2, 4, 5, 8, 19, 20, 24, 22, 32, 33,
712: 8, 40, 41, 8, 6, 7, 13, 14, 16, 21, 23, 25, 34, 35, 38, 39,
713: 42, 43, };
714: public static final String[] jjstrLiteralImages = { "", null, null,
715: null, null, "\142\157\157\154\145\141\156",
716: "\146\154\157\141\164", "\144\157\165\142\154\145",
717: "\156\165\154\154", "\164\162\165\145",
718: "\146\141\154\163\145", "\151\156\164", "\142\171\164\145",
719: "\143\150\141\162", "\154\157\156\147",
720: "\163\150\157\162\164", "\74", "\76", "\74\75", "\76\75",
721: "\53", "\55", "\52", "\57", "\75\75", "\41\75", "\174\174",
722: "\46\46", "\174", "\136", "\46", "\176", "\41", "\56",
723: null, null, null, null, null, null, null, null, null, null,
724: null, "\50", "\51", };
725: public static final String[] lexStateNames = { "DEFAULT", };
726: static final long[] jjtoToken = { 0x6747ffffffe1L, };
727: static final long[] jjtoSkip = { 0x1eL, };
728: private SimpleCharStream input_stream;
729: private final int[] jjrounds = new int[48];
730: private final int[] jjstateSet = new int[96];
731: protected char curChar;
732:
733: public SpeedoQLTokenManager(SimpleCharStream stream) {
734: if (SimpleCharStream.staticFlag)
735: throw new Error(
736: "ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
737: input_stream = stream;
738: }
739:
740: public SpeedoQLTokenManager(SimpleCharStream stream, int lexState) {
741: this (stream);
742: SwitchTo(lexState);
743: }
744:
745: public void ReInit(SimpleCharStream stream) {
746: jjmatchedPos = jjnewStateCnt = 0;
747: curLexState = defaultLexState;
748: input_stream = stream;
749: ReInitRounds();
750: }
751:
752: private final void ReInitRounds() {
753: int i;
754: jjround = 0x80000001;
755: for (i = 48; i-- > 0;)
756: jjrounds[i] = 0x80000000;
757: }
758:
759: public void ReInit(SimpleCharStream stream, int lexState) {
760: ReInit(stream);
761: SwitchTo(lexState);
762: }
763:
764: public void SwitchTo(int lexState) {
765: if (lexState >= 1 || lexState < 0)
766: throw new TokenMgrError(
767: "Error: Ignoring invalid lexical state : "
768: + lexState + ". StateItf unchanged.",
769: TokenMgrError.INVALID_LEXICAL_STATE);
770: else
771: curLexState = lexState;
772: }
773:
774: private final Token jjFillToken() {
775: Token t = Token.newToken(jjmatchedKind);
776: t.kind = jjmatchedKind;
777: String im = jjstrLiteralImages[jjmatchedKind];
778: t.image = (im == null) ? input_stream.GetImage() : im;
779: t.beginLine = input_stream.getBeginLine();
780: t.beginColumn = input_stream.getBeginColumn();
781: t.endLine = input_stream.getEndLine();
782: t.endColumn = input_stream.getEndColumn();
783: return t;
784: }
785:
786: int curLexState = 0;
787: int defaultLexState = 0;
788: int jjnewStateCnt;
789: int jjround;
790: int jjmatchedPos;
791: int jjmatchedKind;
792:
793: public final Token getNextToken() {
794: int kind;
795: Token specialToken = null;
796: Token matchedToken;
797: int curPos = 0;
798:
799: EOFLoop: for (;;) {
800: try {
801: curChar = input_stream.BeginToken();
802: } catch (java.io.IOException e) {
803: jjmatchedKind = 0;
804: matchedToken = jjFillToken();
805: return matchedToken;
806: }
807:
808: try {
809: input_stream.backup(0);
810: while (curChar <= 32
811: && (0x100002600L & (1L << curChar)) != 0L)
812: curChar = input_stream.BeginToken();
813: } catch (java.io.IOException e1) {
814: continue EOFLoop;
815: }
816: jjmatchedKind = 0x7fffffff;
817: jjmatchedPos = 0;
818: curPos = jjMoveStringLiteralDfa0_0();
819: if (jjmatchedKind != 0x7fffffff) {
820: if (jjmatchedPos + 1 < curPos)
821: input_stream.backup(curPos - jjmatchedPos - 1);
822: if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
823: matchedToken = jjFillToken();
824: return matchedToken;
825: } else {
826: continue EOFLoop;
827: }
828: }
829: int error_line = input_stream.getEndLine();
830: int error_column = input_stream.getEndColumn();
831: String error_after = null;
832: boolean EOFSeen = false;
833: try {
834: input_stream.readChar();
835: input_stream.backup(1);
836: } catch (java.io.IOException e1) {
837: EOFSeen = true;
838: error_after = curPos <= 1 ? "" : input_stream
839: .GetImage();
840: if (curChar == '\n' || curChar == '\r') {
841: error_line++;
842: error_column = 0;
843: } else
844: error_column++;
845: }
846: if (!EOFSeen) {
847: input_stream.backup(1);
848: error_after = curPos <= 1 ? "" : input_stream
849: .GetImage();
850: }
851: throw new TokenMgrError(EOFSeen, curLexState, error_line,
852: error_column, error_after, curChar,
853: TokenMgrError.LEXICAL_ERROR);
854: }
855: }
856:
857: }
|