1 2 57 package org.objectstyle.cayenne.wocompat.parser; 58 59 public class ParserTokenManager implements ParserConstants 60 { 61 public java.io.PrintStream debugStream = System.out; 62 public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } 63 private final int jjStopStringLiteralDfa_0(int pos, long active0) 64 { 65 switch (pos) 66 { 67 case 0: 68 if ((active0 & 0x4000L) != 0L) 69 { 70 jjmatchedKind = 17; 71 return 5; 72 } 73 return -1; 74 default : 75 return -1; 76 } 77 } 78 private final int jjStartNfa_0(int pos, long active0) 79 { 80 return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); 81 } 82 private final int jjStopAtPos(int pos, int kind) 83 { 84 jjmatchedKind = kind; 85 jjmatchedPos = pos; 86 return pos + 1; 87 } 88 private final int jjStartNfaWithStates_0(int pos, int kind, int state) 89 { 90 jjmatchedKind = kind; 91 jjmatchedPos = pos; 92 try { curChar = input_stream.readChar(); } 93 catch(java.io.IOException e) { return pos + 1; } 94 return jjMoveNfa_0(state, pos + 1); 95 } 96 private final int jjMoveStringLiteralDfa0_0() 97 { 98 switch(curChar) 99 { 100 case 34: 101 return jjStopAtPos(0, 18); 102 case 40: 103 return jjStopAtPos(0, 8); 104 case 41: 105 return jjStopAtPos(0, 9); 106 case 44: 107 return jjStopAtPos(0, 12); 108 case 47: 109 return jjMoveStringLiteralDfa1_0(0x4000L); 110 case 59: 111 return jjStopAtPos(0, 13); 112 case 61: 113 return jjStopAtPos(0, 7); 114 case 123: 115 return jjStopAtPos(0, 10); 116 case 125: 117 return jjStopAtPos(0, 11); 118 default : 119 return jjMoveNfa_0(6, 0); 120 } 121 } 122 private final int jjMoveStringLiteralDfa1_0(long active0) 123 { 124 try { curChar = input_stream.readChar(); } 125 catch(java.io.IOException e) { 126 jjStopStringLiteralDfa_0(0, active0); 127 return 1; 128 } 129 switch(curChar) 130 { 131 case 47: 132 if ((active0 & 0x4000L) != 0L) 133 return jjStartNfaWithStates_0(1, 14, 5); 134 break; 135 default : 136 break; 137 } 138 return jjStartNfa_0(0, active0); 139 } 140 private final void jjCheckNAdd(int state) 141 { 142 if (jjrounds[state] != jjround) 143 { 144 jjstateSet[jjnewStateCnt++] = state; 145 jjrounds[state] = jjround; 146 } 147 } 148 private final void jjAddStates(int start, int end) 149 { 150 do { 151 jjstateSet[jjnewStateCnt++] = jjnextStates[start]; 152 } while (start++ != end); 153 } 154 private final void jjCheckNAddTwoStates(int state1, int state2) 155 { 156 jjCheckNAdd(state1); 157 jjCheckNAdd(state2); 158 } 159 private final void jjCheckNAddStates(int start, int end) 160 { 161 do { 162 jjCheckNAdd(jjnextStates[start]); 163 } while (start++ != end); 164 } 165 private final void jjCheckNAddStates(int start) 166 { 167 jjCheckNAdd(jjnextStates[start]); 168 jjCheckNAdd(jjnextStates[start + 1]); 169 } 170 static final long[] jjbitVec0 = { 171 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL 172 }; 173 private final int jjMoveNfa_0(int startState, int curPos) 174 { 175 int[] nextStates; 176 int startsAt = 0; 177 jjnewStateCnt = 10; 178 int i = 1; 179 jjstateSet[0] = startState; 180 int j, kind = 0x7fffffff; 181 for (;;) 182 { 183 if (++jjround == 0x7fffffff) 184 ReInitRounds(); 185 if (curChar < 64) 186 { 187 long l = 1L << curChar; 188 MatchLoop: do 189 { 190 switch(jjstateSet[--i]) 191 { 192 case 6: 193 if ((0xd7ffecfaffffd9ffL & l) != 0L) 194 { 195 if (kind > 17) 196 kind = 17; 197 jjCheckNAdd(5); 198 } 199 if ((0x3ff000000000000L & l) != 0L) 200 { 201 if (kind > 5) 202 kind = 5; 203 jjCheckNAddStates(0, 2); 204 } 205 else if (curChar == 45) 206 jjCheckNAddStates(0, 2); 207 else if (curChar == 46) 208 jjCheckNAdd(1); 209 break; 210 case 0: 211 if (curChar == 46) 212 jjCheckNAdd(1); 213 break; 214 case 1: 215 if ((0x3ff000000000000L & l) == 0L) 216 break; 217 if (kind > 6) 218 kind = 6; 219 jjCheckNAddTwoStates(1, 2); 220 break; 221 case 3: 222 if ((0x280000000000L & l) != 0L) 223 jjCheckNAdd(4); 224 break; 225 case 4: 226 if ((0x3ff000000000000L & l) == 0L) 227 break; 228 if (kind > 6) 229 kind = 6; 230 jjCheckNAdd(4); 231 break; 232 case 5: 233 if ((0xd7ffecfaffffd9ffL & l) == 0L) 234 break; 235 if (kind > 17) 236 kind = 17; 237 jjCheckNAdd(5); 238 break; 239 case 7: 240 if ((0x3ff000000000000L & l) == 0L) 241 break; 242 if (kind > 5) 243 kind = 5; 244 jjCheckNAdd(7); 245 break; 246 case 8: 247 if ((0x3ff000000000000L & l) != 0L) 248 jjCheckNAddTwoStates(8, 0); 249 break; 250 case 9: 251 if ((0x3ff000000000000L & l) == 0L) 252 break; 253 if (kind > 5) 254 kind = 5; 255 jjCheckNAddStates(0, 2); 256 break; 257 default : break; 258 } 259 } while(i != startsAt); 260 } 261 else if (curChar < 128) 262 { 263 long l = 1L << (curChar & 077); 264 MatchLoop: do 265 { 266 switch(jjstateSet[--i]) 267 { 268 case 6: 269 case 5: 270 if ((0xd7ffffffffffffffL & l) == 0L) 271 break; 272 if (kind > 17) 273 kind = 17; 274 jjCheckNAdd(5); 275 break; 276 case 2: 277 if ((0x2000000020L & l) != 0L) 278 jjAddStates(3, 4); 279 break; 280 default : break; 281 } 282 } while(i != startsAt); 283 } 284 else 285 { 286 int i2 = (curChar & 0xff) >> 6; 287 long l2 = 1L << (curChar & 077); 288 MatchLoop: do 289 { 290 switch(jjstateSet[--i]) 291 { 292 case 6: 293 case 5: 294 if ((jjbitVec0[i2] & l2) == 0L) 295 break; 296 if (kind > 17) 297 kind = 17; 298 jjCheckNAdd(5); 299 break; 300 default : break; 301 } 302 } while(i != startsAt); 303 } 304 if (kind != 0x7fffffff) 305 { 306 jjmatchedKind = kind; 307 jjmatchedPos = curPos; 308 kind = 0x7fffffff; 309 } 310 ++curPos; 311 if ((i = jjnewStateCnt) == (startsAt = 10 - (jjnewStateCnt = startsAt))) 312 return curPos; 313 try { curChar = input_stream.readChar(); } 314 catch(java.io.IOException e) { return curPos; } 315 } 316 } 317 private final int jjStopStringLiteralDfa_2(int pos, long active0) 318 { 319 switch (pos) 320 { 321 case 0: 322 if ((active0 & 0xff00000L) != 0L) 323 return 2; 324 return -1; 325 default : 326 return -1; 327 } 328 } 329 private final int jjStartNfa_2(int pos, long active0) 330 { 331 return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1); 332 } 333 private final int jjStartNfaWithStates_2(int pos, int kind, int state) 334 { 335 jjmatchedKind = kind; 336 jjmatchedPos = pos; 337 try { curChar = input_stream.readChar(); } 338 catch(java.io.IOException e) { return pos + 1; } 339 return jjMoveNfa_2(state, pos + 1); 340 } 341 private final int jjMoveStringLiteralDfa0_2() 342 { 343 switch(curChar) 344 { 345 case 34: 346 return jjStopAtPos(0, 30); 347 case 92: 348 return jjMoveStringLiteralDfa1_2(0xff00000L); 349 default : 350 return jjMoveNfa_2(1, 0); 351 } 352 } 353 private final int jjMoveStringLiteralDfa1_2(long active0) 354 { 355 try { curChar = input_stream.readChar(); } 356 catch(java.io.IOException e) { 357 jjStopStringLiteralDfa_2(0, active0); 358 return 1; 359 } 360 switch(curChar) 361 { 362 case 34: 363 if ((active0 & 0x8000000L) != 0L) 364 return jjStopAtPos(1, 27); 365 break; 366 case 92: 367 if ((active0 & 0x100000L) != 0L) 368 return jjStopAtPos(1, 20); 369 break; 370 case 97: 371 if ((active0 & 0x200000L) != 0L) 372 return jjStopAtPos(1, 21); 373 break; 374 case 98: 375 if ((active0 & 0x400000L) != 0L) 376 return jjStopAtPos(1, 22); 377 break; 378 case 102: 379 if ((active0 & 0x4000000L) != 0L) 380 return jjStopAtPos(1, 26); 381 break; 382 case 110: 383 if ((active0 & 0x1000000L) != 0L) 384 return jjStopAtPos(1, 24); 385 break; 386 case 116: 387 if ((active0 & 0x800000L) != 0L) 388 return jjStopAtPos(1, 23); 389 break; 390 case 118: 391 if ((active0 & 0x2000000L) != 0L) 392 return jjStopAtPos(1, 25); 393 break; 394 default : 395 break; 396 } 397 return jjStartNfa_2(0, active0); 398 } 399 private final int jjMoveNfa_2(int startState, int curPos) 400 { 401 int[] nextStates; 402 int startsAt = 0; 403 jjnewStateCnt = 11; 404 int i = 1; 405 jjstateSet[0] = startState; 406 int j, kind = 0x7fffffff; 407 for (;;) 408 { 409 if (++jjround == 0x7fffffff) 410 ReInitRounds(); 411 if (curChar < 64) 412 { 413 long l = 1L << curChar; 414 MatchLoop: do 415 { 416 switch(jjstateSet[--i]) 417 { 418 case 1: 419 case 0: 420 if ((0xfffffffbffffffffL & l) == 0L) 421 break; 422 if (kind > 19) 423 kind = 19; 424 jjCheckNAdd(0); 425 break; 426 case 2: 427 if ((0xff000000000000L & l) != 0L) 428 jjstateSet[jjnewStateCnt++] = 3; 429 break; 430 case 3: 431 if ((0xff000000000000L & l) != 0L) 432 jjstateSet[jjnewStateCnt++] = 4; 433 break; 434 case 4: 435 if ((0xff000000000000L & l) != 0L && kind > 28) 436 kind = 28; 437 break; 438 case 6: 439 if ((0x3ff000000000000L & l) != 0L) 440 jjstateSet[jjnewStateCnt++] = 7; 441 break; 442 case 7: 443 if ((0x3ff000000000000L & l) != 0L) 444 jjstateSet[jjnewStateCnt++] = 8; 445 break; 446 case 8: 447 if ((0x3ff000000000000L & l) != 0L) 448 jjstateSet[jjnewStateCnt++] = 9; 449 break; 450 case 9: 451 if ((0x3ff000000000000L & l) != 0L && kind > 29) 452 kind = 29; 453 break; 454 default : break; 455 } 456 } while(i != startsAt); 457 } 458 else if (curChar < 128) 459 { 460 long l = 1L << (curChar & 077); 461 MatchLoop: do 462 { 463 switch(jjstateSet[--i]) 464 { 465 case 1: 466 if ((0xffffffffefffffffL & l) != 0L) 467 { 468 if (kind > 19) 469 kind = 19; 470 jjCheckNAdd(0); 471 } 472 else if (curChar == 92) 473 jjstateSet[jjnewStateCnt++] = 5; 474 if (curChar == 92) 475 jjstateSet[jjnewStateCnt++] = 2; 476 break; 477 case 2: 478 if (curChar == 85) 479 jjstateSet[jjnewStateCnt++] = 6; 480 break; 481 case 0: 482 if ((0xffffffffefffffffL & l) == 0L) 483 break; 484 if (kind > 19) 485 kind = 19; 486 jjCheckNAdd(0); 487 break; 488 case 6: 489 if ((0x7e0000007eL & l) != 0L) 490 jjstateSet[jjnewStateCnt++] = 7; 491 break; 492 case 7: 493 if ((0x7e0000007eL & l) != 0L) 494 jjstateSet[jjnewStateCnt++] = 8; 495 break; 496 case 8: 497 if ((0x7e0000007eL & l) != 0L) 498 jjstateSet[jjnewStateCnt++] = 9; 499 break; 500 case 9: 501 if ((0x7e0000007eL & l) != 0L && kind > 29) 502 kind = 29; 503 break; 504 case 10: 505 if (curChar == 92) 506 jjstateSet[jjnewStateCnt++] = 5; 507 break; 508 default : break; 509 } 510 } while(i != startsAt); 511 } 512 else 513 { 514 int i2 = (curChar & 0xff) >> 6; 515 long l2 = 1L << (curChar & 077); 516 MatchLoop: do 517 { 518 switch(jjstateSet[--i]) 519 { 520 case 1: 521 case 0: 522 if ((jjbitVec0[i2] & l2) == 0L) 523 break; 524 if (kind > 19) 525 kind = 19; 526 jjCheckNAdd(0); 527 break; 528 default : break; 529 } 530 } while(i != startsAt); 531 } 532 if (kind != 0x7fffffff) 533 { 534 jjmatchedKind = kind; 535 jjmatchedPos = curPos; 536 kind = 0x7fffffff; 537 } 538 ++curPos; 539 if ((i = jjnewStateCnt) == (startsAt = 11 - (jjnewStateCnt = startsAt))) 540 return curPos; 541 try { curChar = input_stream.readChar(); } 542 catch(java.io.IOException e) { return curPos; } 543 } 544 } 545 private final int jjMoveStringLiteralDfa0_1() 546 { 547 return jjMoveNfa_1(0, 0); 548 } 549 private final int jjMoveNfa_1(int startState, int curPos) 550 { 551 int[] nextStates; 552 int startsAt = 0; 553 jjnewStateCnt = 2; 554 int i = 1; 555 jjstateSet[0] = startState; 556 int j, kind = 0x7fffffff; 557 for (;;) 558 { 559 if (++jjround == 0x7fffffff) 560 ReInitRounds(); 561 if (curChar < 64) 562 { 563 long l = 1L << curChar; 564 MatchLoop: do 565 { 566 switch(jjstateSet[--i]) 567 { 568 case 0: 569 if ((0xffffffffffffdbffL & l) != 0L) 570 { 571 if (kind > 16) 572 kind = 16; 573 } 574 else if ((0x2400L & l) != 0L) 575 { 576 if (kind > 15) 577 kind = 15; 578 } 579 break; 580 case 1: 581 if ((0xffffffffffffdbffL & l) != 0L) 582 kind = 16; 583 break; 584 default : break; 585 } 586 } while(i != startsAt); 587 } 588 else if (curChar < 128) 589 { 590 long l = 1L << (curChar & 077); 591 MatchLoop: do 592 { 593 switch(jjstateSet[--i]) 594 { 595 case 0: 596 kind = 16; 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 > 16) 612 kind = 16; 613 break; 614 default : break; 615 } 616 } while(i != startsAt); 617 } 618 if (kind != 0x7fffffff) 619 { 620 jjmatchedKind = kind; 621 jjmatchedPos = curPos; 622 kind = 0x7fffffff; 623 } 624 ++curPos; 625 if ((i = jjnewStateCnt) == (startsAt = 2 - (jjnewStateCnt = startsAt))) 626 return curPos; 627 try { curChar = input_stream.readChar(); } 628 catch(java.io.IOException e) { return curPos; } 629 } 630 } 631 static final int[] jjnextStates = { 632 7, 8, 0, 3, 4, 633 }; 634 public static final String [] jjstrLiteralImages = { 635 "", null, null, null, null, null, null, "\75", "\50", "\51", "\173", "\175", 636 "\54", "\73", null, null, null, null, null, null, null, null, null, null, null, null, 637 null, null, null, null, null, }; 638 public static final String [] lexStateNames = { 639 "DEFAULT", 640 "WithinComment", 641 "WithinQuotedString", 642 }; 643 public static final int[] jjnewLexState = { 644 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, -1, -1, 2, -1, -1, -1, -1, -1, -1, 645 -1, -1, -1, -1, -1, 0, 646 }; 647 static final long[] jjtoToken = { 648 0x40023fe1L, 649 }; 650 static final long[] jjtoSkip = { 651 0x4c01eL, 652 }; 653 static final long[] jjtoMore = { 654 0x3ff90000L, 655 }; 656 protected SimpleCharStream input_stream; 657 private final int[] jjrounds = new int[11]; 658 private final int[] jjstateSet = new int[22]; 659 StringBuffer image; 660 int jjimageLen; 661 int lengthOfMatch; 662 protected char curChar; 663 public ParserTokenManager(SimpleCharStream stream) 664 { 665 if (SimpleCharStream.staticFlag) 666 throw new Error ("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); 667 input_stream = stream; 668 } 669 public ParserTokenManager(SimpleCharStream stream, int lexState) 670 { 671 this(stream); 672 SwitchTo(lexState); 673 } 674 public void ReInit(SimpleCharStream stream) 675 { 676 jjmatchedPos = jjnewStateCnt = 0; 677 curLexState = defaultLexState; 678 input_stream = stream; 679 ReInitRounds(); 680 } 681 private final void ReInitRounds() 682 { 683 int i; 684 jjround = 0x80000001; 685 for (i = 11; i-- > 0;) 686 jjrounds[i] = 0x80000000; 687 } 688 public void ReInit(SimpleCharStream stream, int lexState) 689 { 690 ReInit(stream); 691 SwitchTo(lexState); 692 } 693 public void SwitchTo(int lexState) 694 { 695 if (lexState >= 3 || lexState < 0) 696 throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); 697 else 698 curLexState = lexState; 699 } 700 701 protected Token jjFillToken() 702 { 703 Token t = Token.newToken(jjmatchedKind); 704 t.kind = jjmatchedKind; 705 String im = jjstrLiteralImages[jjmatchedKind]; 706 t.image = (im == null) ? input_stream.GetImage() : im; 707 t.beginLine = input_stream.getBeginLine(); 708 t.beginColumn = input_stream.getBeginColumn(); 709 t.endLine = input_stream.getEndLine(); 710 t.endColumn = input_stream.getEndColumn(); 711 return t; 712 } 713 714 int curLexState = 0; 715 int defaultLexState = 0; 716 int jjnewStateCnt; 717 int jjround; 718 int jjmatchedPos; 719 int jjmatchedKind; 720 721 public Token getNextToken() 722 { 723 int kind; 724 Token specialToken = null; 725 Token matchedToken; 726 int curPos = 0; 727 728 EOFLoop : 729 for (;;) 730 { 731 try 732 { 733 curChar = input_stream.BeginToken(); 734 } 735 catch(java.io.IOException e) 736 { 737 jjmatchedKind = 0; 738 matchedToken = jjFillToken(); 739 return matchedToken; 740 } 741 image = null; 742 jjimageLen = 0; 743 744 for (;;) 745 { 746 switch(curLexState) 747 { 748 case 0: 749 try { input_stream.backup(0); 750 while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L) 751 curChar = input_stream.BeginToken(); 752 } 753 catch (java.io.IOException e1) { continue EOFLoop; } 754 jjmatchedKind = 0x7fffffff; 755 jjmatchedPos = 0; 756 curPos = jjMoveStringLiteralDfa0_0(); 757 break; 758 case 1: 759 jjmatchedKind = 0x7fffffff; 760 jjmatchedPos = 0; 761 curPos = jjMoveStringLiteralDfa0_1(); 762 break; 763 case 2: 764 jjmatchedKind = 0x7fffffff; 765 jjmatchedPos = 0; 766 curPos = jjMoveStringLiteralDfa0_2(); 767 break; 768 } 769 if (jjmatchedKind != 0x7fffffff) 770 { 771 if (jjmatchedPos + 1 < curPos) 772 input_stream.backup(curPos - jjmatchedPos - 1); 773 if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) 774 { 775 matchedToken = jjFillToken(); 776 TokenLexicalActions(matchedToken); 777 if (jjnewLexState[jjmatchedKind] != -1) 778 curLexState = jjnewLexState[jjmatchedKind]; 779 return matchedToken; 780 } 781 else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) 782 { 783 if (jjnewLexState[jjmatchedKind] != -1) 784 curLexState = jjnewLexState[jjmatchedKind]; 785 continue EOFLoop; 786 } 787 MoreLexicalActions(); 788 if (jjnewLexState[jjmatchedKind] != -1) 789 curLexState = jjnewLexState[jjmatchedKind]; 790 curPos = 0; 791 jjmatchedKind = 0x7fffffff; 792 try { 793 curChar = input_stream.readChar(); 794 continue; 795 } 796 catch (java.io.IOException e1) { } 797 } 798 int error_line = input_stream.getEndLine(); 799 int error_column = input_stream.getEndColumn(); 800 String error_after = null; 801 boolean EOFSeen = false; 802 try { input_stream.readChar(); input_stream.backup(1); } 803 catch (java.io.IOException e1) { 804 EOFSeen = true; 805 error_after = curPos <= 1 ? "" : input_stream.GetImage(); 806 if (curChar == '\n' || curChar == '\r') { 807 error_line++; 808 error_column = 0; 809 } 810 else 811 error_column++; 812 } 813 if (!EOFSeen) { 814 input_stream.backup(1); 815 error_after = curPos <= 1 ? "" : input_stream.GetImage(); 816 } 817 throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); 818 } 819 } 820 } 821 822 void MoreLexicalActions() 823 { 824 jjimageLen += (lengthOfMatch = jjmatchedPos + 1); 825 switch(jjmatchedKind) 826 { 827 case 20 : 828 if (image == null) 829 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 830 else 831 image.append(new String (input_stream.GetSuffix(jjimageLen))); 832 jjimageLen = 0; 833 image.setLength(image.length()-1); 834 break; 835 case 21 : 836 if (image == null) 837 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 838 else 839 image.append(new String (input_stream.GetSuffix(jjimageLen))); 840 jjimageLen = 0; 841 int len = image.length(); image.setCharAt(len-2,(char)7); image.setLength(len-1); 842 break; 843 case 22 : 844 if (image == null) 845 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 846 else 847 image.append(new String (input_stream.GetSuffix(jjimageLen))); 848 jjimageLen = 0; 849 len = image.length(); image.setCharAt(len-2,'\b'); image.setLength(len-1); 850 break; 851 case 23 : 852 if (image == null) 853 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 854 else 855 image.append(new String (input_stream.GetSuffix(jjimageLen))); 856 jjimageLen = 0; 857 len = image.length(); image.setCharAt(len-2,'\t'); image.setLength(len-1); 858 break; 859 case 24 : 860 if (image == null) 861 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 862 else 863 image.append(new String (input_stream.GetSuffix(jjimageLen))); 864 jjimageLen = 0; 865 len = image.length(); image.setCharAt(len-2,'\n'); image.setLength(len-1); 866 break; 867 case 25 : 868 if (image == null) 869 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 870 else 871 image.append(new String (input_stream.GetSuffix(jjimageLen))); 872 jjimageLen = 0; 873 len = image.length(); image.setCharAt(len-2, (char)11); image.setLength(len-1); 874 break; 875 case 26 : 876 if (image == null) 877 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 878 else 879 image.append(new String (input_stream.GetSuffix(jjimageLen))); 880 jjimageLen = 0; 881 len = image.length(); image.setCharAt(len-2,'\f'); image.setLength(len-1); 882 break; 883 case 27 : 884 if (image == null) 885 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 886 else 887 image.append(new String (input_stream.GetSuffix(jjimageLen))); 888 jjimageLen = 0; 889 len = image.length(); image.setCharAt(len-2,'"'); image.setLength(len-1); 890 break; 891 case 28 : 892 if (image == null) 893 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 894 else 895 image.append(new String (input_stream.GetSuffix(jjimageLen))); 896 jjimageLen = 0; 897 int oct; 898 len = image.length(); 899 oct = ((int)(image.charAt(len-1)-'0')) + 900 8 * ((int)(image.charAt(len-2)-'0')) + 901 64 * ((int)(image.charAt(len-3)-'0')); 902 image.setCharAt(len-4, (char)oct); 903 image.setLength(len-3); 904 break; 905 case 29 : 906 if (image == null) 907 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen))); 908 else 909 image.append(new String (input_stream.GetSuffix(jjimageLen))); 910 jjimageLen = 0; 911 int dig,c, base=1,hex=0; 912 len = image.length(); 913 for(int i=0; i<4; ++i) { 914 c=(int)image.charAt(len-(i+1)); 915 if (c<='9') c-='0'; 916 else if (c<='F') c = (c -'A') + 10; 917 else c =(c -'a') + 10; 918 hex += c*base; 919 base*=16; 920 } 921 image.setCharAt(len-6, (char)hex); 922 image.setLength(len-5); 923 break; 924 default : 925 break; 926 } 927 } 928 void TokenLexicalActions(Token matchedToken) 929 { 930 switch(jjmatchedKind) 931 { 932 case 30 : 933 if (image == null) 934 image = new StringBuffer (new String (input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)))); 935 else 936 image.append(new String (input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)))); 937 image.setLength(image.length()-1); matchedToken.image = image.toString(); 938 break; 939 default : 940 break; 941 } 942 } 943 } 944 | Popular Tags |