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