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