1 
   2 // this file has been automatically generated from 'D:/work/soulng-project/sngxml/xpath/XPathLexer.lexer' using soulng lexer generator slg version 3.0.0
   3 
   4 #include <sngxml/xpath/XPathLexer.hpp>
   5 #include <sngxml/xpath/XPathKeywords.hpp>
   6 #include <soulng/lexer/Token.hpp>
   7 #include <sngxml/xpath/XPathTokens.hpp>
   8 #include <sngxml/xpath/XPathClassMap.hpp>
   9 
  10 using namespace soulng::lexer;
  11 using namespace XPathTokens;
  12 
  13 XPathLexer::XPathLexer(const std::u32string& content_const std::string& fileName_int fileIndex_) : soulng::lexer::Lexer(content_fileName_fileIndex_)
  14 {
  15     SetKeywordMap(XPathKeywords::GetKeywordMap());
  16 }
  17 
  18 XPathLexer::XPathLexer(const char32_t* start_const char32_t* end_const std::string& fileName_int fileIndex_) : soulng::lexer::Lexer(start_end_fileName_fileIndex_)
  19 {
  20     SetKeywordMap(XPathKeywords::GetKeywordMap());
  21 }
  22 
  23 int XPathLexer::NextState(int statechar32_t c)
  24 {
  25     int i = XPathClassMap::GetClass(c);
  26     switch (state)
  27     {
  28         case 0:
  29         {
  30             switch (i)
  31             {
  32                 case 0:
  33                 {
  34                     return 1;
  35                 }
  36                 case 1:
  37                 {
  38                     return 2;
  39                 }
  40                 case 4:
  41                 case 5:
  42                 case 6:
  43                 case 7:
  44                 {
  45                     return 3;
  46                 }
  47                 case 8:
  48                 case 9:
  49                 case 10:
  50                 case 11:
  51                 {
  52                     return 4;
  53                 }
  54                 case 13:
  55                 {
  56                     return 5;
  57                 }
  58                 case 14:
  59                 {
  60                     return 6;
  61                 }
  62                 case 16:
  63                 {
  64                     return 7;
  65                 }
  66                 case 18:
  67                 {
  68                     return 8;
  69                 }
  70                 case 19:
  71                 {
  72                     return 9;
  73                 }
  74                 case 20:
  75                 {
  76                     return 10;
  77                 }
  78                 case 21:
  79                 {
  80                     return 11;
  81                 }
  82                 case 22:
  83                 {
  84                     return 12;
  85                 }
  86                 case 23:
  87                 {
  88                     return 13;
  89                 }
  90                 case 24:
  91                 {
  92                     return 14;
  93                 }
  94                 case 25:
  95                 {
  96                     return 15;
  97                 }
  98                 case 26:
  99                 {
 100                     return 16;
 101                 }
 102                 case 27:
 103                 {
 104                     return 17;
 105                 }
 106                 case 28:
 107                 {
 108                     return 18;
 109                 }
 110                 case 29:
 111                 {
 112                     return 19;
 113                 }
 114                 case 30:
 115                 {
 116                     return 20;
 117                 }
 118                 case 31:
 119                 {
 120                     return 21;
 121                 }
 122                 case 32:
 123                 {
 124                     return 22;
 125                 }
 126                 case 33:
 127                 {
 128                     return 23;
 129                 }
 130                 default:
 131                 {
 132                     return -1;
 133                 }
 134             }
 135         }
 136         case 23:
 137         {
 138             Lexeme prevMatch = token.match;
 139             token.match = lexeme;
 140             int tokenId = GetTokenId(27);
 141             if (tokenId == CONTINUE_TOKEN)
 142             {
 143                 token.id = tokenId;
 144                 return -1;
 145             }
 146             else if (tokenId != INVALID_TOKEN)
 147             {
 148                 token.id = tokenId;
 149             }
 150             else
 151             {
 152                 token.match = prevMatch;
 153             }
 154             return -1;
 155         }
 156         case 22:
 157         {
 158             Lexeme prevMatch = token.match;
 159             token.match = lexeme;
 160             int tokenId = GetTokenId(26);
 161             if (tokenId == CONTINUE_TOKEN)
 162             {
 163                 token.id = tokenId;
 164                 return -1;
 165             }
 166             else if (tokenId != INVALID_TOKEN)
 167             {
 168                 token.id = tokenId;
 169             }
 170             else
 171             {
 172                 token.match = prevMatch;
 173             }
 174             return -1;
 175         }
 176         case 21:
 177         {
 178             Lexeme prevMatch = token.match;
 179             token.match = lexeme;
 180             int tokenId = GetTokenId(25);
 181             if (tokenId == CONTINUE_TOKEN)
 182             {
 183                 token.id = tokenId;
 184                 return -1;
 185             }
 186             else if (tokenId != INVALID_TOKEN)
 187             {
 188                 token.id = tokenId;
 189             }
 190             else
 191             {
 192                 token.match = prevMatch;
 193             }
 194             return -1;
 195         }
 196         case 20:
 197         {
 198             Lexeme prevMatch = token.match;
 199             token.match = lexeme;
 200             int tokenId = GetTokenId(24);
 201             if (tokenId == CONTINUE_TOKEN)
 202             {
 203                 token.id = tokenId;
 204                 return -1;
 205             }
 206             else if (tokenId != INVALID_TOKEN)
 207             {
 208                 token.id = tokenId;
 209             }
 210             else
 211             {
 212                 token.match = prevMatch;
 213             }
 214             return -1;
 215         }
 216         case 19:
 217         {
 218             Lexeme prevMatch = token.match;
 219             token.match = lexeme;
 220             int tokenId = GetTokenId(23);
 221             if (tokenId == CONTINUE_TOKEN)
 222             {
 223                 token.id = tokenId;
 224                 return -1;
 225             }
 226             else if (tokenId != INVALID_TOKEN)
 227             {
 228                 token.id = tokenId;
 229             }
 230             else
 231             {
 232                 token.match = prevMatch;
 233             }
 234             return -1;
 235         }
 236         case 18:
 237         {
 238             Lexeme prevMatch = token.match;
 239             token.match = lexeme;
 240             int tokenId = GetTokenId(22);
 241             if (tokenId == CONTINUE_TOKEN)
 242             {
 243                 token.id = tokenId;
 244                 return -1;
 245             }
 246             else if (tokenId != INVALID_TOKEN)
 247             {
 248                 token.id = tokenId;
 249             }
 250             else
 251             {
 252                 token.match = prevMatch;
 253             }
 254             return -1;
 255         }
 256         case 17:
 257         {
 258             Lexeme prevMatch = token.match;
 259             token.match = lexeme;
 260             int tokenId = GetTokenId(21);
 261             if (tokenId == CONTINUE_TOKEN)
 262             {
 263                 token.id = tokenId;
 264                 return -1;
 265             }
 266             else if (tokenId != INVALID_TOKEN)
 267             {
 268                 token.id = tokenId;
 269             }
 270             else
 271             {
 272                 token.match = prevMatch;
 273             }
 274             return -1;
 275         }
 276         case 16:
 277         {
 278             Lexeme prevMatch = token.match;
 279             token.match = lexeme;
 280             int tokenId = GetTokenId(20);
 281             if (tokenId == CONTINUE_TOKEN)
 282             {
 283                 token.id = tokenId;
 284                 return -1;
 285             }
 286             else if (tokenId != INVALID_TOKEN)
 287             {
 288                 token.id = tokenId;
 289             }
 290             else
 291             {
 292                 token.match = prevMatch;
 293             }
 294             switch (i)
 295             {
 296                 case 26:
 297                 {
 298                     return 24;
 299                 }
 300                 default:
 301                 {
 302                     return -1;
 303                 }
 304             }
 305         }
 306         case 24:
 307         {
 308             Lexeme prevMatch = token.match;
 309             token.match = lexeme;
 310             int tokenId = GetTokenId(19);
 311             if (tokenId == CONTINUE_TOKEN)
 312             {
 313                 token.id = tokenId;
 314                 return -1;
 315             }
 316             else if (tokenId != INVALID_TOKEN)
 317             {
 318                 token.id = tokenId;
 319             }
 320             else
 321             {
 322                 token.match = prevMatch;
 323             }
 324             return -1;
 325         }
 326         case 15:
 327         {
 328             Lexeme prevMatch = token.match;
 329             token.match = lexeme;
 330             int tokenId = GetTokenId(16);
 331             if (tokenId == CONTINUE_TOKEN)
 332             {
 333                 token.id = tokenId;
 334                 return -1;
 335             }
 336             else if (tokenId != INVALID_TOKEN)
 337             {
 338                 token.id = tokenId;
 339             }
 340             else
 341             {
 342                 token.match = prevMatch;
 343             }
 344             switch (i)
 345             {
 346                 case 25:
 347                 {
 348                     return 25;
 349                 }
 350                 default:
 351                 {
 352                     return -1;
 353                 }
 354             }
 355         }
 356         case 25:
 357         {
 358             Lexeme prevMatch = token.match;
 359             token.match = lexeme;
 360             int tokenId = GetTokenId(15);
 361             if (tokenId == CONTINUE_TOKEN)
 362             {
 363                 token.id = tokenId;
 364                 return -1;
 365             }
 366             else if (tokenId != INVALID_TOKEN)
 367             {
 368                 token.id = tokenId;
 369             }
 370             else
 371             {
 372                 token.match = prevMatch;
 373             }
 374             return -1;
 375         }
 376         case 14:
 377         {
 378             Lexeme prevMatch = token.match;
 379             token.match = lexeme;
 380             int tokenId = GetTokenId(14);
 381             if (tokenId == CONTINUE_TOKEN)
 382             {
 383                 token.id = tokenId;
 384                 return -1;
 385             }
 386             else if (tokenId != INVALID_TOKEN)
 387             {
 388                 token.id = tokenId;
 389             }
 390             else
 391             {
 392                 token.match = prevMatch;
 393             }
 394             return -1;
 395         }
 396         case 13:
 397         {
 398             Lexeme prevMatch = token.match;
 399             token.match = lexeme;
 400             int tokenId = GetTokenId(13);
 401             if (tokenId == CONTINUE_TOKEN)
 402             {
 403                 token.id = tokenId;
 404                 return -1;
 405             }
 406             else if (tokenId != INVALID_TOKEN)
 407             {
 408                 token.id = tokenId;
 409             }
 410             else
 411             {
 412                 token.match = prevMatch;
 413             }
 414             return -1;
 415         }
 416         case 12:
 417         {
 418             Lexeme prevMatch = token.match;
 419             token.match = lexeme;
 420             int tokenId = GetTokenId(11);
 421             if (tokenId == CONTINUE_TOKEN)
 422             {
 423                 token.id = tokenId;
 424                 return -1;
 425             }
 426             else if (tokenId != INVALID_TOKEN)
 427             {
 428                 token.id = tokenId;
 429             }
 430             else
 431             {
 432                 token.match = prevMatch;
 433             }
 434             return -1;
 435         }
 436         case 11:
 437         {
 438             Lexeme prevMatch = token.match;
 439             token.match = lexeme;
 440             int tokenId = GetTokenId(10);
 441             if (tokenId == CONTINUE_TOKEN)
 442             {
 443                 token.id = tokenId;
 444                 return -1;
 445             }
 446             else if (tokenId != INVALID_TOKEN)
 447             {
 448                 token.id = tokenId;
 449             }
 450             else
 451             {
 452                 token.match = prevMatch;
 453             }
 454             switch (i)
 455             {
 456                 case 18:
 457                 {
 458                     return 26;
 459                 }
 460                 default:
 461                 {
 462                     return -1;
 463                 }
 464             }
 465         }
 466         case 26:
 467         {
 468             Lexeme prevMatch = token.match;
 469             token.match = lexeme;
 470             int tokenId = GetTokenId(8);
 471             if (tokenId == CONTINUE_TOKEN)
 472             {
 473                 token.id = tokenId;
 474                 return -1;
 475             }
 476             else if (tokenId != INVALID_TOKEN)
 477             {
 478                 token.id = tokenId;
 479             }
 480             else
 481             {
 482                 token.match = prevMatch;
 483             }
 484             return -1;
 485         }
 486         case 10:
 487         {
 488             Lexeme prevMatch = token.match;
 489             token.match = lexeme;
 490             int tokenId = GetTokenId(9);
 491             if (tokenId == CONTINUE_TOKEN)
 492             {
 493                 token.id = tokenId;
 494                 return -1;
 495             }
 496             else if (tokenId != INVALID_TOKEN)
 497             {
 498                 token.id = tokenId;
 499             }
 500             else
 501             {
 502                 token.match = prevMatch;
 503             }
 504             switch (i)
 505             {
 506                 case 18:
 507                 {
 508                     return 27;
 509                 }
 510                 default:
 511                 {
 512                     return -1;
 513                 }
 514             }
 515         }
 516         case 27:
 517         {
 518             Lexeme prevMatch = token.match;
 519             token.match = lexeme;
 520             int tokenId = GetTokenId(7);
 521             if (tokenId == CONTINUE_TOKEN)
 522             {
 523                 token.id = tokenId;
 524                 return -1;
 525             }
 526             else if (tokenId != INVALID_TOKEN)
 527             {
 528                 token.id = tokenId;
 529             }
 530             else
 531             {
 532                 token.match = prevMatch;
 533             }
 534             return -1;
 535         }
 536         case 9:
 537         {
 538             switch (i)
 539             {
 540                 case 18:
 541                 {
 542                     return 28;
 543                 }
 544                 default:
 545                 {
 546                     return -1;
 547                 }
 548             }
 549         }
 550         case 28:
 551         {
 552             Lexeme prevMatch = token.match;
 553             token.match = lexeme;
 554             int tokenId = GetTokenId(6);
 555             if (tokenId == CONTINUE_TOKEN)
 556             {
 557                 token.id = tokenId;
 558                 return -1;
 559             }
 560             else if (tokenId != INVALID_TOKEN)
 561             {
 562                 token.id = tokenId;
 563             }
 564             else
 565             {
 566                 token.match = prevMatch;
 567             }
 568             return -1;
 569         }
 570         case 8:
 571         {
 572             Lexeme prevMatch = token.match;
 573             token.match = lexeme;
 574             int tokenId = GetTokenId(5);
 575             if (tokenId == CONTINUE_TOKEN)
 576             {
 577                 token.id = tokenId;
 578                 return -1;
 579             }
 580             else if (tokenId != INVALID_TOKEN)
 581             {
 582                 token.id = tokenId;
 583             }
 584             else
 585             {
 586                 token.match = prevMatch;
 587             }
 588             return -1;
 589         }
 590         case 7:
 591         {
 592             Lexeme prevMatch = token.match;
 593             token.match = lexeme;
 594             int tokenId = GetTokenId(2);
 595             if (tokenId == CONTINUE_TOKEN)
 596             {
 597                 token.id = tokenId;
 598                 return -1;
 599             }
 600             else if (tokenId != INVALID_TOKEN)
 601             {
 602                 token.id = tokenId;
 603             }
 604             else
 605             {
 606                 token.match = prevMatch;
 607             }
 608             switch (i)
 609             {
 610                 case 16:
 611                 {
 612                     return 7;
 613                 }
 614                 case 14:
 615                 {
 616                     return 29;
 617                 }
 618                 default:
 619                 {
 620                     return -1;
 621                 }
 622             }
 623         }
 624         case 29:
 625         {
 626             Lexeme prevMatch = token.match;
 627             token.match = lexeme;
 628             int tokenId = GetTokenId(2);
 629             if (tokenId == CONTINUE_TOKEN)
 630             {
 631                 token.id = tokenId;
 632                 return -1;
 633             }
 634             else if (tokenId != INVALID_TOKEN)
 635             {
 636                 token.id = tokenId;
 637             }
 638             else
 639             {
 640                 token.match = prevMatch;
 641             }
 642             switch (i)
 643             {
 644                 case 16:
 645                 {
 646                     return 30;
 647                 }
 648                 default:
 649                 {
 650                     return -1;
 651                 }
 652             }
 653         }
 654         case 30:
 655         {
 656             Lexeme prevMatch = token.match;
 657             token.match = lexeme;
 658             int tokenId = GetTokenId(2);
 659             if (tokenId == CONTINUE_TOKEN)
 660             {
 661                 token.id = tokenId;
 662                 return -1;
 663             }
 664             else if (tokenId != INVALID_TOKEN)
 665             {
 666                 token.id = tokenId;
 667             }
 668             else
 669             {
 670                 token.match = prevMatch;
 671             }
 672             switch (i)
 673             {
 674                 case 16:
 675                 {
 676                     return 30;
 677                 }
 678                 default:
 679                 {
 680                     return -1;
 681                 }
 682             }
 683         }
 684         case 6:
 685         {
 686             Lexeme prevMatch = token.match;
 687             token.match = lexeme;
 688             int tokenId = GetTokenId(18);
 689             if (tokenId == CONTINUE_TOKEN)
 690             {
 691                 token.id = tokenId;
 692                 return -1;
 693             }
 694             else if (tokenId != INVALID_TOKEN)
 695             {
 696                 token.id = tokenId;
 697             }
 698             else
 699             {
 700                 token.match = prevMatch;
 701             }
 702             switch (i)
 703             {
 704                 case 14:
 705                 {
 706                     return 31;
 707                 }
 708                 case 16:
 709                 {
 710                     return 32;
 711                 }
 712                 default:
 713                 {
 714                     return -1;
 715                 }
 716             }
 717         }
 718         case 32:
 719         {
 720             Lexeme prevMatch = token.match;
 721             token.match = lexeme;
 722             int tokenId = GetTokenId(2);
 723             if (tokenId == CONTINUE_TOKEN)
 724             {
 725                 token.id = tokenId;
 726                 return -1;
 727             }
 728             else if (tokenId != INVALID_TOKEN)
 729             {
 730                 token.id = tokenId;
 731             }
 732             else
 733             {
 734                 token.match = prevMatch;
 735             }
 736             switch (i)
 737             {
 738                 case 16:
 739                 {
 740                     return 32;
 741                 }
 742                 default:
 743                 {
 744                     return -1;
 745                 }
 746             }
 747         }
 748         case 31:
 749         {
 750             Lexeme prevMatch = token.match;
 751             token.match = lexeme;
 752             int tokenId = GetTokenId(17);
 753             if (tokenId == CONTINUE_TOKEN)
 754             {
 755                 token.id = tokenId;
 756                 return -1;
 757             }
 758             else if (tokenId != INVALID_TOKEN)
 759             {
 760                 token.id = tokenId;
 761             }
 762             else
 763             {
 764                 token.match = prevMatch;
 765             }
 766             return -1;
 767         }
 768         case 5:
 769         {
 770             Lexeme prevMatch = token.match;
 771             token.match = lexeme;
 772             int tokenId = GetTokenId(12);
 773             if (tokenId == CONTINUE_TOKEN)
 774             {
 775                 token.id = tokenId;
 776                 return -1;
 777             }
 778             else if (tokenId != INVALID_TOKEN)
 779             {
 780                 token.id = tokenId;
 781             }
 782             else
 783             {
 784                 token.match = prevMatch;
 785             }
 786             return -1;
 787         }
 788         case 4:
 789         {
 790             Lexeme prevMatch = token.match;
 791             token.match = lexeme;
 792             int tokenId = GetTokenId(1);
 793             if (tokenId == CONTINUE_TOKEN)
 794             {
 795                 token.id = tokenId;
 796                 return -1;
 797             }
 798             else if (tokenId != INVALID_TOKEN)
 799             {
 800                 token.id = tokenId;
 801             }
 802             else
 803             {
 804                 token.match = prevMatch;
 805             }
 806             switch (i)
 807             {
 808                 case 8:
 809                 case 9:
 810                 case 10:
 811                 case 11:
 812                 {
 813                     return 33;
 814                 }
 815                 case 12:
 816                 case 13:
 817                 case 14:
 818                 case 15:
 819                 case 16:
 820                 {
 821                     return 34;
 822                 }
 823                 default:
 824                 {
 825                     return -1;
 826                 }
 827             }
 828         }
 829         case 34:
 830         {
 831             Lexeme prevMatch = token.match;
 832             token.match = lexeme;
 833             int tokenId = GetTokenId(1);
 834             if (tokenId == CONTINUE_TOKEN)
 835             {
 836                 token.id = tokenId;
 837                 return -1;
 838             }
 839             else if (tokenId != INVALID_TOKEN)
 840             {
 841                 token.id = tokenId;
 842             }
 843             else
 844             {
 845                 token.match = prevMatch;
 846             }
 847             switch (i)
 848             {
 849                 case 8:
 850                 case 9:
 851                 case 10:
 852                 case 11:
 853                 {
 854                     return 33;
 855                 }
 856                 case 12:
 857                 case 13:
 858                 case 14:
 859                 case 15:
 860                 case 16:
 861                 {
 862                     return 34;
 863                 }
 864                 default:
 865                 {
 866                     return -1;
 867                 }
 868             }
 869         }
 870         case 33:
 871         {
 872             Lexeme prevMatch = token.match;
 873             token.match = lexeme;
 874             int tokenId = GetTokenId(1);
 875             if (tokenId == CONTINUE_TOKEN)
 876             {
 877                 token.id = tokenId;
 878                 return -1;
 879             }
 880             else if (tokenId != INVALID_TOKEN)
 881             {
 882                 token.id = tokenId;
 883             }
 884             else
 885             {
 886                 token.match = prevMatch;
 887             }
 888             switch (i)
 889             {
 890                 case 8:
 891                 case 9:
 892                 case 10:
 893                 case 11:
 894                 {
 895                     return 33;
 896                 }
 897                 case 12:
 898                 case 13:
 899                 case 14:
 900                 case 15:
 901                 case 16:
 902                 {
 903                     return 34;
 904                 }
 905                 default:
 906                 {
 907                     return -1;
 908                 }
 909             }
 910         }
 911         case 3:
 912         {
 913             Lexeme prevMatch = token.match;
 914             token.match = lexeme;
 915             int tokenId = GetTokenId(0);
 916             if (tokenId == CONTINUE_TOKEN)
 917             {
 918                 token.id = tokenId;
 919                 return -1;
 920             }
 921             else if (tokenId != INVALID_TOKEN)
 922             {
 923                 token.id = tokenId;
 924             }
 925             else
 926             {
 927                 token.match = prevMatch;
 928             }
 929             switch (i)
 930             {
 931                 case 4:
 932                 case 5:
 933                 case 6:
 934                 case 7:
 935                 {
 936                     return 3;
 937                 }
 938                 default:
 939                 {
 940                     return -1;
 941                 }
 942             }
 943         }
 944         case 2:
 945         {
 946             switch (i)
 947             {
 948                 case 0:
 949                 case 2:
 950                 case 3:
 951                 case 4:
 952                 case 5:
 953                 case 6:
 954                 case 7:
 955                 case 8:
 956                 case 9:
 957                 case 10:
 958                 case 11:
 959                 case 12:
 960                 case 13:
 961                 case 14:
 962                 case 15:
 963                 case 16:
 964                 case 17:
 965                 case 18:
 966                 case 19:
 967                 case 20:
 968                 case 21:
 969                 case 22:
 970                 case 23:
 971                 case 24:
 972                 case 25:
 973                 case 26:
 974                 case 27:
 975                 case 28:
 976                 case 29:
 977                 case 30:
 978                 case 31:
 979                 case 32:
 980                 case 33:
 981                 {
 982                     return 35;
 983                 }
 984                 case 1:
 985                 {
 986                     return 36;
 987                 }
 988                 default:
 989                 {
 990                     return -1;
 991                 }
 992             }
 993         }
 994         case 36:
 995         {
 996             Lexeme prevMatch = token.match;
 997             token.match = lexeme;
 998             int tokenId = GetTokenId(3);
 999             if (tokenId == CONTINUE_TOKEN)
1000             {
1001                 token.id = tokenId;
1002                 return -1;
1003             }
1004             else if (tokenId != INVALID_TOKEN)
1005             {
1006                 token.id = tokenId;
1007             }
1008             else
1009             {
1010                 token.match = prevMatch;
1011             }
1012             return -1;
1013         }
1014         case 35:
1015         {
1016             switch (i)
1017             {
1018                 case 0:
1019                 case 2:
1020                 case 3:
1021                 case 4:
1022                 case 5:
1023                 case 6:
1024                 case 7:
1025                 case 8:
1026                 case 9:
1027                 case 10:
1028                 case 11:
1029                 case 12:
1030                 case 13:
1031                 case 14:
1032                 case 15:
1033                 case 16:
1034                 case 17:
1035                 case 18:
1036                 case 19:
1037                 case 20:
1038                 case 21:
1039                 case 22:
1040                 case 23:
1041                 case 24:
1042                 case 25:
1043                 case 26:
1044                 case 27:
1045                 case 28:
1046                 case 29:
1047                 case 30:
1048                 case 31:
1049                 case 32:
1050                 case 33:
1051                 {
1052                     return 35;
1053                 }
1054                 case 1:
1055                 {
1056                     return 36;
1057                 }
1058                 default:
1059                 {
1060                     return -1;
1061                 }
1062             }
1063         }
1064         case 1:
1065         {
1066             switch (i)
1067             {
1068                 case 0:
1069                 {
1070                     return 37;
1071                 }
1072                 case 1:
1073                 case 2:
1074                 case 3:
1075                 case 4:
1076                 case 5:
1077                 case 6:
1078                 case 7:
1079                 case 8:
1080                 case 9:
1081                 case 10:
1082                 case 11:
1083                 case 12:
1084                 case 13:
1085                 case 14:
1086                 case 15:
1087                 case 16:
1088                 case 17:
1089                 case 18:
1090                 case 19:
1091                 case 20:
1092                 case 21:
1093                 case 22:
1094                 case 23:
1095                 case 24:
1096                 case 25:
1097                 case 26:
1098                 case 27:
1099                 case 28:
1100                 case 29:
1101                 case 30:
1102                 case 31:
1103                 case 32:
1104                 case 33:
1105                 {
1106                     return 38;
1107                 }
1108                 default:
1109                 {
1110                     return -1;
1111                 }
1112             }
1113         }
1114         case 38:
1115         {
1116             switch (i)
1117             {
1118                 case 0:
1119                 {
1120                     return 37;
1121                 }
1122                 case 1:
1123                 case 2:
1124                 case 3:
1125                 case 4:
1126                 case 5:
1127                 case 6:
1128                 case 7:
1129                 case 8:
1130                 case 9:
1131                 case 10:
1132                 case 11:
1133                 case 12:
1134                 case 13:
1135                 case 14:
1136                 case 15:
1137                 case 16:
1138                 case 17:
1139                 case 18:
1140                 case 19:
1141                 case 20:
1142                 case 21:
1143                 case 22:
1144                 case 23:
1145                 case 24:
1146                 case 25:
1147                 case 26:
1148                 case 27:
1149                 case 28:
1150                 case 29:
1151                 case 30:
1152                 case 31:
1153                 case 32:
1154                 case 33:
1155                 {
1156                     return 38;
1157                 }
1158                 default:
1159                 {
1160                     return -1;
1161                 }
1162             }
1163         }
1164         case 37:
1165         {
1166             Lexeme prevMatch = token.match;
1167             token.match = lexeme;
1168             int tokenId = GetTokenId(4);
1169             if (tokenId == CONTINUE_TOKEN)
1170             {
1171                 token.id = tokenId;
1172                 return -1;
1173             }
1174             else if (tokenId != INVALID_TOKEN)
1175             {
1176                 token.id = tokenId;
1177             }
1178             else
1179             {
1180                 token.match = prevMatch;
1181             }
1182             return -1;
1183         }
1184     }
1185     return -1;
1186 }
1187 
1188 int XPathLexer::GetTokenId(int statementIndex)
1189 {
1190     switch (statementIndex)
1191     {
1192         case 0:
1193         {
1194             Retract();
1195             break;
1196         }
1197         case 1:
1198         {
1199             Retract();
1200             return NAME;
1201             break;
1202         }
1203         case 2:
1204         {
1205             Retract();
1206             return NUMBER;
1207             break;
1208         }
1209         case 3:
1210         {
1211             Retract();
1212             return DQSTRING;
1213             break;
1214         }
1215         case 4:
1216         {
1217             Retract();
1218             return SQSTRING;
1219             break;
1220         }
1221         case 5:
1222         {
1223             Retract();
1224             return EQ;
1225             break;
1226         }
1227         case 6:
1228         {
1229             Retract();
1230             return NEQ;
1231             break;
1232         }
1233         case 7:
1234         {
1235             Retract();
1236             return LEQ;
1237             break;
1238         }
1239         case 8:
1240         {
1241             Retract();
1242             return GEQ;
1243             break;
1244         }
1245         case 9:
1246         {
1247             Retract();
1248             return LESS;
1249             break;
1250         }
1251         case 10:
1252         {
1253             Retract();
1254             return GREATER;
1255             break;
1256         }
1257         case 11:
1258         {
1259             Retract();
1260             return PLUS;
1261             break;
1262         }
1263         case 12:
1264         {
1265             Retract();
1266             return MINUS;
1267             break;
1268         }
1269         case 13:
1270         {
1271             Retract();
1272             return STAR;
1273             break;
1274         }
1275         case 14:
1276         {
1277             Retract();
1278             return UNION;
1279             break;
1280         }
1281         case 15:
1282         {
1283             Retract();
1284             return SLASHSLASH;
1285             break;
1286         }
1287         case 16:
1288         {
1289             Retract();
1290             return SLASH;
1291             break;
1292         }
1293         case 17:
1294         {
1295             Retract();
1296             return DOTDOT;
1297             break;
1298         }
1299         case 18:
1300         {
1301             Retract();
1302             return DOT;
1303             break;
1304         }
1305         case 19:
1306         {
1307             Retract();
1308             return COLONCOLON;
1309             break;
1310         }
1311         case 20:
1312         {
1313             Retract();
1314             return COLON;
1315             break;
1316         }
1317         case 21:
1318         {
1319             Retract();
1320             return DOLLAR;
1321             break;
1322         }
1323         case 22:
1324         {
1325             Retract();
1326             return COMMA;
1327             break;
1328         }
1329         case 23:
1330         {
1331             Retract();
1332             return AT;
1333             break;
1334         }
1335         case 24:
1336         {
1337             Retract();
1338             return LBRACKET;
1339             break;
1340         }
1341         case 25:
1342         {
1343             Retract();
1344             return RBRACKET;
1345             break;
1346         }
1347         case 26:
1348         {
1349             Retract();
1350             return LPAREN;
1351             break;
1352         }
1353         case 27:
1354         {
1355             Retract();
1356             return RPAREN;
1357             break;
1358         }
1359     }
1360     return CONTINUE_TOKEN;
1361 }