001/* SRCPClientParserTokenManager.java */ 002/* Generated By:JJTree&JavaCC: Do not edit this line. SRCPClientParserTokenManager.java */ 003package jmri.jmrix.srcp.parser; 004import org.slf4j.Logger; 005import org.slf4j.LoggerFactory; 006 007/* Token Manager. */ 008public class SRCPClientParserTokenManager implements SRCPClientParserConstants { 009 010 /* Debug output. */ 011 public java.io.PrintStream debugStream = System.out; 012 /* Set debug output. */ 013 public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } 014private final int jjStopStringLiteralDfa_1(int pos, long active0){ 015 switch (pos) 016 { 017 default : 018 return -1; 019 } 020} 021private final int jjStartNfa_1(int pos, long active0){ 022 return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1); 023} 024private int jjStopAtPos(int pos, int kind) 025{ 026 jjmatchedKind = kind; 027 jjmatchedPos = pos; 028 return pos + 1; 029} 030private int jjMoveStringLiteralDfa0_1(){ 031 switch(curChar) 032 { 033 case 10: 034 return jjStartNfaWithStates_1(0, 4, 1); 035 case 13: 036 return jjStartNfaWithStates_1(0, 3, 1); 037 default : 038 return jjMoveNfa_1(0, 0); 039 } 040} 041private int jjStartNfaWithStates_1(int pos, int kind, int state) 042{ 043 jjmatchedKind = kind; 044 jjmatchedPos = pos; 045 try { curChar = input_stream.readChar(); } 046 catch(java.io.IOException e) { return pos + 1; } 047 return jjMoveNfa_1(state, pos + 1); 048} 049private int jjMoveNfa_1(int startState, int curPos) 050{ 051 int startsAt = 0; 052 jjnewStateCnt = 98; 053 int i = 1; 054 jjstateSet[0] = startState; 055 int kind = 0x7fffffff; 056 for (;;) 057 { 058 if (++jjround == 0x7fffffff) 059 ReInitRounds(); 060 if (curChar < 64) 061 { 062 long l = 1L << curChar; 063 do 064 { 065 switch(jjstateSet[--i]) 066 { 067 case 0: 068 if ((0x3ff000000000000L & l) != 0L) 069 { 070 if (kind > 9) 071 kind = 9; 072 { jjCheckNAddStates(0, 4); } 073 } 074 else if ((0x2400L & l) != 0L) 075 jjstateSet[jjnewStateCnt++] = 1; 076 else if (curChar == 45) 077 { jjCheckNAdd(12); } 078 if ((0x3fe000000000000L & l) != 0L) 079 { 080 if (kind > 7) 081 kind = 7; 082 { jjCheckNAdd(5); } 083 } 084 else if (curChar == 48) 085 { 086 if (kind > 6) 087 kind = 6; 088 { jjCheckNAdd(3); } 089 } 090 if ((0x3f000000000000L & l) != 0L) 091 jjstateSet[jjnewStateCnt++] = 10; 092 if ((0x2007000000000000L & l) != 0L) 093 { 094 if (kind > 8) 095 kind = 8; 096 } 097 if ((0x7000000000000L & l) != 0L) 098 jjstateSet[jjnewStateCnt++] = 8; 099 break; 100 case 1: 101 if ((0x2400L & l) != 0L && kind > 2) 102 kind = 2; 103 break; 104 case 2: 105 if (curChar != 48) 106 break; 107 if (kind > 6) 108 kind = 6; 109 { jjCheckNAdd(3); } 110 break; 111 case 3: 112 if ((0x3ff000000000000L & l) == 0L) 113 break; 114 if (kind > 6) 115 kind = 6; 116 { jjCheckNAdd(3); } 117 break; 118 case 4: 119 if ((0x3fe000000000000L & l) == 0L) 120 break; 121 if (kind > 7) 122 kind = 7; 123 { jjCheckNAdd(5); } 124 break; 125 case 5: 126 if ((0x3ff000000000000L & l) == 0L) 127 break; 128 if (kind > 7) 129 kind = 7; 130 { jjCheckNAdd(5); } 131 break; 132 case 6: 133 if ((0x2007000000000000L & l) != 0L && kind > 8) 134 kind = 8; 135 break; 136 case 7: 137 if ((0x7000000000000L & l) != 0L) 138 jjstateSet[jjnewStateCnt++] = 8; 139 break; 140 case 8: 141 if ((0x3ff000000000000L & l) != 0L && kind > 9) 142 kind = 9; 143 break; 144 case 9: 145 if ((0x3f000000000000L & l) != 0L) 146 jjstateSet[jjnewStateCnt++] = 10; 147 break; 148 case 10: 149 if ((0x3ff000000000000L & l) != 0L && kind > 10) 150 kind = 10; 151 break; 152 case 11: 153 if (curChar == 45) 154 { jjCheckNAdd(12); } 155 break; 156 case 12: 157 if ((0x3ff000000000000L & l) == 0L) 158 break; 159 if (kind > 11) 160 kind = 11; 161 { jjCheckNAdd(12); } 162 break; 163 case 52: 164 if ((0x3ff000000000000L & l) == 0L) 165 break; 166 if (kind > 9) 167 kind = 9; 168 { jjCheckNAddStates(0, 4); } 169 break; 170 case 53: 171 if ((0x3ff000000000000L & l) == 0L) 172 break; 173 if (kind > 12) 174 kind = 12; 175 { jjCheckNAddTwoStates(53, 54); } 176 break; 177 case 54: 178 if (curChar == 46) 179 { jjCheckNAdd(55); } 180 break; 181 case 55: 182 if ((0x3ff000000000000L & l) == 0L) 183 break; 184 if (kind > 12) 185 kind = 12; 186 { jjCheckNAdd(55); } 187 break; 188 case 56: 189 if ((0x3ff000000000000L & l) != 0L) 190 { jjCheckNAddTwoStates(56, 57); } 191 break; 192 case 57: 193 if (curChar == 46) 194 { jjCheckNAdd(58); } 195 break; 196 case 58: 197 if ((0x3ff000000000000L & l) != 0L) 198 { jjCheckNAddTwoStates(58, 59); } 199 break; 200 case 59: 201 if (curChar == 46) 202 { jjCheckNAdd(60); } 203 break; 204 case 60: 205 if ((0x3ff000000000000L & l) == 0L) 206 break; 207 if (kind > 29) 208 kind = 29; 209 { jjCheckNAdd(60); } 210 break; 211 default : break; 212 } 213 } while(i != startsAt); 214 } 215 else if (curChar < 128) 216 { 217 long l = 1L << (curChar & 077); 218 do 219 { 220 switch(jjstateSet[--i]) 221 { 222 case 0: 223 if ((0x409704204097042L & l) != 0L) 224 { 225 if (kind > 16) 226 kind = 16; 227 } 228 else if ((0x800000008L & l) != 0L) 229 { jjAddStates(5, 7); } 230 else if ((0x800000008000L & l) != 0L) 231 { jjAddStates(8, 10); } 232 else if ((0x8000000080L & l) != 0L) 233 { jjAddStates(11, 13); } 234 else if ((0x4000000040000L & l) != 0L) 235 jjstateSet[jjnewStateCnt++] = 50; 236 else if ((0x2000000020L & l) != 0L) 237 jjstateSet[jjnewStateCnt++] = 45; 238 else if ((0x20000000200L & l) != 0L) 239 jjstateSet[jjnewStateCnt++] = 41; 240 else if ((0x1000000010L & l) != 0L) 241 jjstateSet[jjnewStateCnt++] = 30; 242 else if ((0x10000000100000L & l) != 0L) 243 jjstateSet[jjnewStateCnt++] = 21; 244 if ((0x8000000080000L & l) != 0L) 245 { jjAddStates(14, 17); } 246 else if ((0x1000000010000L & l) != 0L) 247 jjstateSet[jjnewStateCnt++] = 25; 248 else if ((0x100000001000L & l) != 0L) 249 jjstateSet[jjnewStateCnt++] = 17; 250 else if ((0x4000000040L & l) != 0L) 251 jjstateSet[jjnewStateCnt++] = 15; 252 break; 253 case 13: 254 if ((0x409704204097042L & l) != 0L && kind > 16) 255 kind = 16; 256 break; 257 case 14: 258 if ((0x4000000040L & l) != 0L) 259 jjstateSet[jjnewStateCnt++] = 15; 260 break; 261 case 15: 262 if ((0x400000004L & l) != 0L && kind > 17) 263 kind = 17; 264 break; 265 case 16: 266 if ((0x100000001000L & l) != 0L) 267 jjstateSet[jjnewStateCnt++] = 17; 268 break; 269 case 17: 270 if ((0x800000008000L & l) != 0L) 271 jjstateSet[jjnewStateCnt++] = 18; 272 break; 273 case 18: 274 if ((0x800000008L & l) != 0L) 275 jjstateSet[jjnewStateCnt++] = 19; 276 break; 277 case 19: 278 if ((0x80000000800L & l) != 0L && kind > 22) 279 kind = 22; 280 break; 281 case 20: 282 if ((0x10000000100000L & l) != 0L) 283 jjstateSet[jjnewStateCnt++] = 21; 284 break; 285 case 21: 286 if ((0x20000000200L & l) != 0L) 287 jjstateSet[jjnewStateCnt++] = 22; 288 break; 289 case 22: 290 if ((0x200000002000L & l) != 0L) 291 jjstateSet[jjnewStateCnt++] = 23; 292 break; 293 case 23: 294 if ((0x2000000020L & l) != 0L && kind > 23) 295 kind = 23; 296 break; 297 case 24: 298 if ((0x1000000010000L & l) != 0L) 299 jjstateSet[jjnewStateCnt++] = 25; 300 break; 301 case 25: 302 if ((0x800000008000L & l) != 0L) 303 jjstateSet[jjnewStateCnt++] = 26; 304 break; 305 case 26: 306 if ((0x80000000800000L & l) != 0L) 307 jjstateSet[jjnewStateCnt++] = 27; 308 break; 309 case 27: 310 if ((0x2000000020L & l) != 0L) 311 jjstateSet[jjnewStateCnt++] = 28; 312 break; 313 case 28: 314 if ((0x4000000040000L & l) != 0L && kind > 24) 315 kind = 24; 316 break; 317 case 29: 318 if ((0x1000000010L & l) != 0L) 319 jjstateSet[jjnewStateCnt++] = 30; 320 break; 321 case 30: 322 if ((0x2000000020L & l) != 0L) 323 jjstateSet[jjnewStateCnt++] = 31; 324 break; 325 case 31: 326 if ((0x8000000080000L & l) != 0L) 327 jjstateSet[jjnewStateCnt++] = 32; 328 break; 329 case 32: 330 if ((0x800000008L & l) != 0L) 331 jjstateSet[jjnewStateCnt++] = 33; 332 break; 333 case 33: 334 if ((0x4000000040000L & l) != 0L) 335 jjstateSet[jjnewStateCnt++] = 34; 336 break; 337 case 34: 338 if ((0x20000000200L & l) != 0L) 339 jjstateSet[jjnewStateCnt++] = 35; 340 break; 341 case 35: 342 if ((0x1000000010000L & l) != 0L) 343 jjstateSet[jjnewStateCnt++] = 36; 344 break; 345 case 36: 346 if ((0x10000000100000L & l) != 0L) 347 jjstateSet[jjnewStateCnt++] = 37; 348 break; 349 case 37: 350 if ((0x20000000200L & l) != 0L) 351 jjstateSet[jjnewStateCnt++] = 38; 352 break; 353 case 38: 354 if ((0x800000008000L & l) != 0L) 355 jjstateSet[jjnewStateCnt++] = 39; 356 break; 357 case 39: 358 if ((0x400000004000L & l) != 0L && kind > 26) 359 kind = 26; 360 break; 361 case 40: 362 if ((0x20000000200L & l) != 0L) 363 jjstateSet[jjnewStateCnt++] = 41; 364 break; 365 case 41: 366 if ((0x400000004000L & l) != 0L) 367 jjstateSet[jjnewStateCnt++] = 42; 368 break; 369 case 42: 370 if ((0x4000000040L & l) != 0L) 371 jjstateSet[jjnewStateCnt++] = 43; 372 break; 373 case 43: 374 if ((0x800000008000L & l) != 0L && kind > 30) 375 kind = 30; 376 break; 377 case 44: 378 if ((0x2000000020L & l) != 0L) 379 jjstateSet[jjnewStateCnt++] = 45; 380 break; 381 case 45: 382 if ((0x4000000040000L & l) != 0L) 383 jjstateSet[jjnewStateCnt++] = 46; 384 break; 385 case 46: 386 if ((0x4000000040000L & l) != 0L) 387 jjstateSet[jjnewStateCnt++] = 47; 388 break; 389 case 47: 390 if ((0x800000008000L & l) != 0L) 391 jjstateSet[jjnewStateCnt++] = 48; 392 break; 393 case 48: 394 if ((0x4000000040000L & l) != 0L && kind > 32) 395 kind = 32; 396 break; 397 case 49: 398 if ((0x4000000040000L & l) != 0L) 399 jjstateSet[jjnewStateCnt++] = 50; 400 break; 401 case 50: 402 if ((0x2000000020L & l) != 0L) 403 jjstateSet[jjnewStateCnt++] = 51; 404 break; 405 case 51: 406 if ((0x8000000080L & l) != 0L && kind > 36) 407 kind = 36; 408 break; 409 case 61: 410 if ((0x8000000080L & l) != 0L) 411 { jjAddStates(11, 13); } 412 break; 413 case 62: 414 if ((0x200000002L & l) != 0L && kind > 18) 415 kind = 18; 416 break; 417 case 63: 418 if ((0x100000001000L & l) != 0L && kind > 19) 419 kind = 19; 420 break; 421 case 64: 422 if ((0x200000002000L & l) != 0L && kind > 20) 423 kind = 20; 424 break; 425 case 65: 426 if ((0x8000000080000L & l) != 0L) 427 { jjAddStates(14, 17); } 428 break; 429 case 66: 430 if ((0x200000002000L & l) != 0L && kind > 21) 431 kind = 21; 432 break; 433 case 67: 434 if ((0x2000000020L & l) != 0L) 435 jjstateSet[jjnewStateCnt++] = 68; 436 break; 437 case 68: 438 if ((0x8000000080000L & l) != 0L) 439 jjstateSet[jjnewStateCnt++] = 69; 440 break; 441 case 69: 442 if ((0x8000000080000L & l) != 0L) 443 jjstateSet[jjnewStateCnt++] = 70; 444 break; 445 case 70: 446 if ((0x20000000200L & l) != 0L) 447 jjstateSet[jjnewStateCnt++] = 71; 448 break; 449 case 71: 450 if ((0x800000008000L & l) != 0L) 451 jjstateSet[jjnewStateCnt++] = 72; 452 break; 453 case 72: 454 if ((0x400000004000L & l) != 0L && kind > 25) 455 kind = 25; 456 break; 457 case 73: 458 if ((0x2000000020L & l) != 0L) 459 jjstateSet[jjnewStateCnt++] = 74; 460 break; 461 case 74: 462 if ((0x4000000040000L & l) != 0L) 463 jjstateSet[jjnewStateCnt++] = 75; 464 break; 465 case 75: 466 if ((0x40000000400000L & l) != 0L) 467 jjstateSet[jjnewStateCnt++] = 76; 468 break; 469 case 76: 470 if ((0x2000000020L & l) != 0L) 471 jjstateSet[jjnewStateCnt++] = 77; 472 break; 473 case 77: 474 if ((0x4000000040000L & l) != 0L && kind > 27) 475 kind = 27; 476 break; 477 case 78: 478 if ((0x4000000040000L & l) != 0L) 479 jjstateSet[jjnewStateCnt++] = 79; 480 break; 481 case 79: 482 if ((0x800000008L & l) != 0L) 483 jjstateSet[jjnewStateCnt++] = 80; 484 break; 485 case 80: 486 if ((0x1000000010000L & l) != 0L && kind > 28) 487 kind = 28; 488 break; 489 case 81: 490 if ((0x800000008000L & l) != 0L) 491 { jjAddStates(8, 10); } 492 break; 493 case 82: 494 if ((0x400000004000L & l) != 0L && kind > 13) 495 kind = 13; 496 break; 497 case 83: 498 if ((0x4000000040L & l) != 0L) 499 jjstateSet[jjnewStateCnt++] = 84; 500 break; 501 case 84: 502 if ((0x4000000040L & l) != 0L && kind > 13) 503 kind = 13; 504 break; 505 case 85: 506 if ((0x80000000800L & l) != 0L && kind > 31) 507 kind = 31; 508 break; 509 case 86: 510 if ((0x800000008L & l) != 0L) 511 { jjAddStates(5, 7); } 512 break; 513 case 87: 514 if ((0x800000008000L & l) != 0L) 515 jjstateSet[jjnewStateCnt++] = 88; 516 break; 517 case 88: 518 if ((0x200000002000L & l) != 0L) 519 jjstateSet[jjnewStateCnt++] = 89; 520 break; 521 case 89: 522 if ((0x200000002000L & l) != 0L) 523 jjstateSet[jjnewStateCnt++] = 90; 524 break; 525 case 90: 526 if ((0x200000002L & l) != 0L) 527 jjstateSet[jjnewStateCnt++] = 91; 528 break; 529 case 91: 530 if ((0x400000004000L & l) != 0L) 531 jjstateSet[jjnewStateCnt++] = 92; 532 break; 533 case 92: 534 if ((0x1000000010L & l) != 0L && kind > 33) 535 kind = 33; 536 break; 537 case 93: 538 if ((0x40000000400000L & l) != 0L) 539 jjstateSet[jjnewStateCnt++] = 94; 540 break; 541 case 94: 542 if ((0x400000004L & l) != 0L) 543 jjstateSet[jjnewStateCnt++] = 95; 544 break; 545 case 95: 546 if ((0x20000000200L & l) != 0L) 547 jjstateSet[jjnewStateCnt++] = 96; 548 break; 549 case 96: 550 if ((0x10000000100000L & l) != 0L && kind > 34) 551 kind = 34; 552 break; 553 case 97: 554 if ((0x40000000400000L & l) != 0L && kind > 35) 555 kind = 35; 556 break; 557 default : break; 558 } 559 } while(i != startsAt); 560 } 561 else 562 { 563 int i2 = (curChar & 0xff) >> 6; 564 long l2 = 1L << (curChar & 077); 565 do 566 { 567 switch(jjstateSet[--i]) 568 { 569 default : break; 570 } 571 } while(i != startsAt); 572 } 573 if (kind != 0x7fffffff) 574 { 575 jjmatchedKind = kind; 576 jjmatchedPos = curPos; 577 kind = 0x7fffffff; 578 } 579 ++curPos; 580 if ((i = jjnewStateCnt) == (startsAt = 98 - (jjnewStateCnt = startsAt))) 581 return curPos; 582 try { curChar = input_stream.readChar(); } 583 catch(java.io.IOException e) { return curPos; } 584 } 585} 586private int jjMoveStringLiteralDfa0_0() 587{ 588 return jjMoveNfa_0(0, 0); 589} 590private int jjMoveNfa_0(int startState, int curPos) 591{ 592 int startsAt = 0; 593 jjnewStateCnt = 2; 594 int i = 1; 595 jjstateSet[0] = startState; 596 int kind = 0x7fffffff; 597 for (;;) 598 { 599 if (++jjround == 0x7fffffff) 600 ReInitRounds(); 601 if (curChar < 64) 602 { 603 long l = 1L << curChar; 604 do 605 { 606 switch(jjstateSet[--i]) 607 { 608 case 0: 609 if ((0x2400L & l) != 0L) 610 jjstateSet[jjnewStateCnt++] = 1; 611 break; 612 case 1: 613 if ((0x2400L & l) != 0L && kind > 2) 614 kind = 2; 615 break; 616 default : break; 617 } 618 } while(i != startsAt); 619 } 620 else if (curChar < 128) 621 { 622 long l = 1L << (curChar & 077); 623 do 624 { 625 switch(jjstateSet[--i]) 626 { 627 default : break; 628 } 629 } while(i != startsAt); 630 } 631 else 632 { 633 int i2 = (curChar & 0xff) >> 6; 634 long l2 = 1L << (curChar & 077); 635 do 636 { 637 switch(jjstateSet[--i]) 638 { 639 default : break; 640 } 641 } while(i != startsAt); 642 } 643 if (kind != 0x7fffffff) 644 { 645 jjmatchedKind = kind; 646 jjmatchedPos = curPos; 647 kind = 0x7fffffff; 648 } 649 ++curPos; 650 if ((i = jjnewStateCnt) == (startsAt = 2 - (jjnewStateCnt = startsAt))) 651 return curPos; 652 try { curChar = input_stream.readChar(); } 653 catch(java.io.IOException e) { return curPos; } 654 } 655} 656 657/* Token literal values. */ 658public static final String[] jjstrLiteralImages = { 659null, null, null, null, null, null, null, null, null, null, null, null, null, 660null, null, null, null, null, null, null, null, null, null, null, null, null, null, 661null, null, null, null, null, null, null, null, null, null, null, null, null, null, 662null, null, null, null, null, null, null, null, null, null, null, null, null, null, 663null, null, null, null, null, null, null, null, }; 664protected Token jjFillToken() 665{ 666 final Token t; 667 final String curTokenImage; 668 final int beginLine; 669 final int endLine; 670 final int beginColumn; 671 final int endColumn; 672 String im = jjstrLiteralImages[jjmatchedKind]; 673 curTokenImage = (im == null) ? input_stream.GetImage() : im; 674 beginLine = input_stream.getBeginLine(); 675 beginColumn = input_stream.getBeginColumn(); 676 endLine = input_stream.getEndLine(); 677 endColumn = input_stream.getEndColumn(); 678 t = Token.newToken(jjmatchedKind); 679 t.kind = jjmatchedKind; 680 t.image = curTokenImage; 681 682 t.beginLine = beginLine; 683 t.endLine = endLine; 684 t.beginColumn = beginColumn; 685 t.endColumn = endColumn; 686 687 return t; 688} 689static final int[] jjnextStates = { 690 12, 53, 54, 56, 57, 87, 93, 97, 82, 83, 85, 62, 63, 64, 66, 67, 691 73, 78, 692}; 693 694int curLexState = 1; 695int defaultLexState = 1; 696int jjnewStateCnt; 697int jjround; 698int jjmatchedPos; 699int jjmatchedKind; 700 701/* Get the next Token. */ 702public Token getNextToken() 703{ 704 Token matchedToken; 705 int curPos = 0; 706 707 EOFLoop : 708 for (;;) 709 { 710 try 711 { 712 curChar = input_stream.BeginToken(); 713 } 714 catch(Exception e) 715 { 716 jjmatchedKind = 0; 717 jjmatchedPos = -1; 718 matchedToken = jjFillToken(); 719 return matchedToken; 720 } 721 722 for (;;) 723 { 724 switch(curLexState) 725 { 726 case 0: 727 jjmatchedKind = 0x7fffffff; 728 jjmatchedPos = 0; 729 curPos = jjMoveStringLiteralDfa0_0(); 730 if (jjmatchedPos == 0 && jjmatchedKind > 1) 731 { 732 jjmatchedKind = 1; 733 } 734 break; 735 case 1: 736 try { input_stream.backup(0); 737 while (curChar <= 32 && (0x100000000L & (1L << curChar)) != 0L) 738 curChar = input_stream.BeginToken(); 739 } 740 catch (java.io.IOException e1) { continue EOFLoop; } 741 jjmatchedKind = 0x7fffffff; 742 jjmatchedPos = 0; 743 curPos = jjMoveStringLiteralDfa0_1(); 744 break; 745 } 746 if (jjmatchedKind != 0x7fffffff) 747 { 748 if (jjmatchedPos + 1 < curPos) 749 input_stream.backup(curPos - jjmatchedPos - 1); 750 if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) 751 { 752 matchedToken = jjFillToken(); 753 if (jjnewLexState[jjmatchedKind] != -1) 754 curLexState = jjnewLexState[jjmatchedKind]; 755 return matchedToken; 756 } 757 else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) 758 { 759 if (jjnewLexState[jjmatchedKind] != -1) 760 curLexState = jjnewLexState[jjmatchedKind]; 761 continue EOFLoop; 762 } 763 if (jjnewLexState[jjmatchedKind] != -1) 764 curLexState = jjnewLexState[jjmatchedKind]; 765 curPos = 0; 766 jjmatchedKind = 0x7fffffff; 767 try { 768 curChar = input_stream.readChar(); 769 continue; 770 } 771 catch (java.io.IOException e1) { } 772 } 773 int error_line = input_stream.getEndLine(); 774 int error_column = input_stream.getEndColumn(); 775 String error_after = null; 776 boolean EOFSeen = false; 777 try { input_stream.readChar(); input_stream.backup(1); } 778 catch (java.io.IOException e1) { 779 EOFSeen = true; 780 error_after = curPos <= 1 ? "" : input_stream.GetImage(); 781 if (curChar == '\n' || curChar == '\r') { 782 error_line++; 783 error_column = 0; 784 } 785 else 786 error_column++; 787 } 788 if (!EOFSeen) { 789 input_stream.backup(1); 790 error_after = curPos <= 1 ? "" : input_stream.GetImage(); 791 } 792 throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); 793 } 794 } 795} 796 797void SkipLexicalActions(Token matchedToken) 798{ 799 switch(jjmatchedKind) 800 { 801 default : 802 break; 803 } 804} 805void MoreLexicalActions() 806{ 807 jjimageLen += (lengthOfMatch = jjmatchedPos + 1); 808 switch(jjmatchedKind) 809 { 810 default : 811 break; 812 } 813} 814void TokenLexicalActions(Token matchedToken) 815{ 816 switch(jjmatchedKind) 817 { 818 default : 819 break; 820 } 821} 822private void jjCheckNAdd(int state) 823{ 824 if (jjrounds[state] != jjround) 825 { 826 jjstateSet[jjnewStateCnt++] = state; 827 jjrounds[state] = jjround; 828 } 829} 830private void jjAddStates(int start, int end) 831{ 832 do { 833 jjstateSet[jjnewStateCnt++] = jjnextStates[start]; 834 } while (start++ != end); 835} 836private void jjCheckNAddTwoStates(int state1, int state2) 837{ 838 jjCheckNAdd(state1); 839 jjCheckNAdd(state2); 840} 841 842private void jjCheckNAddStates(int start, int end) 843{ 844 do { 845 jjCheckNAdd(jjnextStates[start]); 846 } while (start++ != end); 847} 848 849 /* Constructor. */ 850 public SRCPClientParserTokenManager(SimpleCharStream stream){ 851 852 if (SimpleCharStream.staticFlag) 853 throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); 854 855 input_stream = stream; 856 } 857 858 /* Constructor. */ 859 public SRCPClientParserTokenManager (SimpleCharStream stream, int lexState){ 860 ReInit(stream); 861 SwitchTo(lexState); 862 } 863 864 /* Reinitialise parser. */ 865 866 public void ReInit(SimpleCharStream stream) 867 { 868 869 870 jjmatchedPos = 871 jjnewStateCnt = 872 0; 873 curLexState = defaultLexState; 874 input_stream = stream; 875 ReInitRounds(); 876 } 877 878 private void ReInitRounds() 879 { 880 int i; 881 jjround = 0x80000001; 882 for (i = 98; i-- > 0;) 883 jjrounds[i] = 0x80000000; 884 } 885 886 /* Reinitialise parser. */ 887 public void ReInit(SimpleCharStream stream, int lexState) 888 889 { 890 ReInit(stream); 891 SwitchTo(lexState); 892 } 893 894 /* Switch to specified lex state. */ 895 public void SwitchTo(int lexState) 896 { 897 if (lexState >= 2 || lexState < 0) 898 throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); 899 else 900 curLexState = lexState; 901 } 902 903 904/* Lexer state names. */ 905public static final String[] lexStateNames = { 906 "IN_REASON", 907 "DEFAULT", 908}; 909 910/* Lex State array. */ 911public static final int[] jjnewLexState = { 912 -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 913 -1, -1, 0, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 914 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 915}; 916static final long[] jjtoToken = { 917 0x1fffff3fc5L, 918}; 919static final long[] jjtoSkip = { 920 0x38L, 921}; 922static final long[] jjtoSpecial = { 923 0x0L, 924}; 925static final long[] jjtoMore = { 926 0x2L, 927}; 928 protected SimpleCharStream input_stream; 929 930 private final int[] jjrounds = new int[98]; 931 private final int[] jjstateSet = new int[2 * 98]; 932 private final StringBuilder jjimage = new StringBuilder(); 933 private StringBuilder image = jjimage; 934 private int jjimageLen; 935 private int lengthOfMatch; 936 protected int curChar; 937}