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