KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cayenne > wocompat > parser > ParserTokenManager


1 /* Generated By:JavaCC: Do not edit this line. ParserTokenManager.java */
2 /*****************************************************************
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements. See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership. The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License. You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied. See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  ****************************************************************/

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