00001
00002 package plp.functional2.parser;
00003 import java.util.ArrayList;
00004 import java.util.List;
00005
00006 import plp.functional2.Programa;
00007 import plp.functional2.declaration.DecFuncao;
00008 import plp.functional2.expression.ValorFuncao;
00009 import plp.functional2.expression.ValorAbstrato;
00010 import plp.functional2.expression.ExpDeclaracao;
00011 import plp.functional2.expression.Aplicacao;
00012
00013 import plp.functional1.declaration.DeclaracaoFuncional;
00014 import plp.functional1.declaration.DecVariavel;
00015 import plp.functional1.expression.IfThenElse;
00016
00017 import plp.expressions2.expression.Expressao;
00018 import plp.expressions2.expression.Valor;
00019 import plp.expressions2.expression.ValorInteiro;
00020 import plp.expressions2.expression.ValorString;
00021 import plp.expressions2.expression.ValorBooleano;
00022 import plp.expressions2.expression.Id;
00023 import plp.expressions2.expression.ExpMenos;
00024 import plp.expressions2.expression.ExpNot;
00025 import plp.expressions2.expression.ExpLength;
00026 import plp.expressions2.expression.ExpSoma;
00027 import plp.expressions2.expression.ExpSub;
00028 import plp.expressions2.expression.ExpAnd;
00029 import plp.expressions2.expression.ExpOr;
00030 import plp.expressions2.expression.ExpEquals;
00031 import plp.expressions2.expression.ExpConcat;
00032
00033 public class Func2ParserTokenManager implements Func2ParserConstants
00034 {
00035 public static java.io.PrintStream debugStream = System.out;
00036 public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
00037 private static final int jjStopStringLiteralDfa_0(int pos, long active0)
00038 {
00039 switch (pos)
00040 {
00041 case 0:
00042 if ((active0 & 0x7ffe00L) != 0L)
00043 {
00044 jjmatchedKind = 28;
00045 return 13;
00046 }
00047 if ((active0 & 0x200000000000000L) != 0L)
00048 return 19;
00049 return -1;
00050 case 1:
00051 if ((active0 & 0x39fa00L) != 0L)
00052 {
00053 jjmatchedKind = 28;
00054 jjmatchedPos = 1;
00055 return 13;
00056 }
00057 if ((active0 & 0x460400L) != 0L)
00058 return 13;
00059 return -1;
00060 case 2:
00061 if ((active0 & 0x187000L) != 0L)
00062 {
00063 jjmatchedKind = 28;
00064 jjmatchedPos = 2;
00065 return 13;
00066 }
00067 if ((active0 & 0x218a00L) != 0L)
00068 return 13;
00069 return -1;
00070 case 3:
00071 if ((active0 & 0x182000L) != 0L)
00072 return 13;
00073 if ((active0 & 0x5000L) != 0L)
00074 {
00075 jjmatchedKind = 28;
00076 jjmatchedPos = 3;
00077 return 13;
00078 }
00079 return -1;
00080 case 4:
00081 if ((active0 & 0x1000L) != 0L)
00082 {
00083 jjmatchedKind = 28;
00084 jjmatchedPos = 4;
00085 return 13;
00086 }
00087 if ((active0 & 0x4000L) != 0L)
00088 return 13;
00089 return -1;
00090 default :
00091 return -1;
00092 }
00093 }
00094 private static final int jjStartNfa_0(int pos, long active0)
00095 {
00096 return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1);
00097 }
00098 static private final int jjStopAtPos(int pos, int kind)
00099 {
00100 jjmatchedKind = kind;
00101 jjmatchedPos = pos;
00102 return pos + 1;
00103 }
00104 static private final int jjStartNfaWithStates_0(int pos, int kind, int state)
00105 {
00106 jjmatchedKind = kind;
00107 jjmatchedPos = pos;
00108 try { curChar = input_stream.readChar(); }
00109 catch(java.io.IOException e) { return pos + 1; }
00110 return jjMoveNfa_0(state, pos + 1);
00111 }
00112 static private final int jjMoveStringLiteralDfa0_0()
00113 {
00114 switch(curChar)
00115 {
00116 case 33:
00117 jjmatchedKind = 43;
00118 return jjMoveStringLiteralDfa1_0(0x4000000000000L);
00119 case 37:
00120 return jjStopAtPos(0, 61);
00121 case 38:
00122 jjmatchedKind = 58;
00123 return jjMoveStringLiteralDfa1_0(0x10000000000000L);
00124 case 40:
00125 return jjStopAtPos(0, 31);
00126 case 41:
00127 return jjStopAtPos(0, 32);
00128 case 42:
00129 return jjStopAtPos(0, 56);
00130 case 43:
00131 jjmatchedKind = 54;
00132 return jjMoveStringLiteralDfa1_0(0x20000000000000L);
00133 case 44:
00134 return jjStopAtPos(0, 38);
00135 case 45:
00136 return jjStopAtPos(0, 55);
00137 case 46:
00138 return jjStopAtPos(0, 39);
00139 case 47:
00140 return jjStartNfaWithStates_0(0, 57, 19);
00141 case 58:
00142 return jjStopAtPos(0, 46);
00143 case 59:
00144 return jjStopAtPos(0, 37);
00145 case 60:
00146 jjmatchedKind = 42;
00147 return jjMoveStringLiteralDfa1_0(0x1000000000000L);
00148 case 61:
00149 jjmatchedKind = 40;
00150 return jjMoveStringLiteralDfa1_0(0x800000000000L);
00151 case 62:
00152 jjmatchedKind = 41;
00153 return jjMoveStringLiteralDfa1_0(0x2000000000000L);
00154 case 63:
00155 return jjStopAtPos(0, 45);
00156 case 91:
00157 return jjStopAtPos(0, 35);
00158 case 93:
00159 return jjStopAtPos(0, 36);
00160 case 94:
00161 return jjStopAtPos(0, 60);
00162 case 97:
00163 return jjMoveStringLiteralDfa1_0(0x200L);
00164 case 101:
00165 return jjMoveStringLiteralDfa1_0(0x100000L);
00166 case 102:
00167 return jjMoveStringLiteralDfa1_0(0x604000L);
00168 case 105:
00169 return jjMoveStringLiteralDfa1_0(0x60000L);
00170 case 108:
00171 return jjMoveStringLiteralDfa1_0(0x9000L);
00172 case 110:
00173 return jjMoveStringLiteralDfa1_0(0x800L);
00174 case 111:
00175 return jjMoveStringLiteralDfa1_0(0x400L);
00176 case 116:
00177 return jjMoveStringLiteralDfa1_0(0x82000L);
00178 case 118:
00179 return jjMoveStringLiteralDfa1_0(0x10000L);
00180 case 123:
00181 return jjStopAtPos(0, 33);
00182 case 124:
00183 jjmatchedKind = 59;
00184 return jjMoveStringLiteralDfa1_0(0x8000000000000L);
00185 case 125:
00186 return jjStopAtPos(0, 34);
00187 case 126:
00188 return jjStopAtPos(0, 44);
00189 default :
00190 return jjMoveNfa_0(0, 0);
00191 }
00192 }
00193 static private final int jjMoveStringLiteralDfa1_0(long active0)
00194 {
00195 try { curChar = input_stream.readChar(); }
00196 catch(java.io.IOException e) {
00197 jjStopStringLiteralDfa_0(0, active0);
00198 return 1;
00199 }
00200 switch(curChar)
00201 {
00202 case 38:
00203 if ((active0 & 0x10000000000000L) != 0L)
00204 return jjStopAtPos(1, 52);
00205 break;
00206 case 43:
00207 if ((active0 & 0x20000000000000L) != 0L)
00208 return jjStopAtPos(1, 53);
00209 break;
00210 case 61:
00211 if ((active0 & 0x800000000000L) != 0L)
00212 return jjStopAtPos(1, 47);
00213 else if ((active0 & 0x1000000000000L) != 0L)
00214 return jjStopAtPos(1, 48);
00215 else if ((active0 & 0x2000000000000L) != 0L)
00216 return jjStopAtPos(1, 49);
00217 else if ((active0 & 0x4000000000000L) != 0L)
00218 return jjStopAtPos(1, 50);
00219 break;
00220 case 97:
00221 return jjMoveStringLiteralDfa2_0(active0, 0x14000L);
00222 case 101:
00223 return jjMoveStringLiteralDfa2_0(active0, 0x9000L);
00224 case 102:
00225 if ((active0 & 0x40000L) != 0L)
00226 return jjStartNfaWithStates_0(1, 18, 13);
00227 break;
00228 case 104:
00229 return jjMoveStringLiteralDfa2_0(active0, 0x80000L);
00230 case 108:
00231 return jjMoveStringLiteralDfa2_0(active0, 0x100000L);
00232 case 110:
00233 if ((active0 & 0x20000L) != 0L)
00234 return jjStartNfaWithStates_0(1, 17, 13);
00235 else if ((active0 & 0x400000L) != 0L)
00236 return jjStartNfaWithStates_0(1, 22, 13);
00237 return jjMoveStringLiteralDfa2_0(active0, 0x200L);
00238 case 111:
00239 return jjMoveStringLiteralDfa2_0(active0, 0x800L);
00240 case 114:
00241 if ((active0 & 0x400L) != 0L)
00242 return jjStartNfaWithStates_0(1, 10, 13);
00243 return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
00244 case 117:
00245 return jjMoveStringLiteralDfa2_0(active0, 0x200000L);
00246 case 124:
00247 if ((active0 & 0x8000000000000L) != 0L)
00248 return jjStopAtPos(1, 51);
00249 break;
00250 default :
00251 break;
00252 }
00253 return jjStartNfa_0(0, active0);
00254 }
00255 static private final int jjMoveStringLiteralDfa2_0(long old0, long active0)
00256 {
00257 if (((active0 &= old0)) == 0L)
00258 return jjStartNfa_0(0, old0);
00259 try { curChar = input_stream.readChar(); }
00260 catch(java.io.IOException e) {
00261 jjStopStringLiteralDfa_0(1, active0);
00262 return 2;
00263 }
00264 switch(curChar)
00265 {
00266 case 100:
00267 if ((active0 & 0x200L) != 0L)
00268 return jjStartNfaWithStates_0(2, 9, 13);
00269 break;
00270 case 101:
00271 return jjMoveStringLiteralDfa3_0(active0, 0x80000L);
00272 case 108:
00273 return jjMoveStringLiteralDfa3_0(active0, 0x4000L);
00274 case 110:
00275 if ((active0 & 0x200000L) != 0L)
00276 return jjStartNfaWithStates_0(2, 21, 13);
00277 return jjMoveStringLiteralDfa3_0(active0, 0x1000L);
00278 case 114:
00279 if ((active0 & 0x10000L) != 0L)
00280 return jjStartNfaWithStates_0(2, 16, 13);
00281 break;
00282 case 115:
00283 return jjMoveStringLiteralDfa3_0(active0, 0x100000L);
00284 case 116:
00285 if ((active0 & 0x800L) != 0L)
00286 return jjStartNfaWithStates_0(2, 11, 13);
00287 else if ((active0 & 0x8000L) != 0L)
00288 return jjStartNfaWithStates_0(2, 15, 13);
00289 break;
00290 case 117:
00291 return jjMoveStringLiteralDfa3_0(active0, 0x2000L);
00292 default :
00293 break;
00294 }
00295 return jjStartNfa_0(1, active0);
00296 }
00297 static private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
00298 {
00299 if (((active0 &= old0)) == 0L)
00300 return jjStartNfa_0(1, old0);
00301 try { curChar = input_stream.readChar(); }
00302 catch(java.io.IOException e) {
00303 jjStopStringLiteralDfa_0(2, active0);
00304 return 3;
00305 }
00306 switch(curChar)
00307 {
00308 case 101:
00309 if ((active0 & 0x2000L) != 0L)
00310 return jjStartNfaWithStates_0(3, 13, 13);
00311 else if ((active0 & 0x100000L) != 0L)
00312 return jjStartNfaWithStates_0(3, 20, 13);
00313 break;
00314 case 103:
00315 return jjMoveStringLiteralDfa4_0(active0, 0x1000L);
00316 case 110:
00317 if ((active0 & 0x80000L) != 0L)
00318 return jjStartNfaWithStates_0(3, 19, 13);
00319 break;
00320 case 115:
00321 return jjMoveStringLiteralDfa4_0(active0, 0x4000L);
00322 default :
00323 break;
00324 }
00325 return jjStartNfa_0(2, active0);
00326 }
00327 static private final int jjMoveStringLiteralDfa4_0(long old0, long active0)
00328 {
00329 if (((active0 &= old0)) == 0L)
00330 return jjStartNfa_0(2, old0);
00331 try { curChar = input_stream.readChar(); }
00332 catch(java.io.IOException e) {
00333 jjStopStringLiteralDfa_0(3, active0);
00334 return 4;
00335 }
00336 switch(curChar)
00337 {
00338 case 101:
00339 if ((active0 & 0x4000L) != 0L)
00340 return jjStartNfaWithStates_0(4, 14, 13);
00341 break;
00342 case 116:
00343 return jjMoveStringLiteralDfa5_0(active0, 0x1000L);
00344 default :
00345 break;
00346 }
00347 return jjStartNfa_0(3, active0);
00348 }
00349 static private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
00350 {
00351 if (((active0 &= old0)) == 0L)
00352 return jjStartNfa_0(3, old0);
00353 try { curChar = input_stream.readChar(); }
00354 catch(java.io.IOException e) {
00355 jjStopStringLiteralDfa_0(4, active0);
00356 return 5;
00357 }
00358 switch(curChar)
00359 {
00360 case 104:
00361 if ((active0 & 0x1000L) != 0L)
00362 return jjStartNfaWithStates_0(5, 12, 13);
00363 break;
00364 default :
00365 break;
00366 }
00367 return jjStartNfa_0(4, active0);
00368 }
00369 static private final void jjCheckNAdd(int state)
00370 {
00371 if (jjrounds[state] != jjround)
00372 {
00373 jjstateSet[jjnewStateCnt++] = state;
00374 jjrounds[state] = jjround;
00375 }
00376 }
00377 static private final void jjAddStates(int start, int end)
00378 {
00379 do {
00380 jjstateSet[jjnewStateCnt++] = jjnextStates[start];
00381 } while (start++ != end);
00382 }
00383 static private final void jjCheckNAddTwoStates(int state1, int state2)
00384 {
00385 jjCheckNAdd(state1);
00386 jjCheckNAdd(state2);
00387 }
00388 static private final void jjCheckNAddStates(int start, int end)
00389 {
00390 do {
00391 jjCheckNAdd(jjnextStates[start]);
00392 } while (start++ != end);
00393 }
00394 static private final void jjCheckNAddStates(int start)
00395 {
00396 jjCheckNAdd(jjnextStates[start]);
00397 jjCheckNAdd(jjnextStates[start + 1]);
00398 }
00399 static final long[] jjbitVec0 = {
00400 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
00401 };
00402 static final long[] jjbitVec2 = {
00403 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
00404 };
00405 static final long[] jjbitVec3 = {
00406 0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
00407 };
00408 static final long[] jjbitVec4 = {
00409 0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
00410 };
00411 static final long[] jjbitVec5 = {
00412 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
00413 };
00414 static final long[] jjbitVec6 = {
00415 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
00416 };
00417 static final long[] jjbitVec7 = {
00418 0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
00419 };
00420 static final long[] jjbitVec8 = {
00421 0x3fffffffffffL, 0x0L, 0x0L, 0x0L
00422 };
00423 static private final int jjMoveNfa_0(int startState, int curPos)
00424 {
00425 int[] nextStates;
00426 int startsAt = 0;
00427 jjnewStateCnt = 37;
00428 int i = 1;
00429 jjstateSet[0] = startState;
00430 int j, kind = 0x7fffffff;
00431 for (;;)
00432 {
00433 if (++jjround == 0x7fffffff)
00434 ReInitRounds();
00435 if (curChar < 64)
00436 {
00437 long l = 1L << curChar;
00438 MatchLoop: do
00439 {
00440 switch(jjstateSet[--i])
00441 {
00442 case 19:
00443 if (curChar == 42)
00444 jjCheckNAddTwoStates(32, 33);
00445 else if (curChar == 47)
00446 jjCheckNAddStates(0, 2);
00447 if (curChar == 42)
00448 jjstateSet[jjnewStateCnt++] = 24;
00449 break;
00450 case 0:
00451 if ((0x3fe000000000000L & l) != 0L)
00452 {
00453 if (kind > 23)
00454 kind = 23;
00455 jjCheckNAddTwoStates(1, 2);
00456 }
00457 else if (curChar == 47)
00458 jjAddStates(3, 5);
00459 else if (curChar == 48)
00460 {
00461 if (kind > 23)
00462 kind = 23;
00463 jjCheckNAddStates(6, 8);
00464 }
00465 else if (curChar == 36)
00466 {
00467 if (kind > 28)
00468 kind = 28;
00469 jjCheckNAdd(13);
00470 }
00471 else if (curChar == 34)
00472 jjCheckNAddStates(9, 11);
00473 break;
00474 case 1:
00475 if ((0x3ff000000000000L & l) == 0L)
00476 break;
00477 if (kind > 23)
00478 kind = 23;
00479 jjCheckNAddTwoStates(1, 2);
00480 break;
00481 case 3:
00482 if (curChar == 34)
00483 jjCheckNAddStates(9, 11);
00484 break;
00485 case 4:
00486 if ((0xfffffffbffffdbffL & l) != 0L)
00487 jjCheckNAddStates(9, 11);
00488 break;
00489 case 6:
00490 if ((0x8400000000L & l) != 0L)
00491 jjCheckNAddStates(9, 11);
00492 break;
00493 case 7:
00494 if (curChar == 34 && kind > 27)
00495 kind = 27;
00496 break;
00497 case 8:
00498 if ((0xff000000000000L & l) != 0L)
00499 jjCheckNAddStates(12, 15);
00500 break;
00501 case 9:
00502 if ((0xff000000000000L & l) != 0L)
00503 jjCheckNAddStates(9, 11);
00504 break;
00505 case 10:
00506 if ((0xf000000000000L & l) != 0L)
00507 jjstateSet[jjnewStateCnt++] = 11;
00508 break;
00509 case 11:
00510 if ((0xff000000000000L & l) != 0L)
00511 jjCheckNAdd(9);
00512 break;
00513 case 12:
00514 if (curChar != 36)
00515 break;
00516 if (kind > 28)
00517 kind = 28;
00518 jjCheckNAdd(13);
00519 break;
00520 case 13:
00521 if ((0x3ff001000000000L & l) == 0L)
00522 break;
00523 if (kind > 28)
00524 kind = 28;
00525 jjCheckNAdd(13);
00526 break;
00527 case 14:
00528 if (curChar != 48)
00529 break;
00530 if (kind > 23)
00531 kind = 23;
00532 jjCheckNAddStates(6, 8);
00533 break;
00534 case 16:
00535 if ((0x3ff000000000000L & l) == 0L)
00536 break;
00537 if (kind > 23)
00538 kind = 23;
00539 jjCheckNAddTwoStates(16, 2);
00540 break;
00541 case 17:
00542 if ((0xff000000000000L & l) == 0L)
00543 break;
00544 if (kind > 23)
00545 kind = 23;
00546 jjCheckNAddTwoStates(17, 2);
00547 break;
00548 case 18:
00549 if (curChar == 47)
00550 jjAddStates(3, 5);
00551 break;
00552 case 20:
00553 if ((0xffffffffffffdbffL & l) != 0L)
00554 jjCheckNAddStates(0, 2);
00555 break;
00556 case 21:
00557 if ((0x2400L & l) != 0L && kind > 6)
00558 kind = 6;
00559 break;
00560 case 22:
00561 if (curChar == 10 && kind > 6)
00562 kind = 6;
00563 break;
00564 case 23:
00565 if (curChar == 13)
00566 jjstateSet[jjnewStateCnt++] = 22;
00567 break;
00568 case 24:
00569 if (curChar == 42)
00570 jjCheckNAddTwoStates(25, 26);
00571 break;
00572 case 25:
00573 if ((0xfffffbffffffffffL & l) != 0L)
00574 jjCheckNAddTwoStates(25, 26);
00575 break;
00576 case 26:
00577 if (curChar == 42)
00578 jjCheckNAddStates(16, 18);
00579 break;
00580 case 27:
00581 if ((0xffff7bffffffffffL & l) != 0L)
00582 jjCheckNAddTwoStates(28, 26);
00583 break;
00584 case 28:
00585 if ((0xfffffbffffffffffL & l) != 0L)
00586 jjCheckNAddTwoStates(28, 26);
00587 break;
00588 case 29:
00589 if (curChar == 47 && kind > 7)
00590 kind = 7;
00591 break;
00592 case 30:
00593 if (curChar == 42)
00594 jjstateSet[jjnewStateCnt++] = 24;
00595 break;
00596 case 31:
00597 if (curChar == 42)
00598 jjCheckNAddTwoStates(32, 33);
00599 break;
00600 case 32:
00601 if ((0xfffffbffffffffffL & l) != 0L)
00602 jjCheckNAddTwoStates(32, 33);
00603 break;
00604 case 33:
00605 if (curChar == 42)
00606 jjCheckNAddStates(19, 21);
00607 break;
00608 case 34:
00609 if ((0xffff7bffffffffffL & l) != 0L)
00610 jjCheckNAddTwoStates(35, 33);
00611 break;
00612 case 35:
00613 if ((0xfffffbffffffffffL & l) != 0L)
00614 jjCheckNAddTwoStates(35, 33);
00615 break;
00616 case 36:
00617 if (curChar == 47 && kind > 8)
00618 kind = 8;
00619 break;
00620 default : break;
00621 }
00622 } while(i != startsAt);
00623 }
00624 else if (curChar < 128)
00625 {
00626 long l = 1L << (curChar & 077);
00627 MatchLoop: do
00628 {
00629 switch(jjstateSet[--i])
00630 {
00631 case 0:
00632 case 13:
00633 if ((0x7fffffe87fffffeL & l) == 0L)
00634 break;
00635 if (kind > 28)
00636 kind = 28;
00637 jjCheckNAdd(13);
00638 break;
00639 case 2:
00640 if ((0x100000001000L & l) != 0L && kind > 23)
00641 kind = 23;
00642 break;
00643 case 4:
00644 if ((0xffffffffefffffffL & l) != 0L)
00645 jjCheckNAddStates(9, 11);
00646 break;
00647 case 5:
00648 if (curChar == 92)
00649 jjAddStates(22, 24);
00650 break;
00651 case 6:
00652 if ((0x14404410000000L & l) != 0L)
00653 jjCheckNAddStates(9, 11);
00654 break;
00655 case 15:
00656 if ((0x100000001000000L & l) != 0L)
00657 jjCheckNAdd(16);
00658 break;
00659 case 16:
00660 if ((0x7e0000007eL & l) == 0L)
00661 break;
00662 if (kind > 23)
00663 kind = 23;
00664 jjCheckNAddTwoStates(16, 2);
00665 break;
00666 case 20:
00667 jjAddStates(0, 2);
00668 break;
00669 case 25:
00670 jjCheckNAddTwoStates(25, 26);
00671 break;
00672 case 27:
00673 case 28:
00674 jjCheckNAddTwoStates(28, 26);
00675 break;
00676 case 32:
00677 jjCheckNAddTwoStates(32, 33);
00678 break;
00679 case 34:
00680 case 35:
00681 jjCheckNAddTwoStates(35, 33);
00682 break;
00683 default : break;
00684 }
00685 } while(i != startsAt);
00686 }
00687 else
00688 {
00689 int hiByte = (int)(curChar >> 8);
00690 int i1 = hiByte >> 6;
00691 long l1 = 1L << (hiByte & 077);
00692 int i2 = (curChar & 0xff) >> 6;
00693 long l2 = 1L << (curChar & 077);
00694 MatchLoop: do
00695 {
00696 switch(jjstateSet[--i])
00697 {
00698 case 0:
00699 case 13:
00700 if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
00701 break;
00702 if (kind > 28)
00703 kind = 28;
00704 jjCheckNAdd(13);
00705 break;
00706 case 4:
00707 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
00708 jjAddStates(9, 11);
00709 break;
00710 case 20:
00711 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
00712 jjAddStates(0, 2);
00713 break;
00714 case 25:
00715 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
00716 jjCheckNAddTwoStates(25, 26);
00717 break;
00718 case 27:
00719 case 28:
00720 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
00721 jjCheckNAddTwoStates(28, 26);
00722 break;
00723 case 32:
00724 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
00725 jjCheckNAddTwoStates(32, 33);
00726 break;
00727 case 34:
00728 case 35:
00729 if (jjCanMove_0(hiByte, i1, i2, l1, l2))
00730 jjCheckNAddTwoStates(35, 33);
00731 break;
00732 default : break;
00733 }
00734 } while(i != startsAt);
00735 }
00736 if (kind != 0x7fffffff)
00737 {
00738 jjmatchedKind = kind;
00739 jjmatchedPos = curPos;
00740 kind = 0x7fffffff;
00741 }
00742 ++curPos;
00743 if ((i = jjnewStateCnt) == (startsAt = 37 - (jjnewStateCnt = startsAt)))
00744 return curPos;
00745 try { curChar = input_stream.readChar(); }
00746 catch(java.io.IOException e) { return curPos; }
00747 }
00748 }
00749 static final int[] jjnextStates = {
00750 20, 21, 23, 19, 30, 31, 15, 17, 2, 4, 5, 7, 4, 5, 9, 7,
00751 26, 27, 29, 33, 34, 36, 6, 8, 10,
00752 };
00753 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
00754 {
00755 switch(hiByte)
00756 {
00757 case 0:
00758 return ((jjbitVec2[i2] & l2) != 0L);
00759 default :
00760 if ((jjbitVec0[i1] & l1) != 0L)
00761 return true;
00762 return false;
00763 }
00764 }
00765 private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
00766 {
00767 switch(hiByte)
00768 {
00769 case 0:
00770 return ((jjbitVec4[i2] & l2) != 0L);
00771 case 48:
00772 return ((jjbitVec5[i2] & l2) != 0L);
00773 case 49:
00774 return ((jjbitVec6[i2] & l2) != 0L);
00775 case 51:
00776 return ((jjbitVec7[i2] & l2) != 0L);
00777 case 61:
00778 return ((jjbitVec8[i2] & l2) != 0L);
00779 default :
00780 if ((jjbitVec3[i1] & l1) != 0L)
00781 return true;
00782 return false;
00783 }
00784 }
00785 public static final String[] jjstrLiteralImages = {
00786 "", null, null, null, null, null, null, null, null, "\141\156\144",
00787 "\157\162", "\156\157\164", "\154\145\156\147\164\150", "\164\162\165\145",
00788 "\146\141\154\163\145", "\154\145\164", "\166\141\162", "\151\156", "\151\146", "\164\150\145\156",
00789 "\145\154\163\145", "\146\165\156", "\146\156", null, null, null, null, null, null, null, null,
00790 "\50", "\51", "\173", "\175", "\133", "\135", "\73", "\54", "\56", "\75", "\76",
00791 "\74", "\41", "\176", "\77", "\72", "\75\75", "\74\75", "\76\75", "\41\75",
00792 "\174\174", "\46\46", "\53\53", "\53", "\55", "\52", "\57", "\46", "\174", "\136", "\45", };
00793 public static final String[] lexStateNames = {
00794 "DEFAULT",
00795 };
00796 static final long[] jjtoToken = {
00797 0x3fffffff98fffe01L,
00798 };
00799 static final long[] jjtoSkip = {
00800 0x1feL,
00801 };
00802 static final long[] jjtoSpecial = {
00803 0x1c0L,
00804 };
00805 static protected JavaCharStream input_stream;
00806 static private final int[] jjrounds = new int[37];
00807 static private final int[] jjstateSet = new int[74];
00808 static protected char curChar;
00809 public Func2ParserTokenManager(JavaCharStream stream){
00810 if (input_stream != null)
00811 throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR);
00812 input_stream = stream;
00813 }
00814 public Func2ParserTokenManager(JavaCharStream stream, int lexState){
00815 this(stream);
00816 SwitchTo(lexState);
00817 }
00818 static public void ReInit(JavaCharStream stream)
00819 {
00820 jjmatchedPos = jjnewStateCnt = 0;
00821 curLexState = defaultLexState;
00822 input_stream = stream;
00823 ReInitRounds();
00824 }
00825 static private final void ReInitRounds()
00826 {
00827 int i;
00828 jjround = 0x80000001;
00829 for (i = 37; i-- > 0;)
00830 jjrounds[i] = 0x80000000;
00831 }
00832 static public void ReInit(JavaCharStream stream, int lexState)
00833 {
00834 ReInit(stream);
00835 SwitchTo(lexState);
00836 }
00837 static public void SwitchTo(int lexState)
00838 {
00839 if (lexState >= 1 || lexState < 0)
00840 throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
00841 else
00842 curLexState = lexState;
00843 }
00844
00845 static protected Token jjFillToken()
00846 {
00847 Token t = Token.newToken(jjmatchedKind);
00848 t.kind = jjmatchedKind;
00849 String im = jjstrLiteralImages[jjmatchedKind];
00850 t.image = (im == null) ? input_stream.GetImage() : im;
00851 t.beginLine = input_stream.getBeginLine();
00852 t.beginColumn = input_stream.getBeginColumn();
00853 t.endLine = input_stream.getEndLine();
00854 t.endColumn = input_stream.getEndColumn();
00855 return t;
00856 }
00857
00858 static int curLexState = 0;
00859 static int defaultLexState = 0;
00860 static int jjnewStateCnt;
00861 static int jjround;
00862 static int jjmatchedPos;
00863 static int jjmatchedKind;
00864
00865 public static Token getNextToken()
00866 {
00867 int kind;
00868 Token specialToken = null;
00869 Token matchedToken;
00870 int curPos = 0;
00871
00872 EOFLoop :
00873 for (;;)
00874 {
00875 try
00876 {
00877 curChar = input_stream.BeginToken();
00878 }
00879 catch(java.io.IOException e)
00880 {
00881 jjmatchedKind = 0;
00882 matchedToken = jjFillToken();
00883 matchedToken.specialToken = specialToken;
00884 return matchedToken;
00885 }
00886
00887 try { input_stream.backup(0);
00888 while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L)
00889 curChar = input_stream.BeginToken();
00890 }
00891 catch (java.io.IOException e1) { continue EOFLoop; }
00892 jjmatchedKind = 0x7fffffff;
00893 jjmatchedPos = 0;
00894 curPos = jjMoveStringLiteralDfa0_0();
00895 if (jjmatchedKind != 0x7fffffff)
00896 {
00897 if (jjmatchedPos + 1 < curPos)
00898 input_stream.backup(curPos - jjmatchedPos - 1);
00899 if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
00900 {
00901 matchedToken = jjFillToken();
00902 matchedToken.specialToken = specialToken;
00903 return matchedToken;
00904 }
00905 else
00906 {
00907 if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
00908 {
00909 matchedToken = jjFillToken();
00910 if (specialToken == null)
00911 specialToken = matchedToken;
00912 else
00913 {
00914 matchedToken.specialToken = specialToken;
00915 specialToken = (specialToken.next = matchedToken);
00916 }
00917 }
00918 continue EOFLoop;
00919 }
00920 }
00921 int error_line = input_stream.getEndLine();
00922 int error_column = input_stream.getEndColumn();
00923 String error_after = null;
00924 boolean EOFSeen = false;
00925 try { input_stream.readChar(); input_stream.backup(1); }
00926 catch (java.io.IOException e1) {
00927 EOFSeen = true;
00928 error_after = curPos <= 1 ? "" : input_stream.GetImage();
00929 if (curChar == '\n' || curChar == '\r') {
00930 error_line++;
00931 error_column = 0;
00932 }
00933 else
00934 error_column++;
00935 }
00936 if (!EOFSeen) {
00937 input_stream.backup(1);
00938 error_after = curPos <= 1 ? "" : input_stream.GetImage();
00939 }
00940 throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
00941 }
00942 }
00943
00944 }