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