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