1 19 20 package org.netbeans.modules.web.core.syntax.deprecated; 21 22 import org.netbeans.modules.web.core.syntax.*; 23 import org.netbeans.editor.Syntax; 24 import org.netbeans.editor.TokenID; 25 26 33 34 public class ELSyntax extends Syntax { 35 36 42 43 private static final int ISI_IDENTIFIER = 2; 44 private static final int ISI_CHAR = 3; private static final int ISI_CHAR_A_BSLASH = 4; private static final int ISI_STRING = 5; private static final int ISI_STRING_A_BSLASH = 6; private static final int ISI_CHAR_STRING = 7; private static final int ISI_CHAR_STRING_A_BSLASH = 8; private static final int ISA_ZERO = 9; private static final int ISI_INT = 10; private static final int ISI_OCTAL = 11; private static final int ISI_DOUBLE = 12; private static final int ISI_DOUBLE_EXP = 13; private static final int ISI_HEX = 14; private static final int ISA_DOT = 15; private static final int ISI_WHITESPACE = 16; private static final int ISA_EQ = 17; private static final int ISA_GT = 18; private static final int ISA_LT = 19; private static final int ISA_PIPE = 23; private static final int ISA_AND = 24; private static final int ISA_EXCLAMATION = 25; private static final int ISI_BRACKET = 26; private static final int ISI_BRACKET_A_WHITESPACE = 27; 69 private static final int ISI_BRACKET_A_IDENTIFIER = 28; 70 private static final int ISI_BRACKET_ISA_EQ = 29; 71 private static final int ISI_BRACKET_ISA_GT = 30; 72 private static final int ISI_BRACKET_ISA_LT =31; 73 private static final int ISI_BRACKET_ISA_PIPE = 32; private static final int ISI_BRACKET_ISA_AND = 33; private static final int ISI_BRACKET_ISA_ZERO = 34; private static final int ISI_BRACKET_ISA_DOT = 35; private static final int ISI_BRACKET_ISI_INT = 36; private static final int ISI_BRACKET_ISI_OCTAL = 37; private static final int ISI_BRACKET_ISI_DOUBLE = 38; private static final int ISI_BRACKET_ISI_DOUBLE_EXP = 39; private static final int ISI_BRACKET_ISI_HEX = 40; private static final int ISI_DOULE_EXP_ISA_SIGN = 41; 83 private static final int ISI_BRACKET_ISI_DOULE_EXP_ISA_SIGN = 42; 84 86 87 public ELSyntax() { 88 tokenContextPath = ELTokenContext.contextPath; 89 } 90 91 103 protected TokenID parseToken() { 104 while (offset < stopOffset) { 106 char ch = buffer[offset]; switch (state) { case INIT: 110 switch (ch) { 112 case '"': 113 state = ISI_STRING; 115 break; 116 case '\'': 117 state = ISI_CHAR; 119 break; 120 case '/': 121 offset++; 122 return ELTokenContext.DIV; 123 case '=': 124 state = ISA_EQ; 125 break; 126 case '>': 127 state = ISA_GT; 128 break; 129 case '<': 130 state = ISA_LT; 131 break; 132 case '+': 133 offset++; 134 return ELTokenContext.PLUS; 135 case '-': 136 offset++; 137 return ELTokenContext.MINUS; 138 case '*': 139 offset++; 140 return ELTokenContext.MUL; 141 case '|': 142 state = ISA_PIPE; 143 break; 144 case '&': 145 state = ISA_AND; 146 break; 147 case '[': 148 offset++; 150 return ELTokenContext.LBRACKET; 151 case ']': 153 offset++; 154 return ELTokenContext.RBRACKET; 155 case '%': 156 offset++; 157 return ELTokenContext.MOD; 158 case ':': 159 offset++; 162 return ELTokenContext.COLON; 163 case '!': 164 state = ISA_EXCLAMATION; 165 break; 166 case '(': 167 offset++; 168 return ELTokenContext.LPAREN; 169 case ')': 170 offset++; 171 return ELTokenContext.RPAREN; 172 case ',': 173 offset++; 174 return ELTokenContext.COMMA; 175 case '?': 176 offset++; 177 return ELTokenContext.QUESTION; 178 case '\n': 179 offset++; 180 return ELTokenContext.EOL; 182 case '0': 183 state = ISA_ZERO; 184 break; 185 case '.': 186 state = ISA_DOT; 187 break; 188 default: 189 if (Character.isWhitespace(ch)) { 191 state = ISI_WHITESPACE; 192 break; 193 } 194 195 if (Character.isJavaIdentifierStart(ch)){ 197 state = ISI_IDENTIFIER; 199 break; 200 } 201 if (Character.isDigit(ch)) { 203 state = ISI_INT; 204 break; 205 } 206 offset++; 208 return ELTokenContext.INVALID_CHAR; 209 } 211 break; 213 214 215 case ISI_WHITESPACE: if (!Character.isWhitespace(ch)) { 217 state = INIT; 218 return ELTokenContext.WHITESPACE; 219 } 220 break; 221 222 case ISI_BRACKET: 223 switch (ch){ 224 case ']': 225 state = INIT; 226 return ELTokenContext.IDENTIFIER; 228 case '"': 229 offset++; 230 return ELTokenContext.LBRACKET; 231 case '\'': 232 offset++; 233 return ELTokenContext.LBRACKET; 234 case '/': 235 offset++; 236 return ELTokenContext.DIV; 237 case '+': 238 offset++; 239 return ELTokenContext.PLUS; 240 case '-': 241 offset++; 242 return ELTokenContext.MINUS; 243 case '*': 244 offset++; 245 return ELTokenContext.MUL; 246 case '[': 247 offset++; 248 return ELTokenContext.LBRACKET; 249 case '%': 250 offset++; 251 return ELTokenContext.MOD; 252 case ':': 253 offset++; 254 return ELTokenContext.COLON; 255 case '(': 256 offset++; 257 return ELTokenContext.LPAREN; 258 case ')': 259 offset++; 260 return ELTokenContext.RPAREN; 261 case ',': 262 offset++; 263 return ELTokenContext.COMMA; 264 case '?': 265 offset++; 266 return ELTokenContext.QUESTION; 267 case '=': 268 state = ISI_BRACKET_ISA_EQ; 269 break; 270 case '>': 271 state = ISI_BRACKET_ISA_GT; 272 break; 273 case '<': 274 state = ISI_BRACKET_ISA_LT; 275 break; 276 case '|': 277 state = ISI_BRACKET_ISA_PIPE; 278 break; 279 case '&': 280 state = ISI_BRACKET_ISA_AND; 281 break; 282 case '0': 283 state = ISI_BRACKET_ISA_ZERO; 284 break; 285 case '.': 286 state = ISI_BRACKET_ISA_DOT; 287 break; 288 default : 289 if (Character.isWhitespace(ch)) { 291 state = ISI_BRACKET_A_WHITESPACE; 292 break; 293 } 294 if (Character.isJavaIdentifierStart(ch)){ 295 state = ISI_BRACKET_A_IDENTIFIER; 297 break; 298 } 299 if (Character.isDigit(ch)) { 301 state = ISI_BRACKET_ISI_INT; 302 break; 303 } 304 offset++; 306 return ELTokenContext.INVALID_CHAR; 307 } 309 break; 310 311 case ISI_BRACKET_A_WHITESPACE: 312 if (!Character.isWhitespace(ch)) { 313 state = ISI_BRACKET; 314 return ELTokenContext.WHITESPACE; 315 } 316 break; 317 318 case ISI_BRACKET_ISA_EQ: 319 case ISA_EQ: 320 switch (ch) { 321 case '=': 322 offset++; 323 return ELTokenContext.EQ_EQ; 324 default: 325 state = (state == ISI_BRACKET_ISA_EQ) ? ISI_BRACKET : INIT; 326 offset--; 327 } 329 break; 330 331 case ISI_BRACKET_ISA_GT: 332 case ISA_GT: 333 switch (ch) { 334 case '=': 335 offset++; 336 return ELTokenContext.GT_EQ; 337 default: 338 state = (state == ISI_BRACKET_ISA_GT) ? ISI_BRACKET : INIT; 339 return ELTokenContext.GT; 340 } 341 case ISI_BRACKET_ISA_LT: 343 case ISA_LT: 344 switch (ch) { 345 case '=': 346 offset++; 347 return ELTokenContext.LT_EQ; 348 default: 349 state = (state == ISI_BRACKET_ISA_LT) ? ISI_BRACKET : INIT; 350 return ELTokenContext.LT; 351 } 352 case ISI_BRACKET_ISA_PIPE: 354 case ISA_PIPE: 355 switch (ch) { 356 case '|': 357 offset++; 358 state = INIT; 359 return ELTokenContext.OR_OR; 360 default: 361 state = (state == ISI_BRACKET_ISA_PIPE) ? ISI_BRACKET : INIT; 362 offset--; 363 } 364 break; 365 case ISI_BRACKET_ISA_AND: 366 case ISA_AND: 367 switch (ch) { 368 case '&': 369 offset++; 370 state = INIT; 371 return ELTokenContext.AND_AND; 372 default: 373 state = (state == ISI_BRACKET_ISA_AND) ? ISI_BRACKET : INIT; 374 offset--; 375 } 376 break; 377 case ISA_EXCLAMATION: 378 switch (ch) { 379 case '=': 380 offset++; 381 state = INIT; 382 return ELTokenContext.NOT_EQ; 383 default: 384 state = INIT; 385 return ELTokenContext.NOT; 386 } 387 case ISI_STRING: 388 switch (ch) { 390 case '\\': 391 state = ISI_STRING_A_BSLASH; 393 break; 394 case '\n': 395 state = INIT; 396 return ELTokenContext.STRING_LITERAL; 398 case '"': offset++; 400 state = INIT; 401 return ELTokenContext.STRING_LITERAL; 403 } 404 break; 406 case ISI_STRING_A_BSLASH: 407 state = ISI_STRING; 411 break; 414 case ISI_BRACKET_A_IDENTIFIER: 415 case ISI_IDENTIFIER: 416 if (!(Character.isJavaIdentifierPart(ch))){ 418 switch (state){ 419 case ISI_IDENTIFIER: 420 state = INIT; break; 421 case ISI_BRACKET_A_IDENTIFIER: 422 state = ISI_BRACKET; 423 break; 424 } 425 427 TokenID tid = matchKeyword(buffer, tokenOffset, offset - tokenOffset); 428 if (tid == null){ 429 if (ch == ':'){ 430 tid = ELTokenContext.TAG_LIB_PREFIX; 432 } 433 else{ 434 tid = ELTokenContext.IDENTIFIER; 435 } 437 } 438 else { 439 } 441 return tid; 442 } 443 break; 445 446 case ISI_CHAR: 447 switch (ch) { 449 case '\\': 450 state = ISI_CHAR_A_BSLASH; 452 break; 453 case '\n': 454 state = INIT; 455 return ELTokenContext.CHAR_LITERAL; 457 case '\'': 458 offset++; 459 state = INIT; 460 return ELTokenContext.CHAR_LITERAL; 462 default : 463 464 if (buffer[offset-1] != '\'' && buffer[offset-1] != '\\'){ 465 state = ISI_CHAR_STRING; 467 } 468 469 } 470 break; 472 473 case ISI_CHAR_A_BSLASH: 474 switch (ch) { 475 case '\'': 476 case '\\': 477 break; 478 default: 479 offset--; 480 break; 481 } 482 state = ISI_CHAR; 483 break; 484 485 case ISI_CHAR_STRING: 486 switch (ch) { 488 case '\\': 489 state = ISI_CHAR_STRING_A_BSLASH; 491 break; 492 case '\n': 493 state = INIT; 494 return ELTokenContext.STRING_LITERAL; 496 case '\'': 497 offset++; 498 state = INIT; 499 return ELTokenContext.STRING_LITERAL; 501 } 502 break; 504 505 case ISI_CHAR_STRING_A_BSLASH: 506 switch (ch) { 507 case '\'': 508 case '\\': 509 break; 510 default: 511 offset--; 512 break; 513 } 514 state = ISI_CHAR_STRING; 515 break; 516 517 case ISI_BRACKET_ISA_ZERO: 518 case ISA_ZERO: 519 switch (ch) { 520 case '.': 521 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET_ISI_DOUBLE : ISI_DOUBLE; 522 break; 523 case 'x': 524 case 'X': 525 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET_ISI_HEX : ISI_HEX; 526 break; 527 case 'l': 528 case 'L': 529 offset++; 530 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET : INIT; 531 return ELTokenContext.LONG_LITERAL; 532 case 'f': 533 case 'F': 534 offset++; 535 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET : INIT; 536 return ELTokenContext.FLOAT_LITERAL; 537 case 'd': 538 case 'D': 539 offset++; 540 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET : INIT; 541 return ELTokenContext.DOUBLE_LITERAL; 542 case '8': case '9': 544 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET : INIT; 545 offset++; 546 return ELTokenContext.INVALID_OCTAL_LITERAL; 547 case 'e': 548 case 'E': 549 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET_ISI_DOUBLE_EXP : ISI_DOUBLE_EXP; 550 break; 551 default: 552 if (Character.isDigit(ch)) { state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET_ISI_OCTAL : ISI_OCTAL; 554 break; 555 } 556 state = (state == ISI_BRACKET_ISA_ZERO) ? ISI_BRACKET : INIT; 557 return ELTokenContext.INT_LITERAL; 558 } 559 break; 560 561 case ISI_BRACKET_ISI_INT: 562 case ISI_INT: 563 switch (ch) { 564 case 'l': 565 case 'L': 566 offset++; 567 state = (state == ISI_BRACKET_ISI_INT) ? ISI_BRACKET : INIT; 568 return ELTokenContext.LONG_LITERAL; 569 case '.': 570 state = (state == ISI_BRACKET_ISI_INT) ? ISI_BRACKET_ISI_DOUBLE : ISI_DOUBLE; 571 break; 572 case 'f': 573 case 'F': 574 offset++; 575 state = (state == ISI_BRACKET_ISI_INT) ? ISI_BRACKET : INIT; 576 return ELTokenContext.FLOAT_LITERAL; 577 case 'd': 578 case 'D': 579 offset++; 580 state = (state == ISI_BRACKET_ISI_INT) ? ISI_BRACKET : INIT; 581 return ELTokenContext.DOUBLE_LITERAL; 582 case 'e': 583 case 'E': 584 state = ISI_DOUBLE_EXP; 585 break; 586 default: 587 if (!(ch >= '0' && ch <= '9')) { 588 state = (state == ISI_BRACKET_ISI_INT) ? ISI_BRACKET : INIT; 589 return ELTokenContext.INT_LITERAL; 590 } 591 } 592 break; 593 594 case ISI_BRACKET_ISI_OCTAL: 595 case ISI_OCTAL: 596 if (!(ch >= '0' && ch <= '7')) { 597 state = (state == ISI_BRACKET_ISI_OCTAL) ? ISI_BRACKET : INIT; 598 return ELTokenContext.OCTAL_LITERAL; 599 } 600 break; 601 602 case ISI_BRACKET_ISI_DOUBLE: 603 case ISI_DOUBLE: 604 switch (ch) { 605 case 'f': 606 case 'F': 607 offset++; 608 state = (state == ISI_BRACKET_ISI_DOUBLE) ? ISI_BRACKET : INIT; 609 return ELTokenContext.FLOAT_LITERAL; 610 case 'd': 611 case 'D': 612 offset++; 613 state = (state == ISI_BRACKET_ISI_DOUBLE) ? ISI_BRACKET : INIT; 614 return ELTokenContext.DOUBLE_LITERAL; 615 case 'e': 616 case 'E': 617 state = (state == ISI_BRACKET_ISI_DOUBLE) ? ISI_BRACKET_ISI_DOUBLE_EXP : ISI_DOUBLE_EXP; 618 break; 619 default: 620 if (!((ch >= '0' && ch <= '9') 621 || ch == '.')) { 622 state = (state == ISI_BRACKET_ISI_DOUBLE) ? ISI_BRACKET : INIT; 623 return ELTokenContext.DOUBLE_LITERAL; 624 } 625 } 626 break; 627 628 case ISI_DOUBLE_EXP: 629 case ISI_BRACKET_ISI_DOUBLE_EXP: 630 switch (ch) { 631 case 'f': 632 case 'F': 633 offset++; 634 state = (state == ISI_BRACKET_ISI_DOUBLE_EXP) ? ISI_BRACKET : INIT; 635 return ELTokenContext.FLOAT_LITERAL; 636 case 'd': 637 case 'D': 638 offset++; 639 state = (state == ISI_BRACKET_ISI_DOUBLE_EXP) ? ISI_BRACKET : INIT; 640 return ELTokenContext.DOUBLE_LITERAL; 641 case '-': 642 case '+': 643 state = ISI_DOULE_EXP_ISA_SIGN; 644 break; 645 default: 646 if (!Character.isDigit(ch)){ 647 state = (state == ISI_BRACKET_ISI_DOUBLE_EXP) ? ISI_BRACKET : INIT; 649 return ELTokenContext.DOUBLE_LITERAL; 650 } 651 } 652 break; 653 654 case ISI_DOULE_EXP_ISA_SIGN: 655 case ISI_BRACKET_ISI_DOULE_EXP_ISA_SIGN: 656 if (!Character.isDigit(ch)){ 657 state = (state == ISI_BRACKET_ISI_DOULE_EXP_ISA_SIGN) ? ISI_BRACKET : INIT; 658 return ELTokenContext.DOUBLE_LITERAL; 659 } 660 break; 661 662 case ISI_BRACKET_ISI_HEX: 663 case ISI_HEX: 664 if (!((ch >= 'a' && ch <= 'f') 665 || (ch >= 'A' && ch <= 'F') 666 || Character.isDigit(ch)) 667 ) { 668 state = (state == ISI_BRACKET_ISI_HEX) ? ISI_BRACKET : INIT; 669 return ELTokenContext.HEX_LITERAL; 670 } 671 break; 672 673 case ISI_BRACKET_ISA_DOT: 674 case ISA_DOT: 675 if (Character.isDigit(ch)) { 676 state = (state == ISI_BRACKET_ISA_DOT) ? ISI_BRACKET_ISI_DOUBLE : ISI_DOUBLE; 677 678 } else { state = (state == ISI_BRACKET_ISA_DOT) ? ISI_BRACKET : INIT; 680 return ELTokenContext.DOT; 681 } 682 break; 683 684 } 686 offset++; } 688 689 717 718 if (lastBuffer){ 721 switch (state) { 722 case ISI_WHITESPACE: 723 state = INIT; 724 return ELTokenContext.WHITESPACE; 725 case ISI_IDENTIFIER: 726 state = INIT; 727 TokenID kwd = matchKeyword(buffer, tokenOffset, offset - tokenOffset); 728 return (kwd != null) ? kwd : ELTokenContext.IDENTIFIER; 729 case ISI_STRING: 730 case ISI_STRING_A_BSLASH: 731 return ELTokenContext.STRING_LITERAL; case ISI_CHAR: 733 case ISI_CHAR_A_BSLASH: 734 return ELTokenContext.CHAR_LITERAL; 735 case ISI_CHAR_STRING : 736 case ISI_CHAR_STRING_A_BSLASH : 737 return ELTokenContext.STRING_LITERAL; 738 case ISA_ZERO: 739 case ISI_INT: 740 state = INIT; 741 return ELTokenContext.INT_LITERAL; 742 case ISI_OCTAL: 743 state = INIT; 744 return ELTokenContext.OCTAL_LITERAL; 745 case ISI_DOUBLE: 746 case ISI_DOUBLE_EXP: 747 case ISI_DOULE_EXP_ISA_SIGN: 748 case ISI_BRACKET_ISI_DOULE_EXP_ISA_SIGN: 749 state = INIT; 750 return ELTokenContext.DOUBLE_LITERAL; 751 case ISI_HEX: 752 state = INIT; 753 return ELTokenContext.HEX_LITERAL; 754 case ISA_DOT: 755 state = INIT; 756 return ELTokenContext.DOT; 757 case ISA_EQ: 758 state = INIT; 759 return ELTokenContext.EQ_EQ; 760 case ISA_GT: 761 state = INIT; 762 return ELTokenContext.GT; 763 case ISA_LT: 764 state = INIT; 765 return ELTokenContext.LT; 766 case ISA_PIPE: 767 state = INIT; 768 return ELTokenContext.OR_OR; 769 case ISA_AND: 770 state = INIT; 771 return ELTokenContext.AND_AND; 772 case ISA_EXCLAMATION: 773 state = INIT; 774 return ELTokenContext.NOT; 775 case ISI_BRACKET: 776 case ISI_BRACKET_A_IDENTIFIER: 777 state = INIT; 778 return ELTokenContext.IDENTIFIER; 779 case ISI_BRACKET_A_WHITESPACE: 780 state = ISI_BRACKET; 781 return ELTokenContext.WHITESPACE; 782 case ISI_BRACKET_ISA_EQ: 783 state = ISI_BRACKET; 784 return ELTokenContext.EQ_EQ; 785 case ISI_BRACKET_ISA_GT: 786 state = ISI_BRACKET; 787 return ELTokenContext.GT_EQ; 788 case ISI_BRACKET_ISA_LT: 789 state = ISI_BRACKET; 790 return ELTokenContext.LT_EQ; 791 case ISI_BRACKET_ISA_AND: 792 state = ISI_BRACKET; 793 return ELTokenContext.AND_AND; 794 case ISI_BRACKET_ISA_PIPE: 795 state = ISI_BRACKET; 796 return ELTokenContext.OR_OR; 797 case ISI_BRACKET_ISA_DOT: 798 state = ISI_BRACKET; 799 return ELTokenContext.DOT; 800 case ISI_BRACKET_ISA_ZERO: 801 case ISI_BRACKET_ISI_INT: 802 state = ISI_BRACKET; 803 return ELTokenContext.INT_LITERAL; 804 805 806 } 807 } 808 809 return null; 810 } 811 812 813 public static TokenID matchKeyword(char[] buffer, int offset, int len) { 814 if (len > 10) 815 return null; 816 if (len <= 1) 817 return null; 818 switch (buffer[offset++]) { 819 case 'a': 820 if (len <= 2) return null; 821 return (len == 3 822 && buffer[offset++] == 'n' 823 && buffer[offset++] == 'd') 824 ? ELTokenContext.AND_KEYWORD : null; 825 case 'd': 826 if (len <= 2) return null; 827 return (len == 3 828 && buffer[offset++] == 'i' 829 && buffer[offset++] == 'v') 830 ? ELTokenContext.DIV_KEYWORD : null; 831 case 'e': 832 switch (buffer[offset++]) { 833 case 'q': 834 return (len == 2) ? ELTokenContext.EQ_KEYWORD : null; 835 case 'm': 836 return (len == 5 837 && buffer[offset++] == 'p' 838 && buffer[offset++] == 't' 839 && buffer[offset++] == 'y') 840 ? ELTokenContext.EMPTY_KEYWORD : null; 841 default: 842 return null; 843 } 844 case 'f': 845 return (len == 5 846 && buffer[offset++] == 'a' 847 && buffer[offset++] == 'l' 848 && buffer[offset++] == 's' 849 && buffer[offset++] == 'e') 850 ? ELTokenContext.FALSE_KEYWORD : null; 851 case 'g': 852 switch (buffer[offset++]){ 853 case 'e': 854 return (len == 2) ? ELTokenContext.GE_KEYWORD : null; 855 case 't': 856 return (len == 2) ? ELTokenContext.GT_KEYWORD : null; 857 default: 858 return null; 859 } 860 case 'l': 861 switch (buffer[offset++]){ 862 case 'e': 863 return (len == 2) ? ELTokenContext.LE_KEYWORD : null; 864 case 't': 865 return (len == 2) ? ELTokenContext.LT_KEYWORD : null; 866 default: 867 return null; 868 } 869 case 'i': 870 if (len <= 9) return null; 871 return (len == 10 872 && buffer[offset++] == 'n' 873 && buffer[offset++] == 's' 874 && buffer[offset++] == 't' 875 && buffer[offset++] == 'a' 876 && buffer[offset++] == 'n' 877 && buffer[offset++] == 'c' 878 && buffer[offset++] == 'e' 879 && buffer[offset++] == 'o' 880 && buffer[offset++] == 'f') 881 ? ELTokenContext.INSTANCEOF_KEYWORD : null; 882 case 'm': 883 if (len <= 2) return null; 884 return (len == 3 885 && buffer[offset++] == 'o' 886 && buffer[offset++] == 'd') 887 ? ELTokenContext.MOD_KEYWORD : null; 888 case 'n': 889 switch (buffer[offset++]){ 890 case 'e': 891 return (len == 2) ? ELTokenContext.NE_KEYWORD : null; 892 case 'o': 893 return (len == 3 894 && buffer[offset++] == 't') 895 ? ELTokenContext.NOT_KEYWORD : null; 896 case 'u': 897 return (len == 4 898 && buffer[offset++] == 'l' 899 && buffer[offset++] == 'l') 900 ? ELTokenContext.NULL_KEYWORD : null; 901 default: 902 return null; 903 } 904 case 'o': 905 return (len == 2 906 && buffer[offset++] == 'r') 907 ? ELTokenContext.OR_KEYWORD : null; 908 case 't': 909 return (len == 4 910 && buffer[offset++] == 'r' 911 && buffer[offset++] == 'u' 912 && buffer[offset++] == 'e') 913 ? ELTokenContext.TRUE_KEYWORD : null; 914 915 default : 916 return null; 917 } 918 } 919 920 public String getStateName(int stateNumber) { 921 switch (stateNumber){ 922 case ISI_IDENTIFIER : return "jsp_el_ISI_IDENTIFIER"; case ISI_CHAR : return "el_ISI_CHAR"; case ISI_CHAR_A_BSLASH : return "el_ISI_CHAR_A_BSLASH"; case ISI_STRING : return "el_ISI_STRING"; case ISI_STRING_A_BSLASH : return "el_ISI_STRING_A_BSLASH"; case ISI_CHAR_STRING : return "el_ISI_CHAR_STRING"; case ISI_CHAR_STRING_A_BSLASH : return "el_ISI_CHAR_STRING_A_BSLASH"; case ISA_ZERO : return "el_ISA_ZERO"; case ISI_INT : return "el_ISI_INT"; case ISI_OCTAL : return "el_ISI_OCTAL"; case ISI_DOUBLE : return "el_ISI_DOUBLE"; case ISI_DOUBLE_EXP : return "el_ISI_DOUBLE_EXP"; case ISI_HEX : return "el_ISI_HEX"; case ISA_DOT : return "el_ISA_DOT"; case ISI_WHITESPACE : return "el_ISI_WHITESPACE"; case ISA_EQ : return "el_ISA_EQ"; case ISA_GT : return "el_ISA_GT"; case ISA_LT : return "el_ISA_LT"; case ISA_PIPE : return "el_ISA_PIPE"; case ISA_AND : return "el_ISA_AND"; case ISA_EXCLAMATION : return "el_ISA_EXCLAMATION"; case ISI_BRACKET : return "el_ISI_BRACKET"; case ISI_BRACKET_A_WHITESPACE: return "el_ISI_BRACKET_A_WHITSPACE"; case ISI_BRACKET_ISA_EQ : return "el_ISI_BRACKET_ISA_EQ"; case ISI_BRACKET_ISA_GT : return "el_ISI_BRACKET_ISA_GT"; case ISI_BRACKET_ISA_LT : return "el_ISI_BRACKET_ISA_LT"; case ISI_BRACKET_ISA_AND : return "el_ISI_BRACKET_ISA_AND"; case ISI_BRACKET_ISA_PIPE : return "el_ISI_BRACKET_ISA_PIPE"; case ISI_BRACKET_ISI_INT : return "el_ISI_BRACKET_ISI_INT"; case ISI_BRACKET_ISI_OCTAL : return "el_ISI_BRACKET_ISI_OCTAL"; case ISI_BRACKET_ISI_DOUBLE : return "el_ISI_BRACKET_ISI_DOUBLE"; case ISI_BRACKET_ISI_DOUBLE_EXP: return "el_ISI_BRACKET_ISI_DOUBLE_EXP"; case ISI_BRACKET_ISI_HEX : return "el_ISI_BRACKET_ISI_HEX"; case ISI_BRACKET_ISI_DOULE_EXP_ISA_SIGN : return "el_ISI_BRACKET_ISI_DOULE_EXP_ISA_SIGN"; 956 case ISI_DOULE_EXP_ISA_SIGN : return "el_ISI_DOULE_EXP_ISA_SIGN"; 957 default: 958 return super.getStateName(stateNumber); 959 } 960 } 961 962 } 963 | Popular Tags |