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