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