1 // this file has been generated from 'C:/work/cmajor-mod/cmajor/masm/system/System.Json/Json.lexer' using SoulCm lexer generator scmlg version 5.0.0
   2 
   3 using System;
   4 using System.Collections;
   5 using JsonTokens;
   6 
   7 public class JsonLexer : System.Lex.Lexer
   8 {
   9     public JsonLexer(const uchar* start_const uchar* end_const string& fileName_) : 
  10         base(start_end_fileName_"JsonLexer.classmap")
  11     {
  12         auto classMapResult = System.Lex.GetClassMap(ClassMapName());
  13         if (classMapResult.Error())
  14         {
  15             SetErrorId(classMapResult.GetErrorId());
  16             return;
  17         }
  18         SetClassMap(classMapResult.Value());
  19     }
  20     public override int NextState(int stateuchar c)
  21     {
  22         int cls = GetClass(c);
  23         switch (state)
  24         {
  25             case 0:
  26             {
  27                 switch (cls)
  28                 {
  29                     case 2:
  30                     case 3:
  31                     case 4:
  32                     case 5:
  33                     {
  34                         return 1;
  35                     }
  36                     case 6:
  37                     {
  38                         return 2;
  39                     }
  40                     case 10:
  41                     {
  42                         return 3;
  43                     }
  44                     case 12:
  45                     {
  46                         return 4;
  47                     }
  48                     case 16:
  49                     {
  50                         return 5;
  51                     }
  52                     case 17:
  53                     {
  54                         return 6;
  55                     }
  56                     case 22:
  57                     {
  58                         return 7;
  59                     }
  60                     case 23:
  61                     {
  62                         return 8;
  63                     }
  64                     case 24:
  65                     {
  66                         return 9;
  67                     }
  68                     case 25:
  69                     {
  70                         return 10;
  71                     }
  72                     case 26:
  73                     {
  74                         return 11;
  75                     }
  76                     case 27:
  77                     {
  78                         return 12;
  79                     }
  80                     case 28:
  81                     {
  82                         return 13;
  83                     }
  84                     default:
  85                     {
  86                         return -1;
  87                     }
  88                 }
  89                 break;
  90             }
  91             case 13:
  92             {
  93                 auto prevMatch = token.match;
  94                 token.match = lexeme;
  95                 long tokenId = GetTokenId(8);
  96                 if (tokenId == System.Lex.CONTINUE_TOKEN)
  97                 {
  98                     token.id = System.Lex.CONTINUE_TOKEN;
  99                     return -1;
 100                 }
 101                 else if (tokenId != System.Lex.INVALID_TOKEN)
 102                 {
 103                     token.id = tokenId;
 104                 }
 105                 else
 106                 {
 107                     token.match = prevMatch;
 108                 }
 109                 return -1;
 110             }
 111             case 12:
 112             {
 113                 auto prevMatch = token.match;
 114                 token.match = lexeme;
 115                 long tokenId = GetTokenId(7);
 116                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 117                 {
 118                     token.id = System.Lex.CONTINUE_TOKEN;
 119                     return -1;
 120                 }
 121                 else if (tokenId != System.Lex.INVALID_TOKEN)
 122                 {
 123                     token.id = tokenId;
 124                 }
 125                 else
 126                 {
 127                     token.match = prevMatch;
 128                 }
 129                 return -1;
 130             }
 131             case 11:
 132             {
 133                 auto prevMatch = token.match;
 134                 token.match = lexeme;
 135                 long tokenId = GetTokenId(6);
 136                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 137                 {
 138                     token.id = System.Lex.CONTINUE_TOKEN;
 139                     return -1;
 140                 }
 141                 else if (tokenId != System.Lex.INVALID_TOKEN)
 142                 {
 143                     token.id = tokenId;
 144                 }
 145                 else
 146                 {
 147                     token.match = prevMatch;
 148                 }
 149                 return -1;
 150             }
 151             case 10:
 152             {
 153                 auto prevMatch = token.match;
 154                 token.match = lexeme;
 155                 long tokenId = GetTokenId(5);
 156                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 157                 {
 158                     token.id = System.Lex.CONTINUE_TOKEN;
 159                     return -1;
 160                 }
 161                 else if (tokenId != System.Lex.INVALID_TOKEN)
 162                 {
 163                     token.id = tokenId;
 164                 }
 165                 else
 166                 {
 167                     token.match = prevMatch;
 168                 }
 169                 return -1;
 170             }
 171             case 9:
 172             {
 173                 auto prevMatch = token.match;
 174                 token.match = lexeme;
 175                 long tokenId = GetTokenId(4);
 176                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 177                 {
 178                     token.id = System.Lex.CONTINUE_TOKEN;
 179                     return -1;
 180                 }
 181                 else if (tokenId != System.Lex.INVALID_TOKEN)
 182                 {
 183                     token.id = tokenId;
 184                 }
 185                 else
 186                 {
 187                     token.match = prevMatch;
 188                 }
 189                 return -1;
 190             }
 191             case 8:
 192             {
 193                 auto prevMatch = token.match;
 194                 token.match = lexeme;
 195                 long tokenId = GetTokenId(3);
 196                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 197                 {
 198                     token.id = System.Lex.CONTINUE_TOKEN;
 199                     return -1;
 200                 }
 201                 else if (tokenId != System.Lex.INVALID_TOKEN)
 202                 {
 203                     token.id = tokenId;
 204                 }
 205                 else
 206                 {
 207                     token.match = prevMatch;
 208                 }
 209                 return -1;
 210             }
 211             case 7:
 212             {
 213                 auto prevMatch = token.match;
 214                 token.match = lexeme;
 215                 long tokenId = GetTokenId(2);
 216                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 217                 {
 218                     token.id = System.Lex.CONTINUE_TOKEN;
 219                     return -1;
 220                 }
 221                 else if (tokenId != System.Lex.INVALID_TOKEN)
 222                 {
 223                     token.id = tokenId;
 224                 }
 225                 else
 226                 {
 227                     token.match = prevMatch;
 228                 }
 229                 switch (cls)
 230                 {
 231                     case 22:
 232                     {
 233                         return 7;
 234                     }
 235                     case 18:
 236                     {
 237                         return 14;
 238                     }
 239                     case 19:
 240                     case 20:
 241                     {
 242                         return 15;
 243                     }
 244                     default:
 245                     {
 246                         return -1;
 247                     }
 248                 }
 249                 break;
 250             }
 251             case 15:
 252             {
 253                 switch (cls)
 254                 {
 255                     case 17:
 256                     case 21:
 257                     {
 258                         return 16;
 259                     }
 260                     case 22:
 261                     {
 262                         return 17;
 263                     }
 264                     default:
 265                     {
 266                         return -1;
 267                     }
 268                 }
 269                 break;
 270             }
 271             case 17:
 272             {
 273                 auto prevMatch = token.match;
 274                 token.match = lexeme;
 275                 long tokenId = GetTokenId(2);
 276                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 277                 {
 278                     token.id = System.Lex.CONTINUE_TOKEN;
 279                     return -1;
 280                 }
 281                 else if (tokenId != System.Lex.INVALID_TOKEN)
 282                 {
 283                     token.id = tokenId;
 284                 }
 285                 else
 286                 {
 287                     token.match = prevMatch;
 288                 }
 289                 switch (cls)
 290                 {
 291                     case 22:
 292                     {
 293                         return 17;
 294                     }
 295                     default:
 296                     {
 297                         return -1;
 298                     }
 299                 }
 300                 break;
 301             }
 302             case 16:
 303             {
 304                 switch (cls)
 305                 {
 306                     case 22:
 307                     {
 308                         return 17;
 309                     }
 310                     default:
 311                     {
 312                         return -1;
 313                     }
 314                 }
 315                 break;
 316             }
 317             case 14:
 318             {
 319                 switch (cls)
 320                 {
 321                     case 22:
 322                     {
 323                         return 18;
 324                     }
 325                     default:
 326                     {
 327                         return -1;
 328                     }
 329                 }
 330                 break;
 331             }
 332             case 18:
 333             {
 334                 auto prevMatch = token.match;
 335                 token.match = lexeme;
 336                 long tokenId = GetTokenId(2);
 337                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 338                 {
 339                     token.id = System.Lex.CONTINUE_TOKEN;
 340                     return -1;
 341                 }
 342                 else if (tokenId != System.Lex.INVALID_TOKEN)
 343                 {
 344                     token.id = tokenId;
 345                 }
 346                 else
 347                 {
 348                     token.match = prevMatch;
 349                 }
 350                 switch (cls)
 351                 {
 352                     case 19:
 353                     case 20:
 354                     {
 355                         return 15;
 356                     }
 357                     case 22:
 358                     {
 359                         return 18;
 360                     }
 361                     default:
 362                     {
 363                         return -1;
 364                     }
 365                 }
 366                 break;
 367             }
 368             case 6:
 369             {
 370                 switch (cls)
 371                 {
 372                     case 22:
 373                     {
 374                         return 7;
 375                     }
 376                     default:
 377                     {
 378                         return -1;
 379                     }
 380                 }
 381                 break;
 382             }
 383             case 5:
 384             {
 385                 switch (cls)
 386                 {
 387                     case 29:
 388                     {
 389                         return 19;
 390                     }
 391                     default:
 392                     {
 393                         return -1;
 394                     }
 395                 }
 396                 break;
 397             }
 398             case 19:
 399             {
 400                 switch (cls)
 401                 {
 402                     case 30:
 403                     {
 404                         return 20;
 405                     }
 406                     default:
 407                     {
 408                         return -1;
 409                     }
 410                 }
 411                 break;
 412             }
 413             case 20:
 414             {
 415                 switch (cls)
 416                 {
 417                     case 31:
 418                     {
 419                         return 21;
 420                     }
 421                     default:
 422                     {
 423                         return -1;
 424                     }
 425                 }
 426                 break;
 427             }
 428             case 21:
 429             {
 430                 switch (cls)
 431                 {
 432                     case 19:
 433                     {
 434                         return 22;
 435                     }
 436                     default:
 437                     {
 438                         return -1;
 439                     }
 440                 }
 441                 break;
 442             }
 443             case 22:
 444             {
 445                 auto prevMatch = token.match;
 446                 token.match = lexeme;
 447                 long tokenId = GetTokenId(10);
 448                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 449                 {
 450                     token.id = System.Lex.CONTINUE_TOKEN;
 451                     return -1;
 452                 }
 453                 else if (tokenId != System.Lex.INVALID_TOKEN)
 454                 {
 455                     token.id = tokenId;
 456                 }
 457                 else
 458                 {
 459                     token.match = prevMatch;
 460                 }
 461                 return -1;
 462             }
 463             case 4:
 464             {
 465                 switch (cls)
 466                 {
 467                     case 11:
 468                     {
 469                         return 23;
 470                     }
 471                     default:
 472                     {
 473                         return -1;
 474                     }
 475                 }
 476                 break;
 477             }
 478             case 23:
 479             {
 480                 switch (cls)
 481                 {
 482                     case 13:
 483                     {
 484                         return 24;
 485                     }
 486                     default:
 487                     {
 488                         return -1;
 489                     }
 490                 }
 491                 break;
 492             }
 493             case 24:
 494             {
 495                 switch (cls)
 496                 {
 497                     case 19:
 498                     {
 499                         return 25;
 500                     }
 501                     default:
 502                     {
 503                         return -1;
 504                     }
 505                 }
 506                 break;
 507             }
 508             case 25:
 509             {
 510                 auto prevMatch = token.match;
 511                 token.match = lexeme;
 512                 long tokenId = GetTokenId(9);
 513                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 514                 {
 515                     token.id = System.Lex.CONTINUE_TOKEN;
 516                     return -1;
 517                 }
 518                 else if (tokenId != System.Lex.INVALID_TOKEN)
 519                 {
 520                     token.id = tokenId;
 521                 }
 522                 else
 523                 {
 524                     token.match = prevMatch;
 525                 }
 526                 return -1;
 527             }
 528             case 3:
 529             {
 530                 switch (cls)
 531                 {
 532                     case 13:
 533                     {
 534                         return 26;
 535                     }
 536                     default:
 537                     {
 538                         return -1;
 539                     }
 540                 }
 541                 break;
 542             }
 543             case 26:
 544             {
 545                 switch (cls)
 546                 {
 547                     case 30:
 548                     {
 549                         return 27;
 550                     }
 551                     default:
 552                     {
 553                         return -1;
 554                     }
 555                 }
 556                 break;
 557             }
 558             case 27:
 559             {
 560                 switch (cls)
 561                 {
 562                     case 30:
 563                     {
 564                         return 28;
 565                     }
 566                     default:
 567                     {
 568                         return -1;
 569                     }
 570                 }
 571                 break;
 572             }
 573             case 28:
 574             {
 575                 auto prevMatch = token.match;
 576                 token.match = lexeme;
 577                 long tokenId = GetTokenId(11);
 578                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 579                 {
 580                     token.id = System.Lex.CONTINUE_TOKEN;
 581                     return -1;
 582                 }
 583                 else if (tokenId != System.Lex.INVALID_TOKEN)
 584                 {
 585                     token.id = tokenId;
 586                 }
 587                 else
 588                 {
 589                     token.match = prevMatch;
 590                 }
 591                 return -1;
 592             }
 593             case 2:
 594             {
 595                 switch (cls)
 596                 {
 597                     case 0:
 598                     case 1:
 599                     case 2:
 600                     case 3:
 601                     case 4:
 602                     case 5:
 603                     case 7:
 604                     case 9:
 605                     case 10:
 606                     case 11:
 607                     case 12:
 608                     case 13:
 609                     case 14:
 610                     case 15:
 611                     case 16:
 612                     case 17:
 613                     case 18:
 614                     case 19:
 615                     case 20:
 616                     case 21:
 617                     case 22:
 618                     case 23:
 619                     case 24:
 620                     case 25:
 621                     case 26:
 622                     case 27:
 623                     case 28:
 624                     case 29:
 625                     case 30:
 626                     case 31:
 627                     {
 628                         return 29;
 629                     }
 630                     case 6:
 631                     {
 632                         return 30;
 633                     }
 634                     case 8:
 635                     {
 636                         return 31;
 637                     }
 638                     default:
 639                     {
 640                         return -1;
 641                     }
 642                 }
 643                 break;
 644             }
 645             case 31:
 646             {
 647                 switch (cls)
 648                 {
 649                     case 6:
 650                     case 8:
 651                     case 9:
 652                     case 10:
 653                     case 11:
 654                     case 12:
 655                     case 15:
 656                     case 16:
 657                     {
 658                         return 32;
 659                     }
 660                     case 13:
 661                     {
 662                         return 33;
 663                     }
 664                     default:
 665                     {
 666                         return -1;
 667                     }
 668                 }
 669                 break;
 670             }
 671             case 33:
 672             {
 673                 switch (cls)
 674                 {
 675                     case 14:
 676                     case 15:
 677                     case 16:
 678                     case 19:
 679                     case 20:
 680                     case 22:
 681                     case 29:
 682                     {
 683                         return 34;
 684                     }
 685                     default:
 686                     {
 687                         return -1;
 688                     }
 689                 }
 690                 break;
 691             }
 692             case 34:
 693             {
 694                 switch (cls)
 695                 {
 696                     case 14:
 697                     case 15:
 698                     case 16:
 699                     case 19:
 700                     case 20:
 701                     case 22:
 702                     case 29:
 703                     {
 704                         return 35;
 705                     }
 706                     default:
 707                     {
 708                         return -1;
 709                     }
 710                 }
 711                 break;
 712             }
 713             case 35:
 714             {
 715                 switch (cls)
 716                 {
 717                     case 14:
 718                     case 15:
 719                     case 16:
 720                     case 19:
 721                     case 20:
 722                     case 22:
 723                     case 29:
 724                     {
 725                         return 36;
 726                     }
 727                     default:
 728                     {
 729                         return -1;
 730                     }
 731                 }
 732                 break;
 733             }
 734             case 36:
 735             {
 736                 switch (cls)
 737                 {
 738                     case 14:
 739                     case 15:
 740                     case 16:
 741                     case 19:
 742                     case 20:
 743                     case 22:
 744                     case 29:
 745                     {
 746                         return 37;
 747                     }
 748                     default:
 749                     {
 750                         return -1;
 751                     }
 752                 }
 753                 break;
 754             }
 755             case 37:
 756             {
 757                 switch (cls)
 758                 {
 759                     case 0:
 760                     case 1:
 761                     case 2:
 762                     case 3:
 763                     case 4:
 764                     case 5:
 765                     case 7:
 766                     case 9:
 767                     case 10:
 768                     case 11:
 769                     case 12:
 770                     case 13:
 771                     case 14:
 772                     case 15:
 773                     case 16:
 774                     case 17:
 775                     case 18:
 776                     case 19:
 777                     case 20:
 778                     case 21:
 779                     case 22:
 780                     case 23:
 781                     case 24:
 782                     case 25:
 783                     case 26:
 784                     case 27:
 785                     case 28:
 786                     case 29:
 787                     case 30:
 788                     case 31:
 789                     {
 790                         return 29;
 791                     }
 792                     case 6:
 793                     {
 794                         return 30;
 795                     }
 796                     case 8:
 797                     {
 798                         return 31;
 799                     }
 800                     default:
 801                     {
 802                         return -1;
 803                     }
 804                 }
 805                 break;
 806             }
 807             case 32:
 808             {
 809                 switch (cls)
 810                 {
 811                     case 0:
 812                     case 1:
 813                     case 2:
 814                     case 3:
 815                     case 4:
 816                     case 5:
 817                     case 7:
 818                     case 9:
 819                     case 10:
 820                     case 11:
 821                     case 12:
 822                     case 13:
 823                     case 14:
 824                     case 15:
 825                     case 16:
 826                     case 17:
 827                     case 18:
 828                     case 19:
 829                     case 20:
 830                     case 21:
 831                     case 22:
 832                     case 23:
 833                     case 24:
 834                     case 25:
 835                     case 26:
 836                     case 27:
 837                     case 28:
 838                     case 29:
 839                     case 30:
 840                     case 31:
 841                     {
 842                         return 29;
 843                     }
 844                     case 6:
 845                     {
 846                         return 30;
 847                     }
 848                     case 8:
 849                     {
 850                         return 31;
 851                     }
 852                     default:
 853                     {
 854                         return -1;
 855                     }
 856                 }
 857                 break;
 858             }
 859             case 30:
 860             {
 861                 auto prevMatch = token.match;
 862                 token.match = lexeme;
 863                 long tokenId = GetTokenId(1);
 864                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 865                 {
 866                     token.id = System.Lex.CONTINUE_TOKEN;
 867                     return -1;
 868                 }
 869                 else if (tokenId != System.Lex.INVALID_TOKEN)
 870                 {
 871                     token.id = tokenId;
 872                 }
 873                 else
 874                 {
 875                     token.match = prevMatch;
 876                 }
 877                 return -1;
 878             }
 879             case 29:
 880             {
 881                 switch (cls)
 882                 {
 883                     case 0:
 884                     case 1:
 885                     case 2:
 886                     case 3:
 887                     case 4:
 888                     case 5:
 889                     case 7:
 890                     case 9:
 891                     case 10:
 892                     case 11:
 893                     case 12:
 894                     case 13:
 895                     case 14:
 896                     case 15:
 897                     case 16:
 898                     case 17:
 899                     case 18:
 900                     case 19:
 901                     case 20:
 902                     case 21:
 903                     case 22:
 904                     case 23:
 905                     case 24:
 906                     case 25:
 907                     case 26:
 908                     case 27:
 909                     case 28:
 910                     case 29:
 911                     case 30:
 912                     case 31:
 913                     {
 914                         return 29;
 915                     }
 916                     case 6:
 917                     {
 918                         return 30;
 919                     }
 920                     case 8:
 921                     {
 922                         return 31;
 923                     }
 924                     default:
 925                     {
 926                         return -1;
 927                     }
 928                 }
 929                 break;
 930             }
 931             case 1:
 932             {
 933                 auto prevMatch = token.match;
 934                 token.match = lexeme;
 935                 long tokenId = GetTokenId(0);
 936                 if (tokenId == System.Lex.CONTINUE_TOKEN)
 937                 {
 938                     token.id = System.Lex.CONTINUE_TOKEN;
 939                     return -1;
 940                 }
 941                 else if (tokenId != System.Lex.INVALID_TOKEN)
 942                 {
 943                     token.id = tokenId;
 944                 }
 945                 else
 946                 {
 947                     token.match = prevMatch;
 948                 }
 949                 switch (cls)
 950                 {
 951                     case 2:
 952                     case 3:
 953                     case 4:
 954                     case 5:
 955                     {
 956                         return 1;
 957                     }
 958                     default:
 959                     {
 960                         return -1;
 961                     }
 962                 }
 963                 break;
 964             }
 965         }
 966         return -1;
 967     }
 968     public long GetTokenId(int ruleIndex)
 969     {
 970         switch (ruleIndex)
 971         {
 972             case 0:
 973             {
 974                 Retract();
 975                 break;
 976             }
 977             case 1:
 978             {
 979                 Retract();
 980                 return STRING;
 981                 break;
 982             }
 983             case 2:
 984             {
 985                 Retract();
 986                 return NUMBER;
 987                 break;
 988             }
 989             case 3:
 990             {
 991                 Retract();
 992                 return LBRACKET;
 993                 break;
 994             }
 995             case 4:
 996             {
 997                 Retract();
 998                 return RBRACKET;
 999                 break;
1000             }
1001             case 5:
1002             {
1003                 Retract();
1004                 return LBRACE;
1005                 break;
1006             }
1007             case 6:
1008             {
1009                 Retract();
1010                 return RBRACE;
1011                 break;
1012             }
1013             case 7:
1014             {
1015                 Retract();
1016                 return COMMA;
1017                 break;
1018             }
1019             case 8:
1020             {
1021                 Retract();
1022                 return COLON;
1023                 break;
1024             }
1025             case 9:
1026             {
1027                 Retract();
1028                 return TRUE;
1029                 break;
1030             }
1031             case 10:
1032             {
1033                 Retract();
1034                 return FALSE;
1035                 break;
1036             }
1037             case 11:
1038             {
1039                 Retract();
1040                 return NULL;
1041                 break;
1042             }
1043         }
1044         return System.Lex.CONTINUE_TOKEN;
1045     }
1046     public JsonLexer_Variables vars;
1047 }
1048 
1049 public class JsonLexer_Variables
1050 {
1051     public JsonLexer_Variables()
1052     {
1053     }
1054 }