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