KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nfunk > jep > ParserTokenManager


1 /* Generated By:JJTree&JavaCC: Do not edit this line. ParserTokenManager.java */
2 package org.nfunk.jep;
3 import java.util.Vector JavaDoc;
4 import org.nfunk.jep.function.*;
5 import org.nfunk.jep.type.*;
6
7 public class ParserTokenManager implements ParserConstants
8 {
9   public java.io.PrintStream JavaDoc debugStream = System.out;
10   public void setDebugStream(java.io.PrintStream JavaDoc ds) { debugStream = ds; }
11 private final int jjStopStringLiteralDfa_1(int pos, long active0)
12 {
13    switch (pos)
14    {
15       case 0:
16          if ((active0 & 0x100000000L) != 0L)
17             return 1;
18          if ((active0 & 0x200000000L) != 0L)
19             return 13;
20          return -1;
21       default :
22          return -1;
23    }
24 }
25 private final int jjStartNfa_1(int pos, long active0)
26 {
27    return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1);
28 }
29 private final int jjStopAtPos(int pos, int kind)
30 {
31    jjmatchedKind = kind;
32    jjmatchedPos = pos;
33    return pos + 1;
34 }
35 private final int jjStartNfaWithStates_1(int pos, int kind, int state)
36 {
37    jjmatchedKind = kind;
38    jjmatchedPos = pos;
39    try { curChar = input_stream.readChar(); }
40    catch(java.io.IOException JavaDoc e) { return pos + 1; }
41    return jjMoveNfa_1(state, pos + 1);
42 }
43 private final int jjMoveStringLiteralDfa0_1()
44 {
45    switch(curChar)
46    {
47       case 33:
48          jjmatchedKind = 35;
49          return jjMoveStringLiteralDfa1_1(0x4000000L);
50       case 37:
51          return jjStopAtPos(0, 34);
52       case 38:
53          return jjMoveStringLiteralDfa1_1(0x8000000L);
54       case 40:
55          return jjStopAtPos(0, 40);
56       case 41:
57          return jjStopAtPos(0, 41);
58       case 42:
59          return jjStopAtPos(0, 31);
60       case 43:
61          return jjStopAtPos(0, 29);
62       case 44:
63          return jjStopAtPos(0, 20);
64       case 45:
65          return jjStopAtPos(0, 30);
66       case 46:
67          return jjStartNfaWithStates_1(0, 32, 1);
68       case 47:
69          return jjStartNfaWithStates_1(0, 33, 13);
70       case 59:
71          return jjStopAtPos(0, 19);
72       case 60:
73          jjmatchedKind = 22;
74          return jjMoveStringLiteralDfa1_1(0x1000000L);
75       case 61:
76          jjmatchedKind = 18;
77          return jjMoveStringLiteralDfa1_1(0x800000L);
78       case 62:
79          jjmatchedKind = 21;
80          return jjMoveStringLiteralDfa1_1(0x2000000L);
81       case 91:
82          return jjStopAtPos(0, 38);
83       case 93:
84          return jjStopAtPos(0, 39);
85       case 94:
86          jjmatchedKind = 36;
87          return jjMoveStringLiteralDfa1_1(0x2000000000L);
88       case 124:
89          return jjMoveStringLiteralDfa1_1(0x10000000L);
90       default :
91          return jjMoveNfa_1(0, 0);
92    }
93 }
94 private final int jjMoveStringLiteralDfa1_1(long active0)
95 {
96    try { curChar = input_stream.readChar(); }
97    catch(java.io.IOException JavaDoc e) {
98       jjStopStringLiteralDfa_1(0, active0);
99       return 1;
100    }
101    switch(curChar)
102    {
103       case 38:
104          if ((active0 & 0x8000000L) != 0L)
105             return jjStopAtPos(1, 27);
106          break;
107       case 61:
108          if ((active0 & 0x800000L) != 0L)
109             return jjStopAtPos(1, 23);
110          else if ((active0 & 0x1000000L) != 0L)
111             return jjStopAtPos(1, 24);
112          else if ((active0 & 0x2000000L) != 0L)
113             return jjStopAtPos(1, 25);
114          else if ((active0 & 0x4000000L) != 0L)
115             return jjStopAtPos(1, 26);
116          break;
117       case 94:
118          if ((active0 & 0x2000000000L) != 0L)
119             return jjStopAtPos(1, 37);
120          break;
121       case 124:
122          if ((active0 & 0x10000000L) != 0L)
123             return jjStopAtPos(1, 28);
124          break;
125       default :
126          break;
127    }
128    return jjStartNfa_1(0, active0);
129 }
130 private final void jjCheckNAdd(int state)
131 {
132    if (jjrounds[state] != jjround)
133    {
134       jjstateSet[jjnewStateCnt++] = state;
135       jjrounds[state] = jjround;
136    }
137 }
138 private final void jjAddStates(int start, int end)
139 {
140    do {
141       jjstateSet[jjnewStateCnt++] = jjnextStates[start];
142    } while (start++ != end);
143 }
144 private final void jjCheckNAddTwoStates(int state1, int state2)
145 {
146    jjCheckNAdd(state1);
147    jjCheckNAdd(state2);
148 }
149 private final void jjCheckNAddStates(int start, int end)
150 {
151    do {
152       jjCheckNAdd(jjnextStates[start]);
153    } while (start++ != end);
154 }
155 private final void jjCheckNAddStates(int start)
156 {
157    jjCheckNAdd(jjnextStates[start]);
158    jjCheckNAdd(jjnextStates[start + 1]);
159 }
160 static final long[] jjbitVec0 = {
161    0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
162 };
163 static final long[] jjbitVec2 = {
164    0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
165 };
166 static final long[] jjbitVec3 = {
167    0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
168 };
169 static final long[] jjbitVec4 = {
170    0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
171 };
172 static final long[] jjbitVec5 = {
173    0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
174 };
175 static final long[] jjbitVec6 = {
176    0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
177 };
178 static final long[] jjbitVec7 = {
179    0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
180 };
181 static final long[] jjbitVec8 = {
182    0x3fffffffffffL, 0x0L, 0x0L, 0x0L
183 };
184 private final int jjMoveNfa_1(int startState, int curPos)
185 {
186    int[] nextStates;
187    int startsAt = 0;
188    jjnewStateCnt = 36;
189    int i = 1;
190    jjstateSet[0] = startState;
191    int j, kind = 0x7fffffff;
192    for (;;)
193    {
194       if (++jjround == 0x7fffffff)
195          ReInitRounds();
196       if (curChar < 64)
197       {
198          long l = 1L << curChar;
199          MatchLoop: do
200          {
201             switch(jjstateSet[--i])
202             {
203                case 13:
204                   if (curChar == 42)
205                      jjCheckNAddTwoStates(19, 20);
206                   else if (curChar == 47)
207                      jjCheckNAddStates(0, 2);
208                   break;
209                case 0:
210                   if ((0x3ff000000000000L & l) != 0L)
211                   {
212                      if (kind > 7)
213                         kind = 7;
214                      jjCheckNAddStates(3, 7);
215                   }
216                   else if (curChar == 47)
217                      jjAddStates(8, 9);
218                   else if (curChar == 36)
219                   {
220                      if (kind > 12)
221                         kind = 12;
222                      jjCheckNAdd(11);
223                   }
224                   else if (curChar == 34)
225                      jjCheckNAddStates(10, 12);
226                   else if (curChar == 46)
227                      jjCheckNAdd(1);
228                   break;
229                case 1:
230                   if ((0x3ff000000000000L & l) == 0L)
231                      break;
232                   if (kind > 9)
233                      kind = 9;
234                   jjCheckNAddTwoStates(1, 2);
235                   break;
236                case 3:
237                   if ((0x280000000000L & l) != 0L)
238                      jjCheckNAdd(4);
239                   break;
240                case 4:
241                   if ((0x3ff000000000000L & l) == 0L)
242                      break;
243                   if (kind > 9)
244                      kind = 9;
245                   jjCheckNAdd(4);
246                   break;
247                case 5:
248                   if (curChar == 34)
249                      jjCheckNAddStates(10, 12);
250                   break;
251                case 6:
252                   if ((0xfffffffbffffdbffL & l) != 0L)
253                      jjCheckNAddStates(10, 12);
254                   break;
255                case 8:
256                   if ((0x8400000000L & l) != 0L)
257                      jjCheckNAddStates(10, 12);
258                   break;
259                case 9:
260                   if (curChar == 34 && kind > 11)
261                      kind = 11;
262                   break;
263                case 10:
264                   if (curChar != 36)
265                      break;
266                   if (kind > 12)
267                      kind = 12;
268                   jjCheckNAdd(11);
269                   break;
270                case 11:
271                   if ((0x3ff401000000000L & l) == 0L)
272                      break;
273                   if (kind > 12)
274                      kind = 12;
275                   jjCheckNAdd(11);
276                   break;
277                case 12:
278                   if (curChar == 47)
279                      jjAddStates(8, 9);
280                   break;
281                case 14:
282                   if ((0xffffffffffffdbffL & l) != 0L)
283                      jjCheckNAddStates(0, 2);
284                   break;
285                case 15:
286                   if ((0x2400L & l) != 0L && kind > 5)
287                      kind = 5;
288                   break;
289                case 16:
290                   if (curChar == 10 && kind > 5)
291                      kind = 5;
292                   break;
293                case 17:
294                   if (curChar == 13)
295                      jjstateSet[jjnewStateCnt++] = 16;
296                   break;
297                case 18:
298                   if (curChar == 42)
299                      jjCheckNAddTwoStates(19, 20);
300                   break;
301                case 19:
302                   if ((0xfffffbffffffffffL & l) != 0L)
303                      jjCheckNAddTwoStates(19, 20);
304                   break;
305                case 20:
306                   if (curChar == 42)
307                      jjAddStates(13, 14);
308                   break;
309                case 21:
310                   if ((0xffff7fffffffffffL & l) != 0L)
311                      jjCheckNAddTwoStates(22, 20);
312                   break;
313                case 22:
314                   if ((0xfffffbffffffffffL & l) != 0L)
315                      jjCheckNAddTwoStates(22, 20);
316                   break;
317                case 23:
318                   if (curChar == 47 && kind > 6)
319                      kind = 6;
320                   break;
321                case 24:
322                   if ((0x3ff000000000000L & l) == 0L)
323                      break;
324                   if (kind > 7)
325                      kind = 7;
326                   jjCheckNAddStates(3, 7);
327                   break;
328                case 25:
329                   if ((0x3ff000000000000L & l) == 0L)
330                      break;
331                   if (kind > 7)
332                      kind = 7;
333                   jjCheckNAdd(25);
334                   break;
335                case 26:
336                   if ((0x3ff000000000000L & l) != 0L)
337                      jjCheckNAddTwoStates(26, 27);
338                   break;
339                case 27:
340                   if (curChar != 46)
341                      break;
342                   if (kind > 9)
343                      kind = 9;
344                   jjCheckNAddTwoStates(28, 29);
345                   break;
346                case 28:
347                   if ((0x3ff000000000000L & l) == 0L)
348                      break;
349                   if (kind > 9)
350                      kind = 9;
351                   jjCheckNAddTwoStates(28, 29);
352                   break;
353                case 30:
354                   if ((0x280000000000L & l) != 0L)
355                      jjCheckNAdd(31);
356                   break;
357                case 31:
358                   if ((0x3ff000000000000L & l) == 0L)
359                      break;
360                   if (kind > 9)
361                      kind = 9;
362                   jjCheckNAdd(31);
363                   break;
364                case 32:
365                   if ((0x3ff000000000000L & l) != 0L)
366                      jjCheckNAddTwoStates(32, 33);
367                   break;
368                case 34:
369                   if ((0x280000000000L & l) != 0L)
370                      jjCheckNAdd(35);
371                   break;
372                case 35:
373                   if ((0x3ff000000000000L & l) == 0L)
374                      break;
375                   if (kind > 9)
376                      kind = 9;
377                   jjCheckNAdd(35);
378                   break;
379                default : break;
380             }
381          } while(i != startsAt);
382       }
383       else if (curChar < 128)
384       {
385          long l = 1L << (curChar & 077);
386          MatchLoop: do
387          {
388             switch(jjstateSet[--i])
389             {
390                case 0:
391                case 11:
392                   if ((0x7fffffe87fffffeL & l) == 0L)
393                      break;
394                   if (kind > 12)
395                      kind = 12;
396                   jjCheckNAdd(11);
397                   break;
398                case 2:
399                   if ((0x2000000020L & l) != 0L)
400                      jjAddStates(15, 16);
401                   break;
402                case 6:
403                   if ((0xffffffffefffffffL & l) != 0L)
404                      jjCheckNAddStates(10, 12);
405                   break;
406                case 7:
407                   if (curChar == 92)
408                      jjstateSet[jjnewStateCnt++] = 8;
409                   break;
410                case 8:
411                   if ((0x14404410000000L & l) != 0L)
412                      jjCheckNAddStates(10, 12);
413                   break;
414                case 14:
415                   jjAddStates(0, 2);
416                   break;
417                case 19:
418                   jjCheckNAddTwoStates(19, 20);
419                   break;
420                case 21:
421                case 22:
422                   jjCheckNAddTwoStates(22, 20);
423                   break;
424                case 29:
425                   if ((0x2000000020L & l) != 0L)
426                      jjAddStates(17, 18);
427                   break;
428                case 33:
429                   if ((0x2000000020L & l) != 0L)
430                      jjAddStates(19, 20);
431                   break;
432                default : break;
433             }
434          } while(i != startsAt);
435       }
436       else
437       {
438          int hiByte = (int)(curChar >> 8);
439          int i1 = hiByte >> 6;
440          long l1 = 1L << (hiByte & 077);
441          int i2 = (curChar & 0xff) >> 6;
442          long l2 = 1L << (curChar & 077);
443          MatchLoop: do
444          {
445             switch(jjstateSet[--i])
446             {
447                case 0:
448                case 11:
449                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
450                      break;
451                   if (kind > 12)
452                      kind = 12;
453                   jjCheckNAdd(11);
454                   break;
455                case 6:
456                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
457                      jjAddStates(10, 12);
458                   break;
459                case 14:
460                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
461                      jjAddStates(0, 2);
462                   break;
463                case 19:
464                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
465                      jjCheckNAddTwoStates(19, 20);
466                   break;
467                case 21:
468                case 22:
469                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
470                      jjCheckNAddTwoStates(22, 20);
471                   break;
472                default : break;
473             }
474          } while(i != startsAt);
475       }
476       if (kind != 0x7fffffff)
477       {
478          jjmatchedKind = kind;
479          jjmatchedPos = curPos;
480          kind = 0x7fffffff;
481       }
482       ++curPos;
483       if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
484          return curPos;
485       try { curChar = input_stream.readChar(); }
486       catch(java.io.IOException JavaDoc e) { return curPos; }
487    }
488 }
489 private final int jjStopStringLiteralDfa_0(int pos, long active0)
490 {
491    switch (pos)
492    {
493       case 0:
494          if ((active0 & 0x100000000L) != 0L)
495             return 1;
496          if ((active0 & 0x200000000L) != 0L)
497             return 13;
498          return -1;
499       default :
500          return -1;
501    }
502 }
503 private final int jjStartNfa_0(int pos, long active0)
504 {
505    return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
506 }
507 private final int jjStartNfaWithStates_0(int pos, int kind, int state)
508 {
509    jjmatchedKind = kind;
510    jjmatchedPos = pos;
511    try { curChar = input_stream.readChar(); }
512    catch(java.io.IOException JavaDoc e) { return pos + 1; }
513    return jjMoveNfa_0(state, pos + 1);
514 }
515 private final int jjMoveStringLiteralDfa0_0()
516 {
517    switch(curChar)
518    {
519       case 33:
520          jjmatchedKind = 35;
521          return jjMoveStringLiteralDfa1_0(0x4000000L);
522       case 37:
523          return jjStopAtPos(0, 34);
524       case 38:
525          return jjMoveStringLiteralDfa1_0(0x8000000L);
526       case 40:
527          return jjStopAtPos(0, 40);
528       case 41:
529          return jjStopAtPos(0, 41);
530       case 42:
531          return jjStopAtPos(0, 31);
532       case 43:
533          return jjStopAtPos(0, 29);
534       case 44:
535          return jjStopAtPos(0, 20);
536       case 45:
537          return jjStopAtPos(0, 30);
538       case 46:
539          return jjStartNfaWithStates_0(0, 32, 1);
540       case 47:
541          return jjStartNfaWithStates_0(0, 33, 13);
542       case 59:
543          return jjStopAtPos(0, 19);
544       case 60:
545          jjmatchedKind = 22;
546          return jjMoveStringLiteralDfa1_0(0x1000000L);
547       case 61:
548          jjmatchedKind = 18;
549          return jjMoveStringLiteralDfa1_0(0x800000L);
550       case 62:
551          jjmatchedKind = 21;
552          return jjMoveStringLiteralDfa1_0(0x2000000L);
553       case 91:
554          return jjStopAtPos(0, 38);
555       case 93:
556          return jjStopAtPos(0, 39);
557       case 94:
558          jjmatchedKind = 36;
559          return jjMoveStringLiteralDfa1_0(0x2000000000L);
560       case 124:
561          return jjMoveStringLiteralDfa1_0(0x10000000L);
562       default :
563          return jjMoveNfa_0(0, 0);
564    }
565 }
566 private final int jjMoveStringLiteralDfa1_0(long active0)
567 {
568    try { curChar = input_stream.readChar(); }
569    catch(java.io.IOException JavaDoc e) {
570       jjStopStringLiteralDfa_0(0, active0);
571       return 1;
572    }
573    switch(curChar)
574    {
575       case 38:
576          if ((active0 & 0x8000000L) != 0L)
577             return jjStopAtPos(1, 27);
578          break;
579       case 61:
580          if ((active0 & 0x800000L) != 0L)
581             return jjStopAtPos(1, 23);
582          else if ((active0 & 0x1000000L) != 0L)
583             return jjStopAtPos(1, 24);
584          else if ((active0 & 0x2000000L) != 0L)
585             return jjStopAtPos(1, 25);
586          else if ((active0 & 0x4000000L) != 0L)
587             return jjStopAtPos(1, 26);
588          break;
589       case 94:
590          if ((active0 & 0x2000000000L) != 0L)
591             return jjStopAtPos(1, 37);
592          break;
593       case 124:
594          if ((active0 & 0x10000000L) != 0L)
595             return jjStopAtPos(1, 28);
596          break;
597       default :
598          break;
599    }
600    return jjStartNfa_0(0, active0);
601 }
602 private final int jjMoveNfa_0(int startState, int curPos)
603 {
604    int[] nextStates;
605    int startsAt = 0;
606    jjnewStateCnt = 36;
607    int i = 1;
608    jjstateSet[0] = startState;
609    int j, kind = 0x7fffffff;
610    for (;;)
611    {
612       if (++jjround == 0x7fffffff)
613          ReInitRounds();
614       if (curChar < 64)
615       {
616          long l = 1L << curChar;
617          MatchLoop: do
618          {
619             switch(jjstateSet[--i])
620             {
621                case 13:
622                   if (curChar == 42)
623                      jjCheckNAddTwoStates(19, 20);
624                   else if (curChar == 47)
625                      jjCheckNAddStates(0, 2);
626                   break;
627                case 0:
628                   if ((0x3ff000000000000L & l) != 0L)
629                   {
630                      if (kind > 7)
631                         kind = 7;
632                      jjCheckNAddStates(3, 7);
633                   }
634                   else if (curChar == 47)
635                      jjAddStates(8, 9);
636                   else if (curChar == 36)
637                   {
638                      if (kind > 15)
639                         kind = 15;
640                      jjCheckNAdd(11);
641                   }
642                   else if (curChar == 34)
643                      jjCheckNAddStates(10, 12);
644                   else if (curChar == 46)
645                      jjCheckNAdd(1);
646                   break;
647                case 1:
648                   if ((0x3ff000000000000L & l) == 0L)
649                      break;
650                   if (kind > 9)
651                      kind = 9;
652                   jjCheckNAddTwoStates(1, 2);
653                   break;
654                case 3:
655                   if ((0x280000000000L & l) != 0L)
656                      jjCheckNAdd(4);
657                   break;
658                case 4:
659                   if ((0x3ff000000000000L & l) == 0L)
660                      break;
661                   if (kind > 9)
662                      kind = 9;
663                   jjCheckNAdd(4);
664                   break;
665                case 5:
666                   if (curChar == 34)
667                      jjCheckNAddStates(10, 12);
668                   break;
669                case 6:
670                   if ((0xfffffffbffffdbffL & l) != 0L)
671                      jjCheckNAddStates(10, 12);
672                   break;
673                case 8:
674                   if ((0x8400000000L & l) != 0L)
675                      jjCheckNAddStates(10, 12);
676                   break;
677                case 9:
678                   if (curChar == 34 && kind > 11)
679                      kind = 11;
680                   break;
681                case 10:
682                   if (curChar != 36)
683                      break;
684                   if (kind > 15)
685                      kind = 15;
686                   jjCheckNAdd(11);
687                   break;
688                case 11:
689                   if ((0x3ff001000000000L & l) == 0L)
690                      break;
691                   if (kind > 15)
692                      kind = 15;
693                   jjCheckNAdd(11);
694                   break;
695                case 12:
696                   if (curChar == 47)
697                      jjAddStates(8, 9);
698                   break;
699                case 14:
700                   if ((0xffffffffffffdbffL & l) != 0L)
701                      jjCheckNAddStates(0, 2);
702                   break;
703                case 15:
704                   if ((0x2400L & l) != 0L && kind > 5)
705                      kind = 5;
706                   break;
707                case 16:
708                   if (curChar == 10 && kind > 5)
709                      kind = 5;
710                   break;
711                case 17:
712                   if (curChar == 13)
713                      jjstateSet[jjnewStateCnt++] = 16;
714                   break;
715                case 18:
716                   if (curChar == 42)
717                      jjCheckNAddTwoStates(19, 20);
718                   break;
719                case 19:
720                   if ((0xfffffbffffffffffL & l) != 0L)
721                      jjCheckNAddTwoStates(19, 20);
722                   break;
723                case 20:
724                   if (curChar == 42)
725                      jjAddStates(13, 14);
726                   break;
727                case 21:
728                   if ((0xffff7fffffffffffL & l) != 0L)
729                      jjCheckNAddTwoStates(22, 20);
730                   break;
731                case 22:
732                   if ((0xfffffbffffffffffL & l) != 0L)
733                      jjCheckNAddTwoStates(22, 20);
734                   break;
735                case 23:
736                   if (curChar == 47 && kind > 6)
737                      kind = 6;
738                   break;
739                case 24:
740                   if ((0x3ff000000000000L & l) == 0L)
741                      break;
742                   if (kind > 7)
743                      kind = 7;
744                   jjCheckNAddStates(3, 7);
745                   break;
746                case 25:
747                   if ((0x3ff000000000000L & l) == 0L)
748                      break;
749                   if (kind > 7)
750                      kind = 7;
751                   jjCheckNAdd(25);
752                   break;
753                case 26:
754                   if ((0x3ff000000000000L & l) != 0L)
755                      jjCheckNAddTwoStates(26, 27);
756                   break;
757                case 27:
758                   if (curChar != 46)
759                      break;
760                   if (kind > 9)
761                      kind = 9;
762                   jjCheckNAddTwoStates(28, 29);
763                   break;
764                case 28:
765                   if ((0x3ff000000000000L & l) == 0L)
766                      break;
767                   if (kind > 9)
768                      kind = 9;
769                   jjCheckNAddTwoStates(28, 29);
770                   break;
771                case 30:
772                   if ((0x280000000000L & l) != 0L)
773                      jjCheckNAdd(31);
774                   break;
775                case 31:
776                   if ((0x3ff000000000000L & l) == 0L)
777                      break;
778                   if (kind > 9)
779                      kind = 9;
780                   jjCheckNAdd(31);
781                   break;
782                case 32:
783                   if ((0x3ff000000000000L & l) != 0L)
784                      jjCheckNAddTwoStates(32, 33);
785                   break;
786                case 34:
787                   if ((0x280000000000L & l) != 0L)
788                      jjCheckNAdd(35);
789                   break;
790                case 35:
791                   if ((0x3ff000000000000L & l) == 0L)
792                      break;
793                   if (kind > 9)
794                      kind = 9;
795                   jjCheckNAdd(35);
796                   break;
797                default : break;
798             }
799          } while(i != startsAt);
800       }
801       else if (curChar < 128)
802       {
803          long l = 1L << (curChar & 077);
804          MatchLoop: do
805          {
806             switch(jjstateSet[--i])
807             {
808                case 0:
809                case 11:
810                   if ((0x7fffffe87fffffeL & l) == 0L)
811                      break;
812                   if (kind > 15)
813                      kind = 15;
814                   jjCheckNAdd(11);
815                   break;
816                case 2:
817                   if ((0x2000000020L & l) != 0L)
818                      jjAddStates(15, 16);
819                   break;
820                case 6:
821                   if ((0xffffffffefffffffL & l) != 0L)
822                      jjCheckNAddStates(10, 12);
823                   break;
824                case 7:
825                   if (curChar == 92)
826                      jjstateSet[jjnewStateCnt++] = 8;
827                   break;
828                case 8:
829                   if ((0x14404410000000L & l) != 0L)
830                      jjCheckNAddStates(10, 12);
831                   break;
832                case 14:
833                   jjAddStates(0, 2);
834                   break;
835                case 19:
836                   jjCheckNAddTwoStates(19, 20);
837                   break;
838                case 21:
839                case 22:
840                   jjCheckNAddTwoStates(22, 20);
841                   break;
842                case 29:
843                   if ((0x2000000020L & l) != 0L)
844                      jjAddStates(17, 18);
845                   break;
846                case 33:
847                   if ((0x2000000020L & l) != 0L)
848                      jjAddStates(19, 20);
849                   break;
850                default : break;
851             }
852          } while(i != startsAt);
853       }
854       else
855       {
856          int hiByte = (int)(curChar >> 8);
857          int i1 = hiByte >> 6;
858          long l1 = 1L << (hiByte & 077);
859          int i2 = (curChar & 0xff) >> 6;
860          long l2 = 1L << (curChar & 077);
861          MatchLoop: do
862          {
863             switch(jjstateSet[--i])
864             {
865                case 0:
866                case 11:
867                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
868                      break;
869                   if (kind > 15)
870                      kind = 15;
871                   jjCheckNAdd(11);
872                   break;
873                case 6:
874                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
875                      jjAddStates(10, 12);
876                   break;
877                case 14:
878                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
879                      jjAddStates(0, 2);
880                   break;
881                case 19:
882                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
883                      jjCheckNAddTwoStates(19, 20);
884                   break;
885                case 21:
886                case 22:
887                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
888                      jjCheckNAddTwoStates(22, 20);
889                   break;
890                default : break;
891             }
892          } while(i != startsAt);
893       }
894       if (kind != 0x7fffffff)
895       {
896          jjmatchedKind = kind;
897          jjmatchedPos = curPos;
898          kind = 0x7fffffff;
899       }
900       ++curPos;
901       if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
902          return curPos;
903       try { curChar = input_stream.readChar(); }
904       catch(java.io.IOException JavaDoc e) { return curPos; }
905    }
906 }
907 static final int[] jjnextStates = {
908    14, 15, 17, 25, 26, 27, 32, 33, 13, 18, 6, 7, 9, 21, 23, 3,
909    4, 30, 31, 34, 35,
910 };
911 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
912 {
913    switch(hiByte)
914    {
915       case 0:
916          return ((jjbitVec2[i2] & l2) != 0L);
917       default :
918          if ((jjbitVec0[i1] & l1) != 0L)
919             return true;
920          return false;
921    }
922 }
923 private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
924 {
925    switch(hiByte)
926    {
927       case 0:
928          return ((jjbitVec4[i2] & l2) != 0L);
929       case 48:
930          return ((jjbitVec5[i2] & l2) != 0L);
931       case 49:
932          return ((jjbitVec6[i2] & l2) != 0L);
933       case 51:
934          return ((jjbitVec7[i2] & l2) != 0L);
935       case 61:
936          return ((jjbitVec8[i2] & l2) != 0L);
937       default :
938          if ((jjbitVec3[i1] & l1) != 0L)
939             return true;
940          return false;
941    }
942 }
943 public static final String JavaDoc[] jjstrLiteralImages = {
944 "", null, null, null, null, null, null, null, null, null, null, null, null,
945 null, null, null, null, null, "\75", "\73", "\54", "\76", "\74", "\75\75", "\74\75",
946 "\76\75", "\41\75", "\46\46", "\174\174", "\53", "\55", "\52", "\56", "\57", "\45",
947 "\41", "\136", "\136\136", "\133", "\135", "\50", "\51", };
948 public static final String JavaDoc[] lexStateNames = {
949    "NO_DOT_IN_IDENTIFIERS",
950    "DEFAULT",
951 };
952 public static final int[] jjnewLexState = {
953    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
954    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
955 };
956 static final long[] jjtoToken = {
957    0x3fffffc9a81L,
958 };
959 static final long[] jjtoSkip = {
960    0x7eL,
961 };
962 protected JavaCharStream input_stream;
963 private final int[] jjrounds = new int[36];
964 private final int[] jjstateSet = new int[72];
965 protected char curChar;
966 public ParserTokenManager(JavaCharStream stream)
967 {
968    if (JavaCharStream.staticFlag)
969       throw new Error JavaDoc("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
970    input_stream = stream;
971 }
972 public ParserTokenManager(JavaCharStream stream, int lexState)
973 {
974    this(stream);
975    SwitchTo(lexState);
976 }
977 public void ReInit(JavaCharStream stream)
978 {
979    jjmatchedPos = jjnewStateCnt = 0;
980    curLexState = defaultLexState;
981    input_stream = stream;
982    ReInitRounds();
983 }
984 private final void ReInitRounds()
985 {
986    int i;
987    jjround = 0x80000001;
988    for (i = 36; i-- > 0;)
989       jjrounds[i] = 0x80000000;
990 }
991 public void ReInit(JavaCharStream stream, int lexState)
992 {
993    ReInit(stream);
994    SwitchTo(lexState);
995 }
996 public void SwitchTo(int lexState)
997 {
998    if (lexState >= 2 || lexState < 0)
999       throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
1000   else
1001      curLexState = lexState;
1002}
1003
1004protected Token jjFillToken()
1005{
1006   Token t = Token.newToken(jjmatchedKind);
1007   t.kind = jjmatchedKind;
1008   String JavaDoc im = jjstrLiteralImages[jjmatchedKind];
1009   t.image = (im == null) ? input_stream.GetImage() : im;
1010   t.beginLine = input_stream.getBeginLine();
1011   t.beginColumn = input_stream.getBeginColumn();
1012   t.endLine = input_stream.getEndLine();
1013   t.endColumn = input_stream.getEndColumn();
1014   return t;
1015}
1016
1017int curLexState = 1;
1018int defaultLexState = 1;
1019int jjnewStateCnt;
1020int jjround;
1021int jjmatchedPos;
1022int jjmatchedKind;
1023
1024public Token getNextToken()
1025{
1026  int kind;
1027  Token specialToken = null;
1028  Token matchedToken;
1029  int curPos = 0;
1030
1031  EOFLoop :
1032  for (;;)
1033  {
1034   try
1035   {
1036      curChar = input_stream.BeginToken();
1037   }
1038   catch(java.io.IOException JavaDoc e)
1039   {
1040      jjmatchedKind = 0;
1041      matchedToken = jjFillToken();
1042      return matchedToken;
1043   }
1044
1045   switch(curLexState)
1046   {
1047     case 0:
1048       try { input_stream.backup(0);
1049          while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
1050             curChar = input_stream.BeginToken();
1051       }
1052       catch (java.io.IOException JavaDoc e1) { continue EOFLoop; }
1053       jjmatchedKind = 0x7fffffff;
1054       jjmatchedPos = 0;
1055       curPos = jjMoveStringLiteralDfa0_0();
1056       break;
1057     case 1:
1058       try { input_stream.backup(0);
1059          while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
1060             curChar = input_stream.BeginToken();
1061       }
1062       catch (java.io.IOException JavaDoc e1) { continue EOFLoop; }
1063       jjmatchedKind = 0x7fffffff;
1064       jjmatchedPos = 0;
1065       curPos = jjMoveStringLiteralDfa0_1();
1066       break;
1067   }
1068     if (jjmatchedKind != 0x7fffffff)
1069     {
1070        if (jjmatchedPos + 1 < curPos)
1071           input_stream.backup(curPos - jjmatchedPos - 1);
1072        if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
1073        {
1074           matchedToken = jjFillToken();
1075       if (jjnewLexState[jjmatchedKind] != -1)
1076         curLexState = jjnewLexState[jjmatchedKind];
1077           return matchedToken;
1078        }
1079        else
1080        {
1081         if (jjnewLexState[jjmatchedKind] != -1)
1082           curLexState = jjnewLexState[jjmatchedKind];
1083           continue EOFLoop;
1084        }
1085     }
1086     int error_line = input_stream.getEndLine();
1087     int error_column = input_stream.getEndColumn();
1088     String JavaDoc error_after = null;
1089     boolean EOFSeen = false;
1090     try { input_stream.readChar(); input_stream.backup(1); }
1091     catch (java.io.IOException JavaDoc e1) {
1092        EOFSeen = true;
1093        error_after = curPos <= 1 ? "" : input_stream.GetImage();
1094        if (curChar == '\n' || curChar == '\r') {
1095           error_line++;
1096           error_column = 0;
1097        }
1098        else
1099           error_column++;
1100     }
1101     if (!EOFSeen) {
1102        input_stream.backup(1);
1103        error_after = curPos <= 1 ? "" : input_stream.GetImage();
1104     }
1105     throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
1106  }
1107}
1108
1109}
1110
Popular Tags