1 - /* FilterParserTokenManager.java */ 2 1 /* Generated By:JJTree&JavaCC: Do not edit this line. FilterParserTokenManager.java */ 3 2 package com.nccgroup.loggerplusplus.filter.parser; 4 - import com.nccgroup.loggerplusplus.filter.LogicalOperator; 5 - import com.nccgroup.loggerplusplus.filter.BooleanOperator; 6 - import com.nccgroup.loggerplusplus.filterlibrary.FilterLibraryController; 7 - import java.io.StringReader; 8 - import java.math.BigDecimal; 9 - import java.util.Arrays; 10 - import java.util.LinkedHashSet; 11 - import java.util.Set; 12 - import java.util.Date; 13 - import java.util.ArrayList; 14 - import java.util.regex.Pattern; 15 - import com.nccgroup.loggerplusplus.logentry.LogEntryField; 16 - import com.nccgroup.loggerplusplus.logentry.FieldGroup; 17 - import static com.nccgroup.loggerplusplus.logentry.LogEntryField.getFieldsInGroup; 18 - import com.nccgroup.loggerplusplus.logview.processor.LogProcessor; 19 3 20 - /** Token Manager. */ 4 + /** 5 + * Token Manager. 6 + */ 21 7 public class FilterParserTokenManager implements FilterParserConstants { 22 8 23 - /** Debug output. */ 24 - public java.io.PrintStream debugStream = System.out; 25 - /** Set debug output. */ 26 - public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } 27 - private int jjStopAtPos(int pos, int kind) 28 - { 29 - jjmatchedKind = kind; 30 - jjmatchedPos = pos; 31 - return pos + 1; 32 - } 33 - private int jjMoveStringLiteralDfa0_0(){ 34 - switch(curChar) 35 - { 36 - case 32: 37 - jjmatchedKind = 1; 38 - return jjMoveNfa_0(0, 0); 39 - case 33 : 40 - return jjMoveStringLiteralDfa1_0(0x8L); 41 - case 34: 42 - jjmatchedKind = 29; 43 - return jjMoveNfa_0(0, 0); 9 + /** Debug output. */ 10 + public java.io.PrintStream debugStream = System.out; 11 + 12 + /** Set debug output. */ 13 + public void setDebugStream(java.io.PrintStream ds) { 14 + debugStream = ds; 15 + } 16 + 17 + private int jjStopAtPos(int pos, int kind) { 18 + jjmatchedKind = kind; 19 + jjmatchedPos = pos; 20 + return pos + 1; 21 + } 22 + 23 + private int jjMoveStringLiteralDfa0_0() { 24 + switch (curChar) { 25 + case 32 : 26 + jjmatchedKind = 1; 27 + return jjMoveNfa_0(0, 0); 28 + case 33: 29 + return jjMoveStringLiteralDfa1_0(0x8L); 30 + case 34: 31 + jjmatchedKind = 29; 32 + return jjMoveNfa_0(0, 0); 44 33 case 35: 45 34 jjmatchedKind = 27; 46 35 return jjMoveNfa_0(0, 0); skipped 30 lines 77 66 case 93: 78 67 jjmatchedKind = 25; 79 68 return jjMoveNfa_0(0, 0); 80 - case 99: 81 - return jjMoveStringLiteralDfa1_0(0x800L); 82 - case 105: 83 - return jjMoveStringLiteralDfa1_0(0x1000L); 84 - case 109: 85 - return jjMoveStringLiteralDfa1_0(0x40000L); 86 - default : 87 - return jjMoveNfa_0(0, 0); 88 - } 89 - } 90 - private int jjMoveStringLiteralDfa1_0(long active0){ 91 - try { curChar = input_stream.readChar(); } 92 - catch(java.io.IOException e) { 93 - return jjMoveNfa_0(0, 0); 69 + case 99: 70 + return jjMoveStringLiteralDfa1_0(0x800L); 71 + case 105: 72 + return jjMoveStringLiteralDfa1_0(0x1000L); 73 + case 109: 74 + return jjMoveStringLiteralDfa1_0(0x40000L); 75 + default: 76 + return jjMoveNfa_0(0, 0); 77 + }94 78 } 95 - switch(curChar) 96 - { 97 - case 61: 98 - if ((active0 & 0x8L) != 0L) 99 - { 100 - jjmatchedKind = 3; 79 + 80 + private int jjMoveStringLiteralDfa1_0(long active0) { 81 + try { 82 + curChar = input_stream.readChar(); 83 + } catch (java.io.IOException e) { 84 + return jjMoveNfa_0(0, 0); 85 + } 86 + switch (curChar) { 87 + case 61: 88 + if ((active0 & 0x8L) != 0L) { 89 + jjmatchedKind = 3; 101 90 jjmatchedPos = 1; 102 91 } 103 92 else if ((active0 & 0x40L) != 0L) skipped 27 lines 131 120 jjmatchedPos = 1; 132 121 } 133 122 break; 134 - case 111: 135 - return jjMoveStringLiteralDfa2_0(active0, 0x800L); 136 - default : 137 - break; 138 - } 139 - return jjMoveNfa_0(0, 1); 140 - } 141 - private int jjMoveStringLiteralDfa2_0(long old0, long active0){ 142 - if (((active0 &= old0)) == 0L) 123 + case 111: 124 + return jjMoveStringLiteralDfa2_0(active0, 0x800L); 125 + default: 126 + break; 127 + }143 128 return jjMoveNfa_0(0, 1); 144 - try { curChar = input_stream.readChar(); } 145 - catch(java.io.IOException e) { 146 - return jjMoveNfa_0(0, 1); 147 129 } 148 - switch(curChar) 149 - { 150 - case 78: 151 - return jjMoveStringLiteralDfa3_0(active0, 0x800L); 130 + 131 + private int jjMoveStringLiteralDfa2_0(long old0, long active0) { 132 + if (((active0 &= old0)) == 0L) 133 + return jjMoveNfa_0(0, 1); 134 + try { 135 + curChar = input_stream.readChar(); 136 + } catch (java.io.IOException e) { 137 + return jjMoveNfa_0(0, 1); 138 + } 139 + switch (curChar) { 140 + case 78: 141 + return jjMoveStringLiteralDfa3_0(active0, 0x800L); 152 142 case 84: 153 143 return jjMoveStringLiteralDfa3_0(active0, 0x40000L); 154 - case 110: 155 - return jjMoveStringLiteralDfa3_0(active0, 0x800L); 156 - case 116: 157 - return jjMoveStringLiteralDfa3_0(active0, 0x40000L); 158 - default : 159 - break; 160 - } 161 - return jjMoveNfa_0(0, 2); 162 - } 163 - private int jjMoveStringLiteralDfa3_0(long old0, long active0){ 164 - if (((active0 &= old0)) == 0L) 144 + case 110: 145 + return jjMoveStringLiteralDfa3_0(active0, 0x800L); 146 + case 116: 147 + return jjMoveStringLiteralDfa3_0(active0, 0x40000L); 148 + default: 149 + break; 150 + }165 151 return jjMoveNfa_0(0, 2); 166 - try { curChar = input_stream.readChar(); } 167 - catch(java.io.IOException e) { 168 - return jjMoveNfa_0(0, 2); 169 152 } 170 - switch(curChar) 171 - { 172 - case 67: 173 - return jjMoveStringLiteralDfa4_0(active0, 0x40000L); 153 + 154 + private int jjMoveStringLiteralDfa3_0(long old0, long active0) { 155 + if (((active0 &= old0)) == 0L) 156 + return jjMoveNfa_0(0, 2); 157 + try { 158 + curChar = input_stream.readChar(); 159 + } catch (java.io.IOException e) { 160 + return jjMoveNfa_0(0, 2); 161 + } 162 + switch (curChar) { 163 + case 67: 164 + return jjMoveStringLiteralDfa4_0(active0, 0x40000L); 174 165 case 84: 175 166 return jjMoveStringLiteralDfa4_0(active0, 0x800L); 176 - case 99: 177 - return jjMoveStringLiteralDfa4_0(active0, 0x40000L); 178 - case 116: 179 - return jjMoveStringLiteralDfa4_0(active0, 0x800L); 180 - default : 181 - break; 182 - } 183 - return jjMoveNfa_0(0, 3); 184 - } 185 - private int jjMoveStringLiteralDfa4_0(long old0, long active0){ 186 - if (((active0 &= old0)) == 0L) 167 + case 99: 168 + return jjMoveStringLiteralDfa4_0(active0, 0x40000L); 169 + case 116: 170 + return jjMoveStringLiteralDfa4_0(active0, 0x800L); 171 + default: 172 + break; 173 + }187 174 return jjMoveNfa_0(0, 3); 188 - try { curChar = input_stream.readChar(); } 189 - catch(java.io.IOException e) { 190 - return jjMoveNfa_0(0, 3); 191 175 } 192 - switch(curChar) 193 - { 194 - case 65: 195 - return jjMoveStringLiteralDfa5_0(active0, 0x800L); 176 + 177 + private int jjMoveStringLiteralDfa4_0(long old0, long active0) { 178 + if (((active0 &= old0)) == 0L) 179 + return jjMoveNfa_0(0, 3); 180 + try { 181 + curChar = input_stream.readChar(); 182 + } catch (java.io.IOException e) { 183 + return jjMoveNfa_0(0, 3); 184 + } 185 + switch (curChar) { 186 + case 65: 187 + return jjMoveStringLiteralDfa5_0(active0, 0x800L); 196 188 case 72: 197 189 return jjMoveStringLiteralDfa5_0(active0, 0x40000L); 198 - case 97: 199 - return jjMoveStringLiteralDfa5_0(active0, 0x800L); 200 - case 104: 201 - return jjMoveStringLiteralDfa5_0(active0, 0x40000L); 202 - default : 203 - break; 204 - } 205 - return jjMoveNfa_0(0, 4); 206 - } 207 - private int jjMoveStringLiteralDfa5_0(long old0, long active0){ 208 - if (((active0 &= old0)) == 0L) 190 + case 97: 191 + return jjMoveStringLiteralDfa5_0(active0, 0x800L); 192 + case 104: 193 + return jjMoveStringLiteralDfa5_0(active0, 0x40000L); 194 + default: 195 + break; 196 + }209 197 return jjMoveNfa_0(0, 4); 210 - try { curChar = input_stream.readChar(); } 211 - catch(java.io.IOException e) { 212 - return jjMoveNfa_0(0, 4); 213 198 } 214 - switch(curChar) 215 - { 216 - case 69: 217 - return jjMoveStringLiteralDfa6_0(active0, 0x40000L); 199 + 200 + private int jjMoveStringLiteralDfa5_0(long old0, long active0) { 201 + if (((active0 &= old0)) == 0L) 202 + return jjMoveNfa_0(0, 4); 203 + try { 204 + curChar = input_stream.readChar(); 205 + } catch (java.io.IOException e) { 206 + return jjMoveNfa_0(0, 4); 207 + } 208 + switch (curChar) { 209 + case 69: 210 + return jjMoveStringLiteralDfa6_0(active0, 0x40000L); 218 211 case 73: 219 212 return jjMoveStringLiteralDfa6_0(active0, 0x800L); 220 - case 101: 221 - return jjMoveStringLiteralDfa6_0(active0, 0x40000L); 222 - case 105: 223 - return jjMoveStringLiteralDfa6_0(active0, 0x800L); 224 - default : 225 - break; 226 - } 227 - return jjMoveNfa_0(0, 5); 228 - } 229 - private int jjMoveStringLiteralDfa6_0(long old0, long active0){ 230 - if (((active0 &= old0)) == 0L) 213 + case 101: 214 + return jjMoveStringLiteralDfa6_0(active0, 0x40000L); 215 + case 105: 216 + return jjMoveStringLiteralDfa6_0(active0, 0x800L); 217 + default: 218 + break; 219 + }231 220 return jjMoveNfa_0(0, 5); 232 - try { curChar = input_stream.readChar(); } 233 - catch(java.io.IOException e) { 234 - return jjMoveNfa_0(0, 5); 235 221 } 236 - switch(curChar) 237 - { 238 - case 78: 239 - return jjMoveStringLiteralDfa7_0(active0, 0x800L); 222 + 223 + private int jjMoveStringLiteralDfa6_0(long old0, long active0) { 224 + if (((active0 &= old0)) == 0L) 225 + return jjMoveNfa_0(0, 5); 226 + try { 227 + curChar = input_stream.readChar(); 228 + } catch (java.io.IOException e) { 229 + return jjMoveNfa_0(0, 5); 230 + } 231 + switch (curChar) { 232 + case 78: 233 + return jjMoveStringLiteralDfa7_0(active0, 0x800L); 240 234 case 83: 241 235 if ((active0 & 0x40000L) != 0L) 242 236 { skipped 4 lines 247 241 case 110: 248 242 return jjMoveStringLiteralDfa7_0(active0, 0x800L); 249 243 case 115: 250 - if ((active0 & 0x40000L) != 0L) 251 - { 244 + if ((active0 & 0x40000L) != 0L) { 252 245 jjmatchedKind = 18; 253 246 jjmatchedPos = 6; 254 247 } 255 248 break; 256 - default : 257 - break; 258 - } 259 - return jjMoveNfa_0(0, 6); 260 - } 261 - private int jjMoveStringLiteralDfa7_0(long old0, long active0){ 262 - if (((active0 &= old0)) == 0L) 249 + default: 250 + break; 251 + }263 252 return jjMoveNfa_0(0, 6); 264 - try { curChar = input_stream.readChar(); } 265 - catch(java.io.IOException e) { 266 - return jjMoveNfa_0(0, 6); 267 253 } 268 - switch(curChar) 269 - { 270 - case 83: 271 - if ((active0 & 0x800L) != 0L) 254 + 255 + private int jjMoveStringLiteralDfa7_0(long old0, long active0) { 256 + if (((active0 &= old0)) == 0L) 257 + return jjMoveNfa_0(0, 6); 258 + try { 259 + curChar = input_stream.readChar(); 260 + } catch (java.io.IOException e) { 261 + return jjMoveNfa_0(0, 6); 262 + } 263 + switch (curChar) { 264 + case 83: 265 + if ((active0 & 0x800L) != 0L) 272 266 { 273 267 jjmatchedKind = 11; 274 268 jjmatchedPos = 7; skipped 47 lines 322 316 { 323 317 if (kind > 14) 324 318 kind = 14; 325 - { jjCheckNAddTwoStates(27, 28); } 319 + jjCheckNAddTwoStates(27, 28); 326 320 } 327 321 else if ((0x280000000000L & l) != 0L) 328 - { jjCheckNAdd(27); } 322 + jjCheckNAdd(27); 329 323 else if (curChar == 33) 330 324 { 331 325 if (kind > 21) 332 326 kind = 21; 333 327 } 334 328 else if (curChar == 47) 335 - { jjCheckNAddTwoStates(40, 42); } 329 + jjCheckNAddTwoStates(40, 42); 336 330 else if (curChar == 38) 337 331 jjstateSet[jjnewStateCnt++] = 9; 338 332 else if (curChar == 61) skipped 2 lines 341 335 { 342 336 if (kind > 23) 343 337 kind = 23; 344 - { jjCheckNAdd(48); } 338 + jjCheckNAdd(48); 345 339 } 346 340 else if (curChar == 47) 347 341 jjstateSet[jjnewStateCnt++] = 37; skipped 27 lines 375 369 break; 376 370 case 26: 377 371 if ((0x280000000000L & l) != 0L) 378 - { jjCheckNAdd(27); } 372 + jjCheckNAdd(27); 379 373 break; 380 374 case 27: 381 375 if ((0x3ff000000000000L & l) == 0L) 382 376 break; 383 377 if (kind > 14) 384 378 kind = 14; 385 - { jjCheckNAddTwoStates(27, 28); } 379 + jjCheckNAddTwoStates(27, 28); 386 380 break; 387 381 case 28: 388 382 if (curChar == 46) 389 - { jjCheckNAdd(29); } 383 + jjCheckNAdd(29); 390 384 break; 391 385 case 29: 392 386 if ((0x3ff000000000000L & l) == 0L) 393 387 break; 394 388 if (kind > 14) 395 389 kind = 14; 396 - { jjCheckNAdd(29); } 390 + jjCheckNAdd(29); 397 391 break; 398 392 case 32: 399 393 case 33: 400 - { jjCheckNAddStates(0, 2); } 394 + jjCheckNAddStates(0, 2); 401 395 break; 402 396 case 34: 403 397 if (curChar == 47 && kind > 16) skipped 5 lines 409 403 break; 410 404 case 39: 411 405 if (curChar == 47) 412 - { jjCheckNAddTwoStates(40, 42); } 406 + jjCheckNAddTwoStates(40, 42); 413 407 break; 414 408 case 41: 415 - { jjCheckNAddStates(3, 5); } 409 + jjCheckNAddStates(3, 5); 416 410 break; 417 411 case 42: 418 412 if ((0xffff7fffffffffffL & l) != 0L) 419 - { jjCheckNAddStates(3, 5); } 413 + jjCheckNAddStates(3, 5); 420 414 break; 421 415 case 43: 422 416 if (curChar == 47 && kind > 17) skipped 8 lines 431 425 break; 432 426 if (kind > 23) 433 427 kind = 23; 434 - { jjCheckNAdd(48); } 428 + jjCheckNAdd(48); 435 429 break; 436 430 default : break; 437 431 } skipped 11 lines 449 443 { 450 444 if (kind > 23) 451 445 kind = 23; 452 - { jjCheckNAdd(48); } 446 + jjCheckNAdd(48); 453 447 } 454 448 else if (curChar == 94) 455 449 { skipped 71 lines 527 521 break; 528 522 case 19: 529 523 if ((0x20000000200000L & l) != 0L) 530 - { jjCheckNAdd(18); } 524 + jjCheckNAdd(18); 531 525 break; 532 526 case 20: 533 527 if ((0x4000000040000L & l) != 0L) skipped 5 lines 539 533 break; 540 534 case 22: 541 535 if ((0x8000000080000L & l) != 0L) 542 - { jjCheckNAdd(18); } 536 + jjCheckNAdd(18); 543 537 break; 544 538 case 23: 545 539 if ((0x100000001000L & l) != 0L) skipped 9 lines 555 549 break; 556 550 case 30: 557 551 if ((0x2000000020000L & l) != 0L) 558 - { jjCheckNAddStates(0, 2); } 552 + jjCheckNAddStates(0, 2); 559 553 break; 560 554 case 31: 561 555 if (curChar == 92) skipped 1 lines 563 557 break; 564 558 case 32: 565 559 if ((0xffffffdfffffffdfL & l) != 0L) 566 - { jjCheckNAddStates(0, 2); } 560 + jjCheckNAddStates(0, 2); 567 561 break; 568 562 case 33: 569 563 if ((0xffffffffefffffffL & l) != 0L) 570 - { jjCheckNAddStates(0, 2); } 564 + jjCheckNAddStates(0, 2); 571 565 break; 572 566 case 35: 573 567 if ((0x2000000020L & l) != 0L) skipped 12 lines 586 580 jjstateSet[jjnewStateCnt++] = 41; 587 581 break; 588 582 case 41: 589 - { jjCheckNAddStates(3, 5); } 583 + jjCheckNAddStates(3, 5); 590 584 break; 591 585 case 42: 592 586 if ((0xffffffffefffffffL & l) != 0L) 593 - { jjCheckNAddStates(3, 5); } 587 + jjCheckNAddStates(3, 5); 594 588 break; 595 589 case 45: 596 590 if ((0x10000000100000L & l) != 0L && kind > 21) skipped 12 lines 609 603 break; 610 604 if (kind > 23) 611 605 kind = 23; 612 - { jjCheckNAdd(48); } 606 + jjCheckNAdd(48); 613 607 break; 614 608 default : break; 615 609 } skipped 1 lines 617 611 } 618 612 else 619 613 { 620 - int hiByte = (curChar >> 8); 614 + int hiByte = (int ) ( curChar >> 8); 621 615 int i1 = hiByte >> 6; 622 616 long l1 = 1L << (hiByte & 077); 623 617 int i2 = (curChar & 0xff) >> 6; 624 618 long l2 = 1L << (curChar & 077); 625 619 do 626 620 { 627 - switch(jjstateSet[--i]) 628 - { 621 + switch(jjstateSet[--i]) { 629 622 case 32: 630 623 case 33: 631 624 if (jjCanMove_0(hiByte, i1, i2, l1, l2)) 632 - { jjCheckNAddStates(0, 2); } 625 + jjCheckNAddStates(0, 2); 633 626 break; 634 627 case 41: 635 628 case 42: 636 629 if (jjCanMove_0(hiByte, i1, i2, l1, l2)) 637 - { jjCheckNAddStates(3, 5); } 630 + jjCheckNAddStates(3, 5); 638 631 break; 639 - default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; 632 + default: 633 + break; 640 634 } 641 635 } while(i != startsAt); 642 636 } skipped 17 lines 660 654 if (curPos < toRet) 661 655 for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; ) 662 656 try { curChar = input_stream.readChar(); } 663 - catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); } 657 + catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); 658 + } 664 659 665 - if (jjmatchedPos < strPos) 666 - { 660 + if (jjmatchedPos < strPos) { 667 661 jjmatchedKind = strKind; 668 662 jjmatchedPos = strPos; 669 - } 670 - else if (jjmatchedPos == strPos && jjmatchedKind > strKind) 663 + } else if (jjmatchedPos == strPos && jjmatchedKind > strKind) 671 664 jjmatchedKind = strKind; 672 665 673 666 return toRet; 674 667 } 675 - private final int jjStopStringLiteralDfa_1(int pos, long active0){ 676 - switch (pos) 677 - { 678 - default : 679 - return -1; 668 + 669 + private final int jjStopStringLiteralDfa_1(int pos, long active0) { 670 + switch (pos) { 671 + default: 672 + return -1; 673 + } 674 + } 675 + 676 + private final int jjStartNfa_1(int pos, long active0) { 677 + return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1); 680 678 } 681 - } 682 - private final int jjStartNfa_1(int pos, long active0){ 683 - return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1); 684 - } 685 - private int jjMoveStringLiteralDfa0_1(){ 686 - switch(curChar) 687 - { 688 - case 39: 689 - return jjStopAtPos(0, 31); 690 - default : 691 - return jjMoveNfa_1(3, 0); 679 + 680 + private int jjMoveStringLiteralDfa0_1() { 681 + switch (curChar) { 682 + case 39: 683 + return jjStopAtPos(0, 31); 684 + default: 685 + return jjMoveNfa_1(3, 0); 686 + } 692 687 } 693 - } 694 - private int jjMoveNfa_1(int startState, int curPos) 688 + 689 + private int jjMoveNfa_1(int startState, int curPos)695 690 { 696 691 int startsAt = 0; 697 692 jjnewStateCnt = 3; skipped 17 lines 715 710 break; 716 711 if (kind > 30) 717 712 kind = 30; 718 - { jjCheckNAddTwoStates(0, 2); } 713 + jjCheckNAddTwoStates(0, 2); 719 714 break; 720 715 case 1: 721 716 if (kind > 30) 722 717 kind = 30; 723 - { jjCheckNAddTwoStates(0, 2); } 718 + jjCheckNAddTwoStates(0, 2); 724 719 break; 725 720 default : break; 726 721 } skipped 11 lines 738 733 { 739 734 if (kind > 30) 740 735 kind = 30; 741 - { jjCheckNAddTwoStates(0, 2); } 736 + jjCheckNAddTwoStates(0, 2); 742 737 } 743 738 else if (curChar == 92) 744 739 jjstateSet[jjnewStateCnt++] = 1; skipped 5 lines 750 745 case 1: 751 746 if (kind > 30) 752 747 kind = 30; 753 - { jjCheckNAddTwoStates(0, 2); } 748 + jjCheckNAddTwoStates(0, 2); 754 749 break; 755 750 case 2: 756 751 if ((0xffffffffefffffffL & l) == 0L) 757 752 break; 758 753 if (kind > 30) 759 754 kind = 30; 760 - { jjCheckNAddTwoStates(0, 2); } 755 + jjCheckNAddTwoStates(0, 2); 761 756 break; 762 757 default : break; 763 758 } skipped 1 lines 765 760 } 766 761 else 767 762 { 768 - int hiByte = (curChar >> 8); 763 + int hiByte = (int ) ( curChar >> 8); 769 764 int i1 = hiByte >> 6; 770 765 long l1 = 1L << (hiByte & 077); 771 766 int i2 = (curChar & 0xff) >> 6; 772 767 long l2 = 1L << (curChar & 077); 773 768 do 774 769 { 775 - switch(jjstateSet[--i]) 776 - { 770 + switch(jjstateSet[--i]) { 777 771 case 3: 778 772 case 2: 779 773 case 1: skipped 1 lines 781 775 break; 782 776 if (kind > 30) 783 777 kind = 30; 784 - { jjCheckNAddTwoStates(0, 2); } 778 + jjCheckNAddTwoStates(0, 2); 779 + break; 780 + default: 785 781 break; 786 - default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; 787 782 } 788 783 } while(i != startsAt); 789 784 } skipped 6 lines 796 791 ++curPos; 797 792 if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) 798 793 return curPos; 799 - try { curChar = input_stream.readChar(); } 800 - catch(java.io.IOException e) { return curPos; } 794 + try { 795 + curChar = input_stream.readChar(); 796 + } catch (java.io.IOException e) { 797 + return curPos; 798 + } 801 799 } 802 800 } 803 - private final int jjStopStringLiteralDfa_2(int pos, long active0){ 804 - switch (pos) 805 - { 806 - default : 807 - return -1; 801 + 802 + private final int jjStopStringLiteralDfa_2(int pos, long active0) { 803 + switch (pos) { 804 + default: 805 + return -1; 806 + } 808 807 } 809 - } 810 - private final int jjStartNfa_2(int pos, long active0){ 811 - return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1); 812 - } 813 - private int jjMoveStringLiteralDfa0_2(){ 814 - switch(curChar) 815 - { 816 - case 34: 817 - return jjStopAtPos(0, 33); 818 - default : 819 - return jjMoveNfa_2(3, 0); 808 + 809 + private final int jjStartNfa_2(int pos, long active0) { 810 + return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0), pos + 1);820 811 } 821 - } 822 - private int jjMoveNfa_2(int startState, int curPos) 812 + 813 + private int jjMoveStringLiteralDfa0_2() { 814 + switch (curChar) { 815 + case 34: 816 + return jjStopAtPos(0, 33); 817 + default: 818 + return jjMoveNfa_2(3, 0); 819 + } 820 + } 821 + 822 + private int jjMoveNfa_2(int startState, int curPos) 823 823 { 824 824 int startsAt = 0; 825 825 jjnewStateCnt = 3; 826 826 int i = 1; 827 827 jjstateSet[0] = startState; 828 828 int kind = 0x7fffffff; 829 - for (;;) 830 - { 829 + for (;;) { 831 830 if (++jjround == 0x7fffffff) 832 831 ReInitRounds(); 833 - if (curChar < 64) 834 - { 832 + if (curChar < 64) { 835 833 long l = 1L << curChar; 836 - do 837 - { 838 - switch(jjstateSet[--i]) 839 - { 834 + do { 835 + switch(jjstateSet[--i]) { 840 836 case 3: 841 837 case 2: 842 838 if ((0xfffffffbffffffffL & l) == 0L) 843 839 break; 844 840 if (kind > 32) 845 841 kind = 32; 846 - { jjCheckNAddTwoStates(0, 2); } 842 + jjCheckNAddTwoStates(0, 2); 847 843 break; 848 844 case 1: 849 845 if (kind > 32) 850 846 kind = 32; 851 - { jjCheckNAddTwoStates(0, 2); } 847 + jjCheckNAddTwoStates(0, 2); 852 848 break; 853 849 default : break; 854 850 } 855 851 } while(i != startsAt); 856 - } 857 - else if (curChar < 128) 858 - { 852 + } else if (curChar < 128) { 859 853 long l = 1L << (curChar & 077); 860 - do 861 - { 862 - switch(jjstateSet[--i]) 863 - { 854 + do { 855 + switch(jjstateSet[--i]) { 864 856 case 3: 865 - if ((0xffffffffefffffffL & l) != 0L) 866 - { 857 + if ((0xffffffffefffffffL & l) != 0L) { 867 858 if (kind > 32) 868 859 kind = 32; 869 - { jjCheckNAddTwoStates(0, 2); } 870 - } 871 - else if (curChar == 92) 860 + jjCheckNAddTwoStates(0, 2); 861 + } else if (curChar == 92) 872 862 jjstateSet[jjnewStateCnt++] = 1; 873 863 break; 874 864 case 0: skipped 3 lines 878 868 case 1: 879 869 if (kind > 32) 880 870 kind = 32; 881 - { jjCheckNAddTwoStates(0, 2); } 871 + jjCheckNAddTwoStates(0, 2); 882 872 break; 883 873 case 2: 884 874 if ((0xffffffffefffffffL & l) == 0L) 885 875 break; 886 876 if (kind > 32) 887 877 kind = 32; 888 - { jjCheckNAddTwoStates(0, 2); } 878 + jjCheckNAddTwoStates(0, 2); 889 879 break; 890 880 default : break; 891 881 } 892 882 } while(i != startsAt); 893 - } 894 - else 895 - { 896 - int hiByte = (curChar >> 8); 883 + } else { 884 + int hiByte = (int) (curChar >> 8); 897 885 int i1 = hiByte >> 6; 898 886 long l1 = 1L << (hiByte & 077); 899 887 int i2 = (curChar & 0xff) >> 6; 900 888 long l2 = 1L << (curChar & 077); 901 - do 902 - { 903 - switch(jjstateSet[--i]) 904 - { 889 + do { 890 + switch(jjstateSet[--i]) { 905 891 case 3: 906 892 case 2: 907 893 case 1: skipped 1 lines 909 895 break; 910 896 if (kind > 32) 911 897 kind = 32; 912 - { jjCheckNAddTwoStates(0, 2); } 898 + jjCheckNAddTwoStates(0, 2); 913 899 break; 914 - default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; 900 + default: 901 + break; 915 902 } 916 903 } while(i != startsAt); 917 904 } 918 - if (kind != 0x7fffffff) 919 - { 905 + if (kind != 0x7fffffff) { 920 906 jjmatchedKind = kind; 921 907 jjmatchedPos = curPos; 922 908 kind = 0x7fffffff; skipped 1 lines 924 910 ++curPos; 925 911 if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt))) 926 912 return curPos; 927 - try { curChar = input_stream.readChar(); } 928 - catch(java.io.IOException e) { return curPos; } 913 + try { 914 + curChar = input_stream.readChar(); 915 + } catch (java.io.IOException e) { 916 + return curPos; 917 + } 929 918 } 930 919 } 931 920 932 - /** Token literal values. */ 933 - public static final String[] jjstrLiteralImages = { 934 - "", null, null, "\41\75", "\76", "\74", "\76\75", "\74\75", null, null, null, 935 - null, null, null, null, null, null, null, null, "\50", "\51", null, "\56", null, 936 - "\133", "\135", "\54", "\43", "\47", "\42", null, "\47", null, "\42", null, }; 937 - protected Token jjFillToken() 938 - { 939 - final Token t; 940 - final String curTokenImage; 941 - final int beginLine; 942 - final int endLine; 943 - final int beginColumn; 944 - final int endColumn; 945 - String im = jjstrLiteralImages[jjmatchedKind]; 921 + static final int[] jjnextStates = { 922 + 31, 33, 36, 40, 42, 43, 923 + }; 924 + 925 + private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { 926 + switch (hiByte) { 927 + case 0: 928 + return ((jjbitVec2[i2] & l2) != 0L); 929 + default: 930 + if ((jjbitVec0[i1] & l1) != 0L) 931 + return true; 932 + return false; 933 + } 934 + } 935 + 936 + /** 937 + * Token literal values. 938 + */ 939 + public static final String[] jjstrLiteralImages = { 940 + "", null, null, "\41\75", "\76", "\74", "\76\75", "\74\75", null, null, null, 941 + null, null, null, null, null, null, null, null, "\50", "\51", null, "\56", null, 942 + "\133", "\135", "\54", "\43", "\47", "\42", null, "\47", null, "\42", null,}; 943 + 944 + /** 945 + * Lexer state names. 946 + */ 947 + public static final String[] lexStateNames = { 948 + "DEFAULT", 949 + "SINGLE_QUOTED_STRING", 950 + "DOUBLE_QUOTED_STRING", 951 + }; 952 + 953 + /** 954 + * Lex State array. 955 + */ 956 + public static final int[] jjnewLexState = { 957 + -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, 958 + -1, -1, -1, 1, 2, -1, 0, -1, 0, -1, 959 + }; 960 + static final long[] jjtoToken = { 961 + 0x7fffffffdL, 962 + }; 963 + static final long[] jjtoSkip = { 964 + 0x2L, 965 + }; 966 + protected SimpleCharStream input_stream; 967 + private final int[] jjrounds = new int[49]; 968 + private final int[] jjstateSet = new int[98]; 969 + protected char curChar; 970 + 971 + /** 972 + * Constructor. 973 + */ 974 + public FilterParserTokenManager(SimpleCharStream stream) { 975 + if (SimpleCharStream.staticFlag) 976 + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); 977 + input_stream = stream; 978 + } 979 + 980 + /** 981 + * Constructor. 982 + */ 983 + public FilterParserTokenManager(SimpleCharStream stream, int lexState) { 984 + this(stream); 985 + SwitchTo(lexState); 986 + } 987 + 988 + /** 989 + * Reinitialise parser. 990 + */ 991 + public void ReInit(SimpleCharStream stream) { 992 + jjmatchedPos = jjnewStateCnt = 0; 993 + curLexState = defaultLexState; 994 + input_stream = stream; 995 + ReInitRounds(); 996 + } 997 + 998 + private void ReInitRounds() { 999 + int i; 1000 + jjround = 0x80000001; 1001 + for (i = 49; i-- > 0; ) 1002 + jjrounds[i] = 0x80000000; 1003 + } 1004 + 1005 + /** 1006 + * Reinitialise parser. 1007 + */ 1008 + public void ReInit(SimpleCharStream stream, int lexState) { 1009 + ReInit(stream); 1010 + SwitchTo(lexState); 1011 + } 1012 + 1013 + /** 1014 + * Switch to specified lex state. 1015 + */ 1016 + public void SwitchTo(int lexState) { 1017 + if (lexState >= 3 || lexState < 0) 1018 + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); 1019 + else 1020 + curLexState = lexState; 1021 + } 1022 + 1023 + protected Token jjFillToken() { 1024 + final Token t; 1025 + final String curTokenImage; 1026 + final int beginLine; 1027 + final int endLine; 1028 + final int beginColumn; 1029 + final int endColumn; 1030 + String im = jjstrLiteralImages[jjmatchedKind]; 946 1031 curTokenImage = (im == null) ? input_stream.GetImage() : im; 947 1032 beginLine = input_stream.getBeginLine(); 948 1033 beginColumn = input_stream.getBeginColumn(); skipped 8 lines 957 1042 958 1043 return t; 959 1044 } 960 - static final int[] jjnextStates = { 961 - 31, 33, 36, 40, 42, 43, 962 - }; 963 - private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) 964 - { 965 - switch(hiByte) 966 - { 967 - case 0: 968 - return ((jjbitVec2[i2] & l2) != 0L); 969 - default : 970 - if ((jjbitVec0[i1] & l1) != 0L) 971 - return true; 972 - return false; 973 - } 974 - } 975 1045 976 1046 int curLexState = 0; 977 1047 int defaultLexState = 0; skipped 8 lines 986 1056 Token matchedToken; 987 1057 int curPos = 0; 988 1058 989 - EOFLoop : 990 - for (;;) 991 - { 992 - try 993 - { 994 - curChar = input_stream.BeginToken(); 995 - } 996 - catch(Exception e) 1059 + EOFLoop: 1060 + for (; ; ) { 1061 + try { 1062 + curChar = input_stream.BeginToken(); 1063 + } catch (java.io.IOException e) 997 1064 { 998 1065 jjmatchedKind = 0; 999 - jjmatchedPos = -1; 1000 1066 matchedToken = jjFillToken(); 1001 1067 return matchedToken; 1002 1068 } skipped 69 lines 1072 1138 } 1073 1139 } 1074 1140 1075 - void SkipLexicalActions(Token matchedToken) 1076 - { 1077 - switch(jjmatchedKind) 1078 - { 1079 - default : 1080 - break; 1081 - } 1082 - } 1083 - void MoreLexicalActions() 1084 - { 1085 - jjimageLen += (lengthOfMatch = jjmatchedPos + 1); 1086 - switch(jjmatchedKind) 1087 - { 1088 - default : 1089 - break; 1090 - } 1091 - } 1092 - void TokenLexicalActions(Token matchedToken) 1093 - { 1094 - switch(jjmatchedKind) 1095 - { 1096 - default : 1097 - break; 1098 - } 1099 - } 1100 1141 private void jjCheckNAdd(int state) 1101 1142 { 1102 1143 if (jjrounds[state] != jjround) skipped 21 lines 1124 1165 } while (start++ != end); 1125 1166 } 1126 1167 1127 - /** Constructor. */ 1128 - public FilterParserTokenManager(SimpleCharStream stream){ 1129 - 1130 - if (SimpleCharStream.staticFlag) 1131 - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); 1132 - 1133 - input_stream = stream; 1134 - } 1135 - 1136 - /** Constructor. */ 1137 - public FilterParserTokenManager (SimpleCharStream stream, int lexState){ 1138 - ReInit(stream); 1139 - SwitchTo(lexState); 1140 - } 1141 - 1142 - /** Reinitialise parser. */ 1143 - 1144 - public void ReInit(SimpleCharStream stream) 1145 - { 1146 - 1147 - 1148 - jjmatchedPos = 1149 - jjnewStateCnt = 1150 - 0; 1151 - curLexState = defaultLexState; 1152 - input_stream = stream; 1153 - ReInitRounds(); 1154 - } 1155 - 1156 - private void ReInitRounds() 1157 - { 1158 - int i; 1159 - jjround = 0x80000001; 1160 - for (i = 49; i-- > 0;) 1161 - jjrounds[i] = 0x80000000; 1162 - } 1163 - 1164 - /** Reinitialise parser. */ 1165 - public void ReInit(SimpleCharStream stream, int lexState) 1166 - 1167 - { 1168 - ReInit(stream); 1169 - SwitchTo(lexState); 1170 - } 1171 - 1172 - /** Switch to specified lex state. */ 1173 - public void SwitchTo(int lexState) 1174 - { 1175 - if (lexState >= 3 || lexState < 0) 1176 - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); 1177 - else 1178 - curLexState = lexState; 1179 - } 1180 - 1181 - 1182 - /** Lexer state names. */ 1183 - public static final String[] lexStateNames = { 1184 - "DEFAULT", 1185 - "SINGLE_QUOTED_STRING", 1186 - "DOUBLE_QUOTED_STRING", 1187 - }; 1188 - 1189 - /** Lex State array. */ 1190 - public static final int[] jjnewLexState = { 1191 - -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, 1192 - -1, -1, -1, 1, 2, -1, 0, -1, 0, -1, 1193 - }; 1194 - static final long[] jjtoToken = { 1195 - 0x7fffffffdL, 1196 - }; 1197 - static final long[] jjtoSkip = { 1198 - 0x2L, 1199 - }; 1200 - static final long[] jjtoSpecial = { 1201 - 0x0L, 1202 - }; 1203 - static final long[] jjtoMore = { 1204 - 0x0L, 1205 - }; 1206 - protected SimpleCharStream input_stream; 1207 - 1208 - private final int[] jjrounds = new int[49]; 1209 - private final int[] jjstateSet = new int[2 * 49]; 1210 - private final StringBuilder jjimage = new StringBuilder(); 1211 - private StringBuilder image = jjimage; 1212 - private int jjimageLen; 1213 - private int lengthOfMatch; 1214 - protected int curChar; 1215 1168 } 1216 1169