1 
  
      2 
  
      3 using 
  
      4 using System.Lex;
  
      5 using System.Parsing;
  
      6 
  
      7 unnamed_ns_65043A6FB359234B3B110F9ACDB648C6438C78E1;using System;using System.Lex;using System.Parsing;
  
      8 {
  
      9     public const System.Parsing.Range[] s0 = [{ 9, 9},  { 10, 10},  { 13, 13},  { 32, 55295u}, { 57344u, 65533u}, {65536, 1114111}];
  
     10 
  
     11     public const System.Parsing.Range[] s1 = [{ 32, 32},  { 9, 9},  { 13, 13},  { 10, 10}];
  
     12 
  
     13     public const System.Parsing.Range[] s2 = [{ 58, 58},  { 65, 90},  { 95, 95},  { 97, 122},  { 192u, 214u}, {216u, 246u}, {248u, 767}, { 880, 893},  { 895, 8191},  { 8204, 8205},  { 8304, 8591},  { 11264, 12271},  { 12289, 55295u}, { 63744u, 64975u}, {65008u, 65533u}, {65536, 983039}];
  
     14 
  
     15     public const System.Parsing.Range[] s3 = [{ 45, 45},  { 46, 46},  { 48, 57},  { 183u, 183u}, {768, 879},  { 8255, 8256}];
  
     16 
  
     17     public const int[] s4 = [60, 63, 120, 109, 108];
  
     18 
  
     19     public const int[] s5 = [63, 62];
  
     20 
  
     21     public const int[] s6 = [118, 101, 114, 115, 105, 111, 110];
  
     22 
  
     23     public const System.Parsing.Range[] s7 = [{ 48, 57}];
  
     24 
  
     25     public const int[] s8 = [101, 110, 99, 111, 100, 105, 110, 103];
  
     26 
  
     27     public const System.Parsing.Range[] s9 = [{ 65, 90},  { 97, 122}];
  
     28 
  
     29     public const System.Parsing.Range[] s10 = [{ 65, 90},  { 97, 122},  { 48, 57},  { 46, 46},  { 95, 95},  { 45, 45}];
  
     30 
  
     31     public const int[] s11 = [115, 116, 97, 110, 100, 97, 108, 111, 110, 101];
  
     32 
  
     33     public const int[] s12 = [60, 33, 68, 79, 67, 84, 89, 80, 69];
  
     34 
  
     35     public const int[] s13 = [83, 89, 83, 84, 69, 77];
  
     36 
  
     37     public const int[] s14 = [80, 85, 66, 76, 73, 67];
  
     38 
  
     39     public const System.Parsing.Range[] s15 = [{ 34, 34}];
  
     40 
  
     41     public const System.Parsing.Range[] s16 = [{ 39, 39}];
  
     42 
  
     43     public const System.Parsing.Range[] s17 = [{ 32, 32},  { 13, 13},  { 10, 10}];
  
     44 
  
     45     public const System.Parsing.Range[] s18 = [{ 97, 122},  { 65, 90},  { 48, 57}];
  
     46 
  
     47     public const System.Parsing.Range[] s19 = [{ 45, 45},  { 39, 39},  { 40, 40},  { 41, 41},  { 43, 43},  { 44, 44},  { 46, 46},  { 47, 47},  { 58, 58},  { 61, 61},  { 63, 63},  { 59, 59},  { 33, 33},  { 42, 42},  { 35, 35},  { 64, 64},  { 36, 36},  { 95, 95},  { 37, 37}];
  
     48 
  
     49     public const int[] s20 = [60, 33, 69, 76, 69, 77, 69, 78, 84];
  
     50 
  
     51     public const int[] s21 = [69, 77, 80, 84, 89];
  
     52 
  
     53     public const int[] s22 = [65, 78, 89];
  
     54 
  
     55     public const int[] s23 = [35, 80, 67, 68, 65, 84, 65];
  
     56 
  
     57     public const int[] s24 = [41, 42];
  
     58 
  
     59     public const int[] s25 = [35, 80, 67, 68, 65, 84, 65];
  
     60 
  
     61     public const int[] s26 = [60, 33, 65, 84, 84, 76, 73, 83, 84];
  
     62 
  
     63     public const int[] s27 = [67, 68, 65, 84, 65];
  
     64 
  
     65     public const int[] s28 = [73, 68];
  
     66 
  
     67     public const int[] s29 = [73, 68, 82, 69, 70];
  
     68 
  
     69     public const int[] s30 = [73, 68, 82, 69, 70, 83];
  
     70 
  
     71     public const int[] s31 = [69, 78, 84, 73, 84, 89];
  
     72 
  
     73     public const int[] s32 = [69, 78, 84, 73, 84, 73, 69, 83];
  
     74 
  
     75     public const int[] s33 = [78, 77, 84, 79, 75, 69, 78];
  
     76 
  
     77     public const int[] s34 = [78, 77, 84, 79, 75, 69, 78, 83];
  
     78 
  
     79     public const int[] s35 = [78, 79, 84, 65, 84, 73, 79, 78];
  
     80 
  
     81     public const int[] s36 = [35, 82, 69, 81, 85, 73, 82, 69, 68];
  
     82 
  
     83     public const int[] s37 = [35, 73, 77, 80, 76, 73, 69, 68];
  
     84 
  
     85     public const int[] s38 = [35, 70, 73, 88, 69, 68];
  
     86 
  
     87     public const int[] s39 = [60, 33, 69, 78, 84, 73, 84, 89];
  
     88 
  
     89     public const int[] s40 = [60, 33, 69, 78, 84, 73, 84, 89];
  
     90 
  
     91     public const System.Parsing.Range[] s41 = [{ 37, 37},  { 38, 38},  { 34, 34}];
  
     92 
  
     93     public const System.Parsing.Range[] s42 = [{ 37, 37},  { 38, 38},  { 39, 39}];
  
     94 
  
     95     public const int[] s43 = [78, 68, 65, 84, 65];
  
     96 
  
     97     public const int[] s44 = [60, 33, 78, 79, 84, 65, 84, 73, 79, 78];
  
     98 
  
     99     public const int[] s45 = [80, 85, 66, 76, 73, 67];
  
    100 
  
    101     public const int[] s46 = [47, 62];
  
    102 
  
    103     public const int[] s47 = [60, 47];
  
    104 
  
    105     public const System.Parsing.Range[] s48 = [{ 60, 60},  { 38, 38}];
  
    106 
  
    107     public const System.Parsing.Range[] s49 = [{ 60, 60},  { 38, 38}];
  
    108 
  
    109     public const int[] s50 = [93, 93, 62];
  
    110 
  
    111     public const System.Parsing.Range[] s51 = [{ 60, 60},  { 38, 38}];
  
    112 
  
    113     public const int[] s52 = [60, 33, 91, 67, 68, 65, 84, 65, 91];
  
    114 
  
    115     public const int[] s53 = [93, 93, 62];
  
    116 
  
    117     public const int[] s54 = [93, 93, 62];
  
    118 
  
    119     public const System.Parsing.Range[] s55 = [{ 60, 60},  { 38, 38},  { 34, 34}];
  
    120 
  
    121     public const System.Parsing.Range[] s56 = [{ 60, 60},  { 38, 38},  { 39, 39}];
  
    122 
  
    123     public const System.Parsing.Range[] s57 = [{ 48, 57}];
  
    124 
  
    125     public const System.Parsing.Range[] s58 = [{ 48, 57},  { 97, 102},  { 65, 70}];
  
    126 
  
    127     public const int[] s59 = [38, 35];
  
    128 
  
    129     public const int[] s60 = [38, 35, 120];
  
    130 
  
    131     public const int[] s61 = [60, 33, 45, 45];
  
    132 
  
    133     public const int[] s62 = [45, 45, 62];
  
    134 
  
    135     public const int[] s63 = [60, 63];
  
    136 
  
    137     public const int[] s64 = [63, 62];
  
    138 
  
    139     public const int[] s65 = [63, 62];
  
    140 
  
    141     public const System.Parsing.Range[] s66 = [{ 120, 120},  { 88, 88}];
  
    142 
  
    143     public const System.Parsing.Range[] s67 = [{ 109, 109},  { 77, 77}];
  
    144 
  
    145     public const System.Parsing.Range[] s68 = [{ 108, 108},  { 76, 76}];
  
    146 
  
    147     public const int[] s69 = [34, 121, 101, 115, 34];
  
    148 
  
    149     public const int[] s70 = [34, 110, 111, 34];
  
    150 
  
    151 }
  
    152 
  
    153 namespace System.Xml
  
    154 {
  
    155     public static class XmlParser<LexerT>
  
    156     {
  
    157         public static System.Result<bool> Parse(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
    158         {
  
    159             System.UniquePtr<System.Parsing.Value<bool>> value;
  
    160             #if (DEBUG)
  
    161             if (lexer.Log() != null)
  
    162             {
  
    163                 auto result = lexer.Log()->WriteBeginRule(u"parse");
  
    164                 if (result.Error())
  
    165                 {
  
    166                     return System.Result<bool>(System.ErrorId(result.GetErrorId()));
  
    167                 }
  
    168                 lexer.Log()->IncIndent();
  
    169             }
  
    170             #endif
  
    171             auto incResult0 = ++lexer;
  
    172             if (incResult0.Error())
  
    173             {
  
    174                 return System.Result<bool>(System.ErrorId(incResult0.GetErrorId()));
  
    175             }
  
    176             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Document(lexer, processor);
  
    177             if (matchResult.Error())
  
    178             {
  
    179                 return System.Result<bool>(System.ErrorId(matchResult.GetErrorId()));
  
    180             }
  
    181             System.Parsing.Match match = matchResult.Value();
  
    182             value.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
    183             #if (DEBUG)
  
    184             if (lexer.Log() != null)
  
    185             {
  
    186                 lexer.Log()->DecIndent();
  
    187                 auto result = lexer.Log()->WriteEndRule(u"parse");
  
    188                 if (result.Error())
  
    189                 {
  
    190                     return System.Result<bool>(System.ErrorId(result.GetErrorId()));
  
    191                 }
  
    192             }
  
    193             #endif
  
    194             if (match.hit)
  
    195             {
  
    196                 if (*lexer == System.Lex.END_TOKEN)
  
    197                 {
  
    198                     return System.Result<bool>(value->value);
  
    199                 }
  
    200                 else
  
    201                 {
  
    202                     return System.Result<bool>(lexer.GetFarthestError());
  
    203                 }
  
    204             }
  
    205             else
  
    206             {
  
    207                 return System.Result<bool>(lexer.GetFarthestError());
  
    208             }
  
    209         }
  
    210         public static System.Result<System.Parsing.Match> Document(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
    211         {
  
    212             #if (DEBUG)
  
    213             long parser_debug_match_pos = 0;
  
    214             bool parser_debug_write_to_log = lexer.Log() != null;
  
    215             if (parser_debug_write_to_log)
  
    216             {
  
    217                 parser_debug_match_pos = lexer.GetPos();
  
    218                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Document");
  
    219                 if (result.Error())
  
    220                 {
  
    221                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    222                 }
  
    223             }
  
    224             #endif
  
    225             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475905);
  
    226             System.UniquePtr<System.Parsing.Value<bool>> prolog;
  
    227             System.UniquePtr<System.Parsing.Value<bool>> element;
  
    228             System.UniquePtr<System.Parsing.Value<bool>> misc;
  
    229             System.Parsing.Match match(false);
  
    230             System.Parsing.Match* parentMatch0 = &match;
  
    231             {
  
    232                 System.Parsing.Match match(false);
  
    233                 System.Parsing.Match* parentMatch1 = &match;
  
    234                 {
  
    235                     long pos = lexer.GetPos();
  
    236                     System.Parsing.Match match(true);
  
    237                     if (match.hit)
  
    238                     {
  
    239                         auto result = processor->StartDocument(lexer.GetSpan(pos), lexer.FileIndex());
  
    240                         if (result.Error())
  
    241                         {
  
    242                             return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
    243                         }
  
    244                     }
  
    245                     *parentMatch1 = match;
  
    246                 }
  
    247                 *parentMatch0 = match;
  
    248             }
  
    249             if (match.hit)
  
    250             {
  
    251                 System.Parsing.Match match(false);
  
    252                 System.Parsing.Match* parentMatch2 = &match;
  
    253                 {
  
    254                     System.Parsing.Match match(false);
  
    255                     System.Parsing.Match* parentMatch3 = &match;
  
    256                     {
  
    257                         long pos = lexer.GetPos();
  
    258                         System.Parsing.Match match(false);
  
    259                         System.Parsing.Match* parentMatch4 = &match;
  
    260                         {
  
    261                             System.Parsing.Match match(false);
  
    262                             System.Parsing.Match* parentMatch5 = &match;
  
    263                             {
  
    264                                 System.Parsing.Match match(false);
  
    265                                 System.Parsing.Match* parentMatch6 = &match;
  
    266                                 {
  
    267                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Prolog(lexer, processor);
  
    268                                     if (matchResult.Error())
  
    269                                     {
  
    270                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    271                                     }
  
    272                                     System.Parsing.Match match = matchResult.Value();
  
    273                                     prolog.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
    274                                     *parentMatch6 = match;
  
    275                                 }
  
    276                                 if (match.hit)
  
    277                                 {
  
    278                                     System.Parsing.Match match(false);
  
    279                                     System.Parsing.Match* parentMatch7 = &match;
  
    280                                     {
  
    281                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Element(lexer, processor);
  
    282                                         if (matchResult.Error())
  
    283                                         {
  
    284                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    285                                         }
  
    286                                         System.Parsing.Match match = matchResult.Value();
  
    287                                         element.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
    288                                         *parentMatch7 = match;
  
    289                                     }
  
    290                                     *parentMatch6 = match;
  
    291                                 }
  
    292                                 *parentMatch5 = match;
  
    293                             }
  
    294                             if (match.hit)
  
    295                             {
  
    296                                 System.Parsing.Match match(false);
  
    297                                 System.Parsing.Match* parentMatch8 = &match;
  
    298                                 {
  
    299                                     System.Parsing.Match match(true);
  
    300                                     System.Parsing.Match* parentMatch9 = &match;
  
    301                                     {
  
    302                                         while (true)
  
    303                                         {
  
    304                                             long save = lexer.GetPos();
  
    305                                             {
  
    306                                                 System.Parsing.Match match(false);
  
    307                                                 System.Parsing.Match* parentMatch10 = &match;
  
    308                                                 {
  
    309                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Misc(lexer, processor);
  
    310                                                     if (matchResult.Error())
  
    311                                                     {
  
    312                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    313                                                     }
  
    314                                                     System.Parsing.Match match = matchResult.Value();
  
    315                                                     misc.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
    316                                                     *parentMatch10 = match;
  
    317                                                 }
  
    318                                                 if (match.hit)
  
    319                                                 {
  
    320                                                     *parentMatch9 = match;
  
    321                                                 }
  
    322                                                 else
  
    323                                                 {
  
    324                                                     lexer.SetPos(save);
  
    325                                                     break;
  
    326                                                 }
  
    327                                             }
  
    328                                         }
  
    329                                     }
  
    330                                     *parentMatch8 = match;
  
    331                                 }
  
    332                                 *parentMatch5 = match;
  
    333                             }
  
    334                             *parentMatch4 = match;
  
    335                         }
  
    336                         if (match.hit)
  
    337                         {
  
    338                             #if (DEBUG)
  
    339                                 if (parser_debug_write_to_log)
  
    340                                 {
  
    341                                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Document");
  
    342                                     if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    343                                 }
  
    344                             #endif
  
    345                             auto result = processor->EndDocument();
  
    346                             if (result.Error())
  
    347                             {
  
    348                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
    349                             }
  
    350                             return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
    351                         }
  
    352                         *parentMatch3 = match;
  
    353                     }
  
    354                     *parentMatch2 = match;
  
    355                 }
  
    356                 *parentMatch0 = match;
  
    357             }
  
    358             #if (DEBUG)
  
    359             if (parser_debug_write_to_log)
  
    360             {
  
    361                 if (match.hit)
  
    362                 {
  
    363                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Document");
  
    364                     if (result.Error())
  
    365                     {
  
    366                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    367                     }
  
    368                 }
  
    369                 else
  
    370                 {
  
    371                     auto result = System.Lex.WriteFailureToLog(lexer, u"Document");
  
    372                     if (result.Error())
  
    373                     {
  
    374                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    375                     }
  
    376                 }
  
    377             }
  
    378             #endif
  
    379             if (!match.hit)
  
    380             {
  
    381                 match.value = null;
  
    382             }
  
    383             return System.Result<System.Parsing.Match>(match);
  
    384         }
  
    385         public static System.Result<System.Parsing.Match> Char(LexerT& lexer)
  
    386         {
  
    387             #if (DEBUG)
  
    388             long parser_debug_match_pos = 0;
  
    389             bool parser_debug_write_to_log = lexer.Log() != null;
  
    390             if (parser_debug_write_to_log)
  
    391             {
  
    392                 parser_debug_match_pos = lexer.GetPos();
  
    393                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Char");
  
    394                 if (result.Error())
  
    395                 {
  
    396                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    397                 }
  
    398             }
  
    399             #endif
  
    400             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475906);
  
    401             System.Parsing.Match match(false);
  
    402             System.Parsing.Match* parentMatch0 = &match;
  
    403             {
  
    404                 long pos = lexer.GetPos();
  
    405                 System.Parsing.Match match(false);
  
    406                 System.Parsing.Match* parentMatch1 = &match;
  
    407                 {
  
    408                     System.Parsing.Match match(false);
  
    409                     for (const System.Parsing.Range& range : s0)
  
    410                     {
  
    411                         if (*lexer >= range.first && *lexer <= range.last)
  
    412                         {
  
    413                             match.hit = true;
  
    414                             auto incResult0 = ++lexer;
  
    415                             if (incResult0.Error())
  
    416                             {
  
    417                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
    418                             }
  
    419                             break;
  
    420                         }
  
    421                     }
  
    422                     *parentMatch1 = match;
  
    423                 }
  
    424                 if (match.hit)
  
    425                 {
  
    426                     #if (DEBUG)
  
    427                         if (parser_debug_write_to_log)
  
    428                         {
  
    429                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Char");
  
    430                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    431                         }
  
    432                     #endif
  
    433                     Token token = lexer.GetToken(pos);
  
    434                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<uchar>(cast<uchar>(token.id))));
  
    435                 }
  
    436                 *parentMatch0 = match;
  
    437             }
  
    438             #if (DEBUG)
  
    439             if (parser_debug_write_to_log)
  
    440             {
  
    441                 if (match.hit)
  
    442                 {
  
    443                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Char");
  
    444                     if (result.Error())
  
    445                     {
  
    446                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    447                     }
  
    448                 }
  
    449                 else
  
    450                 {
  
    451                     auto result = System.Lex.WriteFailureToLog(lexer, u"Char");
  
    452                     if (result.Error())
  
    453                     {
  
    454                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    455                     }
  
    456                 }
  
    457             }
  
    458             #endif
  
    459             if (!match.hit)
  
    460             {
  
    461                 match.value = null;
  
    462             }
  
    463             return System.Result<System.Parsing.Match>(match);
  
    464         }
  
    465         public static System.Result<System.Parsing.Match> S(LexerT& lexer)
  
    466         {
  
    467             #if (DEBUG)
  
    468             long parser_debug_match_pos = 0;
  
    469             bool parser_debug_write_to_log = lexer.Log() != null;
  
    470             if (parser_debug_write_to_log)
  
    471             {
  
    472                 parser_debug_match_pos = lexer.GetPos();
  
    473                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"S");
  
    474                 if (result.Error())
  
    475                 {
  
    476                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    477                 }
  
    478             }
  
    479             #endif
  
    480             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475907);
  
    481             System.Parsing.Match match(false);
  
    482             System.Parsing.Match* parentMatch0 = &match;
  
    483             {
  
    484                 long pos = lexer.GetPos();
  
    485                 System.Parsing.Match match(false);
  
    486                 System.Parsing.Match* parentMatch1 = &match;
  
    487                 {
  
    488                     System.Parsing.Match match(false);
  
    489                     System.Parsing.Match* parentMatch2 = &match;
  
    490                     {
  
    491                         System.Parsing.Match match(false);
  
    492                         for (const System.Parsing.Range& range : s1)
  
    493                         {
  
    494                             if (*lexer >= range.first && *lexer <= range.last)
  
    495                             {
  
    496                                 match.hit = true;
  
    497                                 auto incResult0 = ++lexer;
  
    498                                 if (incResult0.Error())
  
    499                                 {
  
    500                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
    501                                 }
  
    502                                 break;
  
    503                             }
  
    504                         }
  
    505                         *parentMatch2 = match;
  
    506                     }
  
    507                     if (match.hit)
  
    508                     {
  
    509                         System.Parsing.Match match(true);
  
    510                         System.Parsing.Match* parentMatch3 = &match;
  
    511                         while (true)
  
    512                         {
  
    513                             long save = lexer.GetPos();
  
    514                             {
  
    515                                 System.Parsing.Match match(false);
  
    516                                 for (const System.Parsing.Range& range : s1)
  
    517                                 {
  
    518                                     if (*lexer >= range.first && *lexer <= range.last)
  
    519                                     {
  
    520                                         match.hit = true;
  
    521                                         auto incResult1 = ++lexer;
  
    522                                         if (incResult1.Error())
  
    523                                         {
  
    524                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
    525                                         }
  
    526                                         break;
  
    527                                     }
  
    528                                 }
  
    529                                 if (match.hit)
  
    530                                 {
  
    531                                     *parentMatch3 = match;
  
    532                                 }
  
    533                                 else
  
    534                                 {
  
    535                                     lexer.SetPos(save);
  
    536                                     break;
  
    537                                 }
  
    538                             }
  
    539                         }
  
    540                     }
  
    541                     *parentMatch1 = match;
  
    542                 }
  
    543                 if (match.hit)
  
    544                 {
  
    545                     #if (DEBUG)
  
    546                         if (parser_debug_write_to_log)
  
    547                         {
  
    548                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"S");
  
    549                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    550                         }
  
    551                     #endif
  
    552                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
    553                 }
  
    554                 *parentMatch0 = match;
  
    555             }
  
    556             #if (DEBUG)
  
    557             if (parser_debug_write_to_log)
  
    558             {
  
    559                 if (match.hit)
  
    560                 {
  
    561                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"S");
  
    562                     if (result.Error())
  
    563                     {
  
    564                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    565                     }
  
    566                 }
  
    567                 else
  
    568                 {
  
    569                     auto result = System.Lex.WriteFailureToLog(lexer, u"S");
  
    570                     if (result.Error())
  
    571                     {
  
    572                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    573                     }
  
    574                 }
  
    575             }
  
    576             #endif
  
    577             if (!match.hit)
  
    578             {
  
    579                 match.value = null;
  
    580             }
  
    581             return System.Result<System.Parsing.Match>(match);
  
    582         }
  
    583         public static System.Result<System.Parsing.Match> NameStartChar(LexerT& lexer)
  
    584         {
  
    585             #if (DEBUG)
  
    586             long parser_debug_match_pos = 0;
  
    587             bool parser_debug_write_to_log = lexer.Log() != null;
  
    588             if (parser_debug_write_to_log)
  
    589             {
  
    590                 parser_debug_match_pos = lexer.GetPos();
  
    591                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"NameStartChar");
  
    592                 if (result.Error())
  
    593                 {
  
    594                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    595                 }
  
    596             }
  
    597             #endif
  
    598             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475908);
  
    599             System.Parsing.Match match(false);
  
    600             System.Parsing.Match* parentMatch0 = &match;
  
    601             {
  
    602                 System.Parsing.Match match(false);
  
    603                 System.Parsing.Match* parentMatch1 = &match;
  
    604                 {
  
    605                     long pos = lexer.GetPos();
  
    606                     System.Parsing.Match match(false);
  
    607                     for (const System.Parsing.Range& range : s2)
  
    608                     {
  
    609                         if (*lexer >= range.first && *lexer <= range.last)
  
    610                         {
  
    611                             match.hit = true;
  
    612                             auto incResult0 = ++lexer;
  
    613                             if (incResult0.Error())
  
    614                             {
  
    615                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
    616                             }
  
    617                             break;
  
    618                         }
  
    619                     }
  
    620                     if (match.hit)
  
    621                     {
  
    622                         #if (DEBUG)
  
    623                             if (parser_debug_write_to_log)
  
    624                             {
  
    625                                 auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NameStartChar");
  
    626                                 if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    627                             }
  
    628                         #endif
  
    629                         return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<uchar>(lexer.GetToken(pos).Chr())));
  
    630                     }
  
    631                     *parentMatch1 = match;
  
    632                 }
  
    633                 *parentMatch0 = match;
  
    634             }
  
    635             #if (DEBUG)
  
    636             if (parser_debug_write_to_log)
  
    637             {
  
    638                 if (match.hit)
  
    639                 {
  
    640                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NameStartChar");
  
    641                     if (result.Error())
  
    642                     {
  
    643                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    644                     }
  
    645                 }
  
    646                 else
  
    647                 {
  
    648                     auto result = System.Lex.WriteFailureToLog(lexer, u"NameStartChar");
  
    649                     if (result.Error())
  
    650                     {
  
    651                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    652                     }
  
    653                 }
  
    654             }
  
    655             #endif
  
    656             if (!match.hit)
  
    657             {
  
    658                 match.value = null;
  
    659             }
  
    660             return System.Result<System.Parsing.Match>(match);
  
    661         }
  
    662         public static System.Result<System.Parsing.Match> NameChar(LexerT& lexer)
  
    663         {
  
    664             #if (DEBUG)
  
    665             long parser_debug_match_pos = 0;
  
    666             bool parser_debug_write_to_log = lexer.Log() != null;
  
    667             if (parser_debug_write_to_log)
  
    668             {
  
    669                 parser_debug_match_pos = lexer.GetPos();
  
    670                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"NameChar");
  
    671                 if (result.Error())
  
    672                 {
  
    673                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    674                 }
  
    675             }
  
    676             #endif
  
    677             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475909);
  
    678             System.UniquePtr<System.Parsing.Value<uchar>> nameStartChar;
  
    679             System.Parsing.Match match(false);
  
    680             System.Parsing.Match* parentMatch0 = &match;
  
    681             {
  
    682                 System.Parsing.Match match(false);
  
    683                 System.Parsing.Match* parentMatch1 = &match;
  
    684                 {
  
    685                     long save = lexer.GetPos();
  
    686                     System.Parsing.Match match(false);
  
    687                     System.Parsing.Match* parentMatch2 = &match;
  
    688                     {
  
    689                         long pos = lexer.GetPos();
  
    690                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NameStartChar(lexer);
  
    691                         if (matchResult.Error())
  
    692                         {
  
    693                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    694                         }
  
    695                         System.Parsing.Match match = matchResult.Value();
  
    696                         nameStartChar.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
    697                         if (match.hit)
  
    698                         {
  
    699                             #if (DEBUG)
  
    700                                 if (parser_debug_write_to_log)
  
    701                                 {
  
    702                                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NameChar");
  
    703                                     if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    704                                 }
  
    705                             #endif
  
    706                             return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<uchar>(nameStartChar->value)));
  
    707                         }
  
    708                         *parentMatch2 = match;
  
    709                     }
  
    710                     *parentMatch1 = match;
  
    711                     if (!match.hit)
  
    712                     {
  
    713                         System.Parsing.Match match(false);
  
    714                         System.Parsing.Match* parentMatch3 = &match;
  
    715                         lexer.SetPos(save);
  
    716                         {
  
    717                             System.Parsing.Match match(false);
  
    718                             System.Parsing.Match* parentMatch4 = &match;
  
    719                             {
  
    720                                 long pos = lexer.GetPos();
  
    721                                 System.Parsing.Match match(false);
  
    722                                 for (const System.Parsing.Range& range : s3)
  
    723                                 {
  
    724                                     if (*lexer >= range.first && *lexer <= range.last)
  
    725                                     {
  
    726                                         match.hit = true;
  
    727                                         auto incResult0 = ++lexer;
  
    728                                         if (incResult0.Error())
  
    729                                         {
  
    730                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
    731                                         }
  
    732                                         break;
  
    733                                     }
  
    734                                 }
  
    735                                 if (match.hit)
  
    736                                 {
  
    737                                     #if (DEBUG)
  
    738                                         if (parser_debug_write_to_log)
  
    739                                         {
  
    740                                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NameChar");
  
    741                                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    742                                         }
  
    743                                     #endif
  
    744                                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<uchar>(lexer.GetToken(pos).Chr())));
  
    745                                 }
  
    746                                 *parentMatch4 = match;
  
    747                             }
  
    748                             *parentMatch3 = match;
  
    749                         }
  
    750                         *parentMatch1 = match;
  
    751                     }
  
    752                 }
  
    753                 *parentMatch0 = match;
  
    754             }
  
    755             #if (DEBUG)
  
    756             if (parser_debug_write_to_log)
  
    757             {
  
    758                 if (match.hit)
  
    759                 {
  
    760                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NameChar");
  
    761                     if (result.Error())
  
    762                     {
  
    763                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    764                     }
  
    765                 }
  
    766                 else
  
    767                 {
  
    768                     auto result = System.Lex.WriteFailureToLog(lexer, u"NameChar");
  
    769                     if (result.Error())
  
    770                     {
  
    771                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    772                     }
  
    773                 }
  
    774             }
  
    775             #endif
  
    776             if (!match.hit)
  
    777             {
  
    778                 match.value = null;
  
    779             }
  
    780             return System.Result<System.Parsing.Match>(match);
  
    781         }
  
    782         public static System.Result<System.Parsing.Match> Name(LexerT& lexer)
  
    783         {
  
    784             #if (DEBUG)
  
    785             long parser_debug_match_pos = 0;
  
    786             bool parser_debug_write_to_log = lexer.Log() != null;
  
    787             if (parser_debug_write_to_log)
  
    788             {
  
    789                 parser_debug_match_pos = lexer.GetPos();
  
    790                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Name");
  
    791                 if (result.Error())
  
    792                 {
  
    793                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    794                 }
  
    795             }
  
    796             #endif
  
    797             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475910);
  
    798             ustring s = ustring();
  
    799             System.UniquePtr<System.Parsing.Value<uchar>> nameStartChar;
  
    800             System.UniquePtr<System.Parsing.Value<uchar>> nameChar;
  
    801             System.Parsing.Match match(false);
  
    802             System.Parsing.Match* parentMatch0 = &match;
  
    803             {
  
    804                 long pos = lexer.GetPos();
  
    805                 System.Parsing.Match match(false);
  
    806                 System.Parsing.Match* parentMatch1 = &match;
  
    807                 {
  
    808                     System.Parsing.Match match(false);
  
    809                     System.Parsing.Match* parentMatch2 = &match;
  
    810                     {
  
    811                         System.Parsing.Match match(false);
  
    812                         System.Parsing.Match* parentMatch3 = &match;
  
    813                         {
  
    814                             long pos = lexer.GetPos();
  
    815                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NameStartChar(lexer);
  
    816                             if (matchResult.Error())
  
    817                             {
  
    818                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    819                             }
  
    820                             System.Parsing.Match match = matchResult.Value();
  
    821                             nameStartChar.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
    822                             if (match.hit)
  
    823                             {
  
    824                                 s.Append(nameStartChar->value);
  
    825                             }
  
    826                             *parentMatch3 = match;
  
    827                         }
  
    828                         *parentMatch2 = match;
  
    829                     }
  
    830                     if (match.hit)
  
    831                     {
  
    832                         System.Parsing.Match match(false);
  
    833                         System.Parsing.Match* parentMatch4 = &match;
  
    834                         {
  
    835                             System.Parsing.Match match(true);
  
    836                             System.Parsing.Match* parentMatch5 = &match;
  
    837                             {
  
    838                                 while (true)
  
    839                                 {
  
    840                                     long save = lexer.GetPos();
  
    841                                     {
  
    842                                         System.Parsing.Match match(false);
  
    843                                         System.Parsing.Match* parentMatch6 = &match;
  
    844                                         {
  
    845                                             System.Parsing.Match match(false);
  
    846                                             System.Parsing.Match* parentMatch7 = &match;
  
    847                                             {
  
    848                                                 long pos = lexer.GetPos();
  
    849                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NameChar(lexer);
  
    850                                                 if (matchResult.Error())
  
    851                                                 {
  
    852                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    853                                                 }
  
    854                                                 System.Parsing.Match match = matchResult.Value();
  
    855                                                 nameChar.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
    856                                                 if (match.hit)
  
    857                                                 {
  
    858                                                     s.Append(nameChar->value);
  
    859                                                 }
  
    860                                                 *parentMatch7 = match;
  
    861                                             }
  
    862                                             *parentMatch6 = match;
  
    863                                         }
  
    864                                         if (match.hit)
  
    865                                         {
  
    866                                             *parentMatch5 = match;
  
    867                                         }
  
    868                                         else
  
    869                                         {
  
    870                                             lexer.SetPos(save);
  
    871                                             break;
  
    872                                         }
  
    873                                     }
  
    874                                 }
  
    875                             }
  
    876                             *parentMatch4 = match;
  
    877                         }
  
    878                         *parentMatch2 = match;
  
    879                     }
  
    880                     *parentMatch1 = match;
  
    881                 }
  
    882                 if (match.hit)
  
    883                 {
  
    884                     #if (DEBUG)
  
    885                         if (parser_debug_write_to_log)
  
    886                         {
  
    887                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Name");
  
    888                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    889                         }
  
    890                     #endif
  
    891                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<ustring>(s)));
  
    892                 }
  
    893                 *parentMatch0 = match;
  
    894             }
  
    895             #if (DEBUG)
  
    896             if (parser_debug_write_to_log)
  
    897             {
  
    898                 if (match.hit)
  
    899                 {
  
    900                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Name");
  
    901                     if (result.Error())
  
    902                     {
  
    903                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    904                     }
  
    905                 }
  
    906                 else
  
    907                 {
  
    908                     auto result = System.Lex.WriteFailureToLog(lexer, u"Name");
  
    909                     if (result.Error())
  
    910                     {
  
    911                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    912                     }
  
    913                 }
  
    914             }
  
    915             #endif
  
    916             if (!match.hit)
  
    917             {
  
    918                 match.value = null;
  
    919             }
  
    920             return System.Result<System.Parsing.Match>(match);
  
    921         }
  
    922         public static System.Result<System.Parsing.Match> Names(LexerT& lexer)
  
    923         {
  
    924             #if (DEBUG)
  
    925             long parser_debug_match_pos = 0;
  
    926             bool parser_debug_write_to_log = lexer.Log() != null;
  
    927             if (parser_debug_write_to_log)
  
    928             {
  
    929                 parser_debug_match_pos = lexer.GetPos();
  
    930                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Names");
  
    931                 if (result.Error())
  
    932                 {
  
    933                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
    934                 }
  
    935             }
  
    936             #endif
  
    937             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475911);
  
    938             System.UniquePtr<System.Parsing.Value<ustring>> name1;
  
    939             System.UniquePtr<System.Parsing.Value<ustring>> name2;
  
    940             System.Parsing.Match match(false);
  
    941             System.Parsing.Match* parentMatch0 = &match;
  
    942             {
  
    943                 long pos = lexer.GetPos();
  
    944                 System.Parsing.Match match(false);
  
    945                 System.Parsing.Match* parentMatch1 = &match;
  
    946                 {
  
    947                     System.Parsing.Match match(false);
  
    948                     System.Parsing.Match* parentMatch2 = &match;
  
    949                     {
  
    950                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
    951                         if (matchResult.Error())
  
    952                         {
  
    953                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    954                         }
  
    955                         System.Parsing.Match match = matchResult.Value();
  
    956                         name1.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
    957                         *parentMatch2 = match;
  
    958                     }
  
    959                     if (match.hit)
  
    960                     {
  
    961                         System.Parsing.Match match(false);
  
    962                         System.Parsing.Match* parentMatch3 = &match;
  
    963                         {
  
    964                             System.Parsing.Match match(true);
  
    965                             System.Parsing.Match* parentMatch4 = &match;
  
    966                             {
  
    967                                 while (true)
  
    968                                 {
  
    969                                     long save = lexer.GetPos();
  
    970                                     {
  
    971                                         System.Parsing.Match match(false);
  
    972                                         System.Parsing.Match* parentMatch5 = &match;
  
    973                                         {
  
    974                                             System.Parsing.Match match(false);
  
    975                                             System.Parsing.Match* parentMatch6 = &match;
  
    976                                             {
  
    977                                                 System.Parsing.Match match(false);
  
    978                                                 if (*lexer == 32)
  
    979                                                 {
  
    980                                                     auto incResult0 = ++lexer;
  
    981                                                     if (incResult0.Error())
  
    982                                                     {
  
    983                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
    984                                                     }
  
    985                                                     match.hit = true;
  
    986                                                 }
  
    987                                                 *parentMatch6 = match;
  
    988                                             }
  
    989                                             if (match.hit)
  
    990                                             {
  
    991                                                 System.Parsing.Match match(false);
  
    992                                                 System.Parsing.Match* parentMatch7 = &match;
  
    993                                                 {
  
    994                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
    995                                                     if (matchResult.Error())
  
    996                                                     {
  
    997                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
    998                                                     }
  
    999                                                     System.Parsing.Match match = matchResult.Value();
  
   1000                                                     name2.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   1001                                                     *parentMatch7 = match;
  
   1002                                                 }
  
   1003                                                 *parentMatch6 = match;
  
   1004                                             }
  
   1005                                             *parentMatch5 = match;
  
   1006                                         }
  
   1007                                         if (match.hit)
  
   1008                                         {
  
   1009                                             *parentMatch4 = match;
  
   1010                                         }
  
   1011                                         else
  
   1012                                         {
  
   1013                                             lexer.SetPos(save);
  
   1014                                             break;
  
   1015                                         }
  
   1016                                     }
  
   1017                                 }
  
   1018                             }
  
   1019                             *parentMatch3 = match;
  
   1020                         }
  
   1021                         *parentMatch2 = match;
  
   1022                     }
  
   1023                     *parentMatch1 = match;
  
   1024                 }
  
   1025                 if (match.hit)
  
   1026                 {
  
   1027                     #if (DEBUG)
  
   1028                         if (parser_debug_write_to_log)
  
   1029                         {
  
   1030                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Names");
  
   1031                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1032                         }
  
   1033                     #endif
  
   1034                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   1035                 }
  
   1036                 *parentMatch0 = match;
  
   1037             }
  
   1038             #if (DEBUG)
  
   1039             if (parser_debug_write_to_log)
  
   1040             {
  
   1041                 if (match.hit)
  
   1042                 {
  
   1043                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Names");
  
   1044                     if (result.Error())
  
   1045                     {
  
   1046                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1047                     }
  
   1048                 }
  
   1049                 else
  
   1050                 {
  
   1051                     auto result = System.Lex.WriteFailureToLog(lexer, u"Names");
  
   1052                     if (result.Error())
  
   1053                     {
  
   1054                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1055                     }
  
   1056                 }
  
   1057             }
  
   1058             #endif
  
   1059             if (!match.hit)
  
   1060             {
  
   1061                 match.value = null;
  
   1062             }
  
   1063             return System.Result<System.Parsing.Match>(match);
  
   1064         }
  
   1065         public static System.Result<System.Parsing.Match> Nmtoken(LexerT& lexer)
  
   1066         {
  
   1067             #if (DEBUG)
  
   1068             long parser_debug_match_pos = 0;
  
   1069             bool parser_debug_write_to_log = lexer.Log() != null;
  
   1070             if (parser_debug_write_to_log)
  
   1071             {
  
   1072                 parser_debug_match_pos = lexer.GetPos();
  
   1073                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Nmtoken");
  
   1074                 if (result.Error())
  
   1075                 {
  
   1076                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1077                 }
  
   1078             }
  
   1079             #endif
  
   1080             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475912);
  
   1081             System.UniquePtr<System.Parsing.Value<uchar>> nameChar;
  
   1082             System.Parsing.Match match(false);
  
   1083             System.Parsing.Match* parentMatch0 = &match;
  
   1084             {
  
   1085                 long pos = lexer.GetPos();
  
   1086                 System.Parsing.Match match(false);
  
   1087                 System.Parsing.Match* parentMatch1 = &match;
  
   1088                 {
  
   1089                     System.Parsing.Match match(false);
  
   1090                     System.Parsing.Match* parentMatch2 = &match;
  
   1091                     {
  
   1092                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NameChar(lexer);
  
   1093                         if (matchResult.Error())
  
   1094                         {
  
   1095                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1096                         }
  
   1097                         System.Parsing.Match match = matchResult.Value();
  
   1098                         nameChar.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
   1099                         *parentMatch2 = match;
  
   1100                     }
  
   1101                     if (match.hit)
  
   1102                     {
  
   1103                         System.Parsing.Match match(true);
  
   1104                         System.Parsing.Match* parentMatch3 = &match;
  
   1105                         while (true)
  
   1106                         {
  
   1107                             long save = lexer.GetPos();
  
   1108                             {
  
   1109                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NameChar(lexer);
  
   1110                                 if (matchResult.Error())
  
   1111                                 {
  
   1112                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1113                                 }
  
   1114                                 System.Parsing.Match match = matchResult.Value();
  
   1115                                 nameChar.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
   1116                                 if (match.hit)
  
   1117                                 {
  
   1118                                     *parentMatch3 = match;
  
   1119                                 }
  
   1120                                 else
  
   1121                                 {
  
   1122                                     lexer.SetPos(save);
  
   1123                                     break;
  
   1124                                 }
  
   1125                             }
  
   1126                         }
  
   1127                     }
  
   1128                     *parentMatch1 = match;
  
   1129                 }
  
   1130                 if (match.hit)
  
   1131                 {
  
   1132                     #if (DEBUG)
  
   1133                         if (parser_debug_write_to_log)
  
   1134                         {
  
   1135                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Nmtoken");
  
   1136                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1137                         }
  
   1138                     #endif
  
   1139                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   1140                 }
  
   1141                 *parentMatch0 = match;
  
   1142             }
  
   1143             #if (DEBUG)
  
   1144             if (parser_debug_write_to_log)
  
   1145             {
  
   1146                 if (match.hit)
  
   1147                 {
  
   1148                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Nmtoken");
  
   1149                     if (result.Error())
  
   1150                     {
  
   1151                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1152                     }
  
   1153                 }
  
   1154                 else
  
   1155                 {
  
   1156                     auto result = System.Lex.WriteFailureToLog(lexer, u"Nmtoken");
  
   1157                     if (result.Error())
  
   1158                     {
  
   1159                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1160                     }
  
   1161                 }
  
   1162             }
  
   1163             #endif
  
   1164             if (!match.hit)
  
   1165             {
  
   1166                 match.value = null;
  
   1167             }
  
   1168             return System.Result<System.Parsing.Match>(match);
  
   1169         }
  
   1170         public static System.Result<System.Parsing.Match> Nmtokens(LexerT& lexer)
  
   1171         {
  
   1172             #if (DEBUG)
  
   1173             long parser_debug_match_pos = 0;
  
   1174             bool parser_debug_write_to_log = lexer.Log() != null;
  
   1175             if (parser_debug_write_to_log)
  
   1176             {
  
   1177                 parser_debug_match_pos = lexer.GetPos();
  
   1178                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Nmtokens");
  
   1179                 if (result.Error())
  
   1180                 {
  
   1181                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1182                 }
  
   1183             }
  
   1184             #endif
  
   1185             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475913);
  
   1186             System.UniquePtr<System.Parsing.Value<bool>> nmToken1;
  
   1187             System.UniquePtr<System.Parsing.Value<bool>> nmToken2;
  
   1188             System.Parsing.Match match(false);
  
   1189             System.Parsing.Match* parentMatch0 = &match;
  
   1190             {
  
   1191                 long pos = lexer.GetPos();
  
   1192                 System.Parsing.Match match(false);
  
   1193                 System.Parsing.Match* parentMatch1 = &match;
  
   1194                 {
  
   1195                     System.Parsing.Match match(false);
  
   1196                     System.Parsing.Match* parentMatch2 = &match;
  
   1197                     {
  
   1198                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Nmtoken(lexer);
  
   1199                         if (matchResult.Error())
  
   1200                         {
  
   1201                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1202                         }
  
   1203                         System.Parsing.Match match = matchResult.Value();
  
   1204                         nmToken1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1205                         *parentMatch2 = match;
  
   1206                     }
  
   1207                     if (match.hit)
  
   1208                     {
  
   1209                         System.Parsing.Match match(false);
  
   1210                         System.Parsing.Match* parentMatch3 = &match;
  
   1211                         {
  
   1212                             System.Parsing.Match match(true);
  
   1213                             System.Parsing.Match* parentMatch4 = &match;
  
   1214                             {
  
   1215                                 while (true)
  
   1216                                 {
  
   1217                                     long save = lexer.GetPos();
  
   1218                                     {
  
   1219                                         System.Parsing.Match match(false);
  
   1220                                         System.Parsing.Match* parentMatch5 = &match;
  
   1221                                         {
  
   1222                                             System.Parsing.Match match(false);
  
   1223                                             System.Parsing.Match* parentMatch6 = &match;
  
   1224                                             {
  
   1225                                                 System.Parsing.Match match(false);
  
   1226                                                 if (*lexer == 32)
  
   1227                                                 {
  
   1228                                                     auto incResult0 = ++lexer;
  
   1229                                                     if (incResult0.Error())
  
   1230                                                     {
  
   1231                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   1232                                                     }
  
   1233                                                     match.hit = true;
  
   1234                                                 }
  
   1235                                                 *parentMatch6 = match;
  
   1236                                             }
  
   1237                                             if (match.hit)
  
   1238                                             {
  
   1239                                                 System.Parsing.Match match(false);
  
   1240                                                 System.Parsing.Match* parentMatch7 = &match;
  
   1241                                                 {
  
   1242                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Nmtoken(lexer);
  
   1243                                                     if (matchResult.Error())
  
   1244                                                     {
  
   1245                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1246                                                     }
  
   1247                                                     System.Parsing.Match match = matchResult.Value();
  
   1248                                                     nmToken2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1249                                                     *parentMatch7 = match;
  
   1250                                                 }
  
   1251                                                 *parentMatch6 = match;
  
   1252                                             }
  
   1253                                             *parentMatch5 = match;
  
   1254                                         }
  
   1255                                         if (match.hit)
  
   1256                                         {
  
   1257                                             *parentMatch4 = match;
  
   1258                                         }
  
   1259                                         else
  
   1260                                         {
  
   1261                                             lexer.SetPos(save);
  
   1262                                             break;
  
   1263                                         }
  
   1264                                     }
  
   1265                                 }
  
   1266                             }
  
   1267                             *parentMatch3 = match;
  
   1268                         }
  
   1269                         *parentMatch2 = match;
  
   1270                     }
  
   1271                     *parentMatch1 = match;
  
   1272                 }
  
   1273                 if (match.hit)
  
   1274                 {
  
   1275                     #if (DEBUG)
  
   1276                         if (parser_debug_write_to_log)
  
   1277                         {
  
   1278                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Nmtokens");
  
   1279                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1280                         }
  
   1281                     #endif
  
   1282                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   1283                 }
  
   1284                 *parentMatch0 = match;
  
   1285             }
  
   1286             #if (DEBUG)
  
   1287             if (parser_debug_write_to_log)
  
   1288             {
  
   1289                 if (match.hit)
  
   1290                 {
  
   1291                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Nmtokens");
  
   1292                     if (result.Error())
  
   1293                     {
  
   1294                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1295                     }
  
   1296                 }
  
   1297                 else
  
   1298                 {
  
   1299                     auto result = System.Lex.WriteFailureToLog(lexer, u"Nmtokens");
  
   1300                     if (result.Error())
  
   1301                     {
  
   1302                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1303                     }
  
   1304                 }
  
   1305             }
  
   1306             #endif
  
   1307             if (!match.hit)
  
   1308             {
  
   1309                 match.value = null;
  
   1310             }
  
   1311             return System.Result<System.Parsing.Match>(match);
  
   1312         }
  
   1313         public static System.Result<System.Parsing.Match> Prolog(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   1314         {
  
   1315             #if (DEBUG)
  
   1316             long parser_debug_match_pos = 0;
  
   1317             bool parser_debug_write_to_log = lexer.Log() != null;
  
   1318             if (parser_debug_write_to_log)
  
   1319             {
  
   1320                 parser_debug_match_pos = lexer.GetPos();
  
   1321                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Prolog");
  
   1322                 if (result.Error())
  
   1323                 {
  
   1324                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1325                 }
  
   1326             }
  
   1327             #endif
  
   1328             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475914);
  
   1329             System.UniquePtr<System.Parsing.Value<bool>> xmlDecl;
  
   1330             System.UniquePtr<System.Parsing.Value<bool>> m1;
  
   1331             System.UniquePtr<System.Parsing.Value<bool>> docTypeDecl;
  
   1332             System.UniquePtr<System.Parsing.Value<bool>> m2;
  
   1333             System.Parsing.Match match(false);
  
   1334             System.Parsing.Match* parentMatch0 = &match;
  
   1335             {
  
   1336                 long pos = lexer.GetPos();
  
   1337                 System.Parsing.Match match(false);
  
   1338                 System.Parsing.Match* parentMatch1 = &match;
  
   1339                 {
  
   1340                     System.Parsing.Match match(false);
  
   1341                     System.Parsing.Match* parentMatch2 = &match;
  
   1342                     {
  
   1343                         System.Parsing.Match match(false);
  
   1344                         System.Parsing.Match* parentMatch3 = &match;
  
   1345                         {
  
   1346                             System.Parsing.Match match(true);
  
   1347                             long save = lexer.GetPos();
  
   1348                             System.Parsing.Match* parentMatch4 = &match;
  
   1349                             {
  
   1350                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.XMLDecl(lexer, processor);
  
   1351                                 if (matchResult.Error())
  
   1352                                 {
  
   1353                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1354                                 }
  
   1355                                 System.Parsing.Match match = matchResult.Value();
  
   1356                                 xmlDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1357                                 if (match.hit)
  
   1358                                 {
  
   1359                                     *parentMatch4 = match;
  
   1360                                 }
  
   1361                                 else
  
   1362                                 {
  
   1363                                     lexer.SetPos(save);
  
   1364                                 }
  
   1365                             }
  
   1366                             *parentMatch3 = match;
  
   1367                         }
  
   1368                         if (match.hit)
  
   1369                         {
  
   1370                             System.Parsing.Match match(false);
  
   1371                             System.Parsing.Match* parentMatch5 = &match;
  
   1372                             {
  
   1373                                 System.Parsing.Match match(true);
  
   1374                                 System.Parsing.Match* parentMatch6 = &match;
  
   1375                                 {
  
   1376                                     while (true)
  
   1377                                     {
  
   1378                                         long save = lexer.GetPos();
  
   1379                                         {
  
   1380                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Misc(lexer, processor);
  
   1381                                             if (matchResult.Error())
  
   1382                                             {
  
   1383                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1384                                             }
  
   1385                                             System.Parsing.Match match = matchResult.Value();
  
   1386                                             m1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1387                                             if (match.hit)
  
   1388                                             {
  
   1389                                                 *parentMatch6 = match;
  
   1390                                             }
  
   1391                                             else
  
   1392                                             {
  
   1393                                                 lexer.SetPos(save);
  
   1394                                                 break;
  
   1395                                             }
  
   1396                                         }
  
   1397                                     }
  
   1398                                 }
  
   1399                                 *parentMatch5 = match;
  
   1400                             }
  
   1401                             *parentMatch3 = match;
  
   1402                         }
  
   1403                         *parentMatch2 = match;
  
   1404                     }
  
   1405                     if (match.hit)
  
   1406                     {
  
   1407                         System.Parsing.Match match(false);
  
   1408                         System.Parsing.Match* parentMatch7 = &match;
  
   1409                         {
  
   1410                             System.Parsing.Match match(true);
  
   1411                             long save = lexer.GetPos();
  
   1412                             System.Parsing.Match* parentMatch8 = &match;
  
   1413                             {
  
   1414                                 System.Parsing.Match match(false);
  
   1415                                 System.Parsing.Match* parentMatch9 = &match;
  
   1416                                 {
  
   1417                                     System.Parsing.Match match(false);
  
   1418                                     System.Parsing.Match* parentMatch10 = &match;
  
   1419                                     {
  
   1420                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.DocTypeDecl(lexer, processor);
  
   1421                                         if (matchResult.Error())
  
   1422                                         {
  
   1423                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1424                                         }
  
   1425                                         System.Parsing.Match match = matchResult.Value();
  
   1426                                         docTypeDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1427                                         *parentMatch10 = match;
  
   1428                                     }
  
   1429                                     if (match.hit)
  
   1430                                     {
  
   1431                                         System.Parsing.Match match(false);
  
   1432                                         System.Parsing.Match* parentMatch11 = &match;
  
   1433                                         {
  
   1434                                             System.Parsing.Match match(true);
  
   1435                                             System.Parsing.Match* parentMatch12 = &match;
  
   1436                                             {
  
   1437                                                 while (true)
  
   1438                                                 {
  
   1439                                                     long save = lexer.GetPos();
  
   1440                                                     {
  
   1441                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Misc(lexer, processor);
  
   1442                                                         if (matchResult.Error())
  
   1443                                                         {
  
   1444                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1445                                                         }
  
   1446                                                         System.Parsing.Match match = matchResult.Value();
  
   1447                                                         m2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1448                                                         if (match.hit)
  
   1449                                                         {
  
   1450                                                             *parentMatch12 = match;
  
   1451                                                         }
  
   1452                                                         else
  
   1453                                                         {
  
   1454                                                             lexer.SetPos(save);
  
   1455                                                             break;
  
   1456                                                         }
  
   1457                                                     }
  
   1458                                                 }
  
   1459                                             }
  
   1460                                             *parentMatch11 = match;
  
   1461                                         }
  
   1462                                         *parentMatch10 = match;
  
   1463                                     }
  
   1464                                     *parentMatch9 = match;
  
   1465                                 }
  
   1466                                 if (match.hit)
  
   1467                                 {
  
   1468                                     *parentMatch8 = match;
  
   1469                                 }
  
   1470                                 else
  
   1471                                 {
  
   1472                                     lexer.SetPos(save);
  
   1473                                 }
  
   1474                             }
  
   1475                             *parentMatch7 = match;
  
   1476                         }
  
   1477                         *parentMatch2 = match;
  
   1478                     }
  
   1479                     *parentMatch1 = match;
  
   1480                 }
  
   1481                 if (match.hit)
  
   1482                 {
  
   1483                     #if (DEBUG)
  
   1484                         if (parser_debug_write_to_log)
  
   1485                         {
  
   1486                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Prolog");
  
   1487                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1488                         }
  
   1489                     #endif
  
   1490                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   1491                 }
  
   1492                 *parentMatch0 = match;
  
   1493             }
  
   1494             #if (DEBUG)
  
   1495             if (parser_debug_write_to_log)
  
   1496             {
  
   1497                 if (match.hit)
  
   1498                 {
  
   1499                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Prolog");
  
   1500                     if (result.Error())
  
   1501                     {
  
   1502                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1503                     }
  
   1504                 }
  
   1505                 else
  
   1506                 {
  
   1507                     auto result = System.Lex.WriteFailureToLog(lexer, u"Prolog");
  
   1508                     if (result.Error())
  
   1509                     {
  
   1510                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1511                     }
  
   1512                 }
  
   1513             }
  
   1514             #endif
  
   1515             if (!match.hit)
  
   1516             {
  
   1517                 match.value = null;
  
   1518             }
  
   1519             return System.Result<System.Parsing.Match>(match);
  
   1520         }
  
   1521         public static System.Result<System.Parsing.Match> XMLDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   1522         {
  
   1523             #if (DEBUG)
  
   1524             long parser_debug_match_pos = 0;
  
   1525             bool parser_debug_write_to_log = lexer.Log() != null;
  
   1526             if (parser_debug_write_to_log)
  
   1527             {
  
   1528                 parser_debug_match_pos = lexer.GetPos();
  
   1529                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"XMLDecl");
  
   1530                 if (result.Error())
  
   1531                 {
  
   1532                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1533                 }
  
   1534             }
  
   1535             #endif
  
   1536             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475915);
  
   1537             System.UniquePtr<System.Parsing.Value<bool>> versionInfo;
  
   1538             System.UniquePtr<System.Parsing.Value<bool>> encodingDecl;
  
   1539             System.UniquePtr<System.Parsing.Value<bool>> sdDecl;
  
   1540             System.UniquePtr<System.Parsing.Value<bool>> s;
  
   1541             System.Parsing.Match match(false);
  
   1542             System.Parsing.Match* parentMatch0 = &match;
  
   1543             {
  
   1544                 long pos = lexer.GetPos();
  
   1545                 System.Parsing.Match match(false);
  
   1546                 System.Parsing.Match* parentMatch1 = &match;
  
   1547                 {
  
   1548                     System.Parsing.Match match(false);
  
   1549                     System.Parsing.Match* parentMatch2 = &match;
  
   1550                     {
  
   1551                         System.Parsing.Match match(false);
  
   1552                         System.Parsing.Match* parentMatch3 = &match;
  
   1553                         {
  
   1554                             System.Parsing.Match match(false);
  
   1555                             System.Parsing.Match* parentMatch4 = &match;
  
   1556                             {
  
   1557                                 System.Parsing.Match match(false);
  
   1558                                 System.Parsing.Match* parentMatch5 = &match;
  
   1559                                 {
  
   1560                                     System.Parsing.Match match(false);
  
   1561                                     System.Parsing.Match* parentMatch6 = &match;
  
   1562                                     {
  
   1563                                         System.Parsing.Match match(true);
  
   1564                                         for (int i : s4)
  
   1565                                         {
  
   1566                                             if (*lexer == i)
  
   1567                                             {
  
   1568                                                 auto incResult0 = ++lexer;
  
   1569                                                 if (incResult0.Error())
  
   1570                                                 {
  
   1571                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   1572                                                 }
  
   1573                                             }
  
   1574                                             else
  
   1575                                             {
  
   1576                                                 match.hit = false;
  
   1577                                                 break;
  
   1578                                             }
  
   1579                                         }
  
   1580                                         *parentMatch6 = match;
  
   1581                                     }
  
   1582                                     if (match.hit)
  
   1583                                     {
  
   1584                                         System.Parsing.Match match(false);
  
   1585                                         System.Parsing.Match* parentMatch7 = &match;
  
   1586                                         {
  
   1587                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.VersionInfo(lexer, processor);
  
   1588                                             if (matchResult.Error())
  
   1589                                             {
  
   1590                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1591                                             }
  
   1592                                             System.Parsing.Match match = matchResult.Value();
  
   1593                                             versionInfo.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1594                                             *parentMatch7 = match;
  
   1595                                         }
  
   1596                                         *parentMatch6 = match;
  
   1597                                     }
  
   1598                                     *parentMatch5 = match;
  
   1599                                 }
  
   1600                                 if (match.hit)
  
   1601                                 {
  
   1602                                     System.Parsing.Match match(false);
  
   1603                                     System.Parsing.Match* parentMatch8 = &match;
  
   1604                                     {
  
   1605                                         System.Parsing.Match match(true);
  
   1606                                         long save = lexer.GetPos();
  
   1607                                         System.Parsing.Match* parentMatch9 = &match;
  
   1608                                         {
  
   1609                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EncodingDecl(lexer, processor);
  
   1610                                             if (matchResult.Error())
  
   1611                                             {
  
   1612                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1613                                             }
  
   1614                                             System.Parsing.Match match = matchResult.Value();
  
   1615                                             encodingDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1616                                             if (match.hit)
  
   1617                                             {
  
   1618                                                 *parentMatch9 = match;
  
   1619                                             }
  
   1620                                             else
  
   1621                                             {
  
   1622                                                 lexer.SetPos(save);
  
   1623                                             }
  
   1624                                         }
  
   1625                                         *parentMatch8 = match;
  
   1626                                     }
  
   1627                                     *parentMatch5 = match;
  
   1628                                 }
  
   1629                                 *parentMatch4 = match;
  
   1630                             }
  
   1631                             if (match.hit)
  
   1632                             {
  
   1633                                 System.Parsing.Match match(false);
  
   1634                                 System.Parsing.Match* parentMatch10 = &match;
  
   1635                                 {
  
   1636                                     System.Parsing.Match match(true);
  
   1637                                     long save = lexer.GetPos();
  
   1638                                     System.Parsing.Match* parentMatch11 = &match;
  
   1639                                     {
  
   1640                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.SDDecl(lexer, processor);
  
   1641                                         if (matchResult.Error())
  
   1642                                         {
  
   1643                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1644                                         }
  
   1645                                         System.Parsing.Match match = matchResult.Value();
  
   1646                                         sdDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1647                                         if (match.hit)
  
   1648                                         {
  
   1649                                             *parentMatch11 = match;
  
   1650                                         }
  
   1651                                         else
  
   1652                                         {
  
   1653                                             lexer.SetPos(save);
  
   1654                                         }
  
   1655                                     }
  
   1656                                     *parentMatch10 = match;
  
   1657                                 }
  
   1658                                 *parentMatch4 = match;
  
   1659                             }
  
   1660                             *parentMatch3 = match;
  
   1661                         }
  
   1662                         if (match.hit)
  
   1663                         {
  
   1664                             System.Parsing.Match match(false);
  
   1665                             System.Parsing.Match* parentMatch12 = &match;
  
   1666                             {
  
   1667                                 System.Parsing.Match match(true);
  
   1668                                 long save = lexer.GetPos();
  
   1669                                 System.Parsing.Match* parentMatch13 = &match;
  
   1670                                 {
  
   1671                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   1672                                     if (matchResult.Error())
  
   1673                                     {
  
   1674                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1675                                     }
  
   1676                                     System.Parsing.Match match = matchResult.Value();
  
   1677                                     s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1678                                     if (match.hit)
  
   1679                                     {
  
   1680                                         *parentMatch13 = match;
  
   1681                                     }
  
   1682                                     else
  
   1683                                     {
  
   1684                                         lexer.SetPos(save);
  
   1685                                     }
  
   1686                                 }
  
   1687                                 *parentMatch12 = match;
  
   1688                             }
  
   1689                             *parentMatch3 = match;
  
   1690                         }
  
   1691                         *parentMatch2 = match;
  
   1692                     }
  
   1693                     if (match.hit)
  
   1694                     {
  
   1695                         System.Parsing.Match match(false);
  
   1696                         System.Parsing.Match* parentMatch14 = &match;
  
   1697                         {
  
   1698                             System.Parsing.Match match(true);
  
   1699                             for (int i : s5)
  
   1700                             {
  
   1701                                 if (*lexer == i)
  
   1702                                 {
  
   1703                                     auto incResult1 = ++lexer;
  
   1704                                     if (incResult1.Error())
  
   1705                                     {
  
   1706                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   1707                                     }
  
   1708                                 }
  
   1709                                 else
  
   1710                                 {
  
   1711                                     match.hit = false;
  
   1712                                     break;
  
   1713                                 }
  
   1714                             }
  
   1715                             *parentMatch14 = match;
  
   1716                         }
  
   1717                         *parentMatch2 = match;
  
   1718                     }
  
   1719                     *parentMatch1 = match;
  
   1720                 }
  
   1721                 if (match.hit)
  
   1722                 {
  
   1723                     #if (DEBUG)
  
   1724                         if (parser_debug_write_to_log)
  
   1725                         {
  
   1726                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"XMLDecl");
  
   1727                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1728                         }
  
   1729                     #endif
  
   1730                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   1731                 }
  
   1732                 *parentMatch0 = match;
  
   1733             }
  
   1734             #if (DEBUG)
  
   1735             if (parser_debug_write_to_log)
  
   1736             {
  
   1737                 if (match.hit)
  
   1738                 {
  
   1739                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"XMLDecl");
  
   1740                     if (result.Error())
  
   1741                     {
  
   1742                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1743                     }
  
   1744                 }
  
   1745                 else
  
   1746                 {
  
   1747                     auto result = System.Lex.WriteFailureToLog(lexer, u"XMLDecl");
  
   1748                     if (result.Error())
  
   1749                     {
  
   1750                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1751                     }
  
   1752                 }
  
   1753             }
  
   1754             #endif
  
   1755             if (!match.hit)
  
   1756             {
  
   1757                 match.value = null;
  
   1758             }
  
   1759             return System.Result<System.Parsing.Match>(match);
  
   1760         }
  
   1761         public static System.Result<System.Parsing.Match> VersionInfo(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   1762         {
  
   1763             #if (DEBUG)
  
   1764             long parser_debug_match_pos = 0;
  
   1765             bool parser_debug_write_to_log = lexer.Log() != null;
  
   1766             if (parser_debug_write_to_log)
  
   1767             {
  
   1768                 parser_debug_match_pos = lexer.GetPos();
  
   1769                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"VersionInfo");
  
   1770                 if (result.Error())
  
   1771                 {
  
   1772                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1773                 }
  
   1774             }
  
   1775             #endif
  
   1776             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475916);
  
   1777             System.UniquePtr<System.Parsing.Value<bool>> s;
  
   1778             System.UniquePtr<System.Parsing.Value<bool>> eq;
  
   1779             System.UniquePtr<System.Parsing.Value<bool>> versionNumber;
  
   1780             System.Parsing.Match match(false);
  
   1781             System.Parsing.Match* parentMatch0 = &match;
  
   1782             {
  
   1783                 long pos = lexer.GetPos();
  
   1784                 System.Parsing.Match match(false);
  
   1785                 System.Parsing.Match* parentMatch1 = &match;
  
   1786                 {
  
   1787                     System.Parsing.Match match(false);
  
   1788                     System.Parsing.Match* parentMatch2 = &match;
  
   1789                     {
  
   1790                         System.Parsing.Match match(false);
  
   1791                         System.Parsing.Match* parentMatch3 = &match;
  
   1792                         {
  
   1793                             System.Parsing.Match match(false);
  
   1794                             System.Parsing.Match* parentMatch4 = &match;
  
   1795                             {
  
   1796                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   1797                                 if (matchResult.Error())
  
   1798                                 {
  
   1799                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1800                                 }
  
   1801                                 System.Parsing.Match match = matchResult.Value();
  
   1802                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1803                                 *parentMatch4 = match;
  
   1804                             }
  
   1805                             if (match.hit)
  
   1806                             {
  
   1807                                 System.Parsing.Match match(false);
  
   1808                                 System.Parsing.Match* parentMatch5 = &match;
  
   1809                                 {
  
   1810                                     System.Parsing.Match match(true);
  
   1811                                     for (int i : s6)
  
   1812                                     {
  
   1813                                         if (*lexer == i)
  
   1814                                         {
  
   1815                                             auto incResult0 = ++lexer;
  
   1816                                             if (incResult0.Error())
  
   1817                                             {
  
   1818                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   1819                                             }
  
   1820                                         }
  
   1821                                         else
  
   1822                                         {
  
   1823                                             match.hit = false;
  
   1824                                             break;
  
   1825                                         }
  
   1826                                     }
  
   1827                                     *parentMatch5 = match;
  
   1828                                 }
  
   1829                                 *parentMatch4 = match;
  
   1830                             }
  
   1831                             *parentMatch3 = match;
  
   1832                         }
  
   1833                         if (match.hit)
  
   1834                         {
  
   1835                             System.Parsing.Match match(false);
  
   1836                             System.Parsing.Match* parentMatch6 = &match;
  
   1837                             {
  
   1838                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Eq(lexer);
  
   1839                                 if (matchResult.Error())
  
   1840                                 {
  
   1841                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1842                                 }
  
   1843                                 System.Parsing.Match match = matchResult.Value();
  
   1844                                 eq.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1845                                 *parentMatch6 = match;
  
   1846                             }
  
   1847                             *parentMatch3 = match;
  
   1848                         }
  
   1849                         *parentMatch2 = match;
  
   1850                     }
  
   1851                     if (match.hit)
  
   1852                     {
  
   1853                         System.Parsing.Match match(false);
  
   1854                         System.Parsing.Match* parentMatch7 = &match;
  
   1855                         {
  
   1856                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.VersionNumber(lexer, processor);
  
   1857                             if (matchResult.Error())
  
   1858                             {
  
   1859                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   1860                             }
  
   1861                             System.Parsing.Match match = matchResult.Value();
  
   1862                             versionNumber.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   1863                             *parentMatch7 = match;
  
   1864                         }
  
   1865                         *parentMatch2 = match;
  
   1866                     }
  
   1867                     *parentMatch1 = match;
  
   1868                 }
  
   1869                 if (match.hit)
  
   1870                 {
  
   1871                     #if (DEBUG)
  
   1872                         if (parser_debug_write_to_log)
  
   1873                         {
  
   1874                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionInfo");
  
   1875                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1876                         }
  
   1877                     #endif
  
   1878                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   1879                 }
  
   1880                 *parentMatch0 = match;
  
   1881             }
  
   1882             #if (DEBUG)
  
   1883             if (parser_debug_write_to_log)
  
   1884             {
  
   1885                 if (match.hit)
  
   1886                 {
  
   1887                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionInfo");
  
   1888                     if (result.Error())
  
   1889                     {
  
   1890                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1891                     }
  
   1892                 }
  
   1893                 else
  
   1894                 {
  
   1895                     auto result = System.Lex.WriteFailureToLog(lexer, u"VersionInfo");
  
   1896                     if (result.Error())
  
   1897                     {
  
   1898                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1899                     }
  
   1900                 }
  
   1901             }
  
   1902             #endif
  
   1903             if (!match.hit)
  
   1904             {
  
   1905                 match.value = null;
  
   1906             }
  
   1907             return System.Result<System.Parsing.Match>(match);
  
   1908         }
  
   1909         public static System.Result<System.Parsing.Match> VersionNum(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   1910         {
  
   1911             #if (DEBUG)
  
   1912             long parser_debug_match_pos = 0;
  
   1913             bool parser_debug_write_to_log = lexer.Log() != null;
  
   1914             if (parser_debug_write_to_log)
  
   1915             {
  
   1916                 parser_debug_match_pos = lexer.GetPos();
  
   1917                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"VersionNum");
  
   1918                 if (result.Error())
  
   1919                 {
  
   1920                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   1921                 }
  
   1922             }
  
   1923             #endif
  
   1924             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475917);
  
   1925             System.Lex.Lexeme m = System.Lex.Lexeme();
  
   1926             System.Parsing.Match match(false);
  
   1927             System.Parsing.Match* parentMatch0 = &match;
  
   1928             {
  
   1929                 long pos = lexer.GetPos();
  
   1930                 System.Parsing.Match match(false);
  
   1931                 System.Parsing.Match* parentMatch1 = &match;
  
   1932                 {
  
   1933                     System.Parsing.Match match(false);
  
   1934                     System.Parsing.Match* parentMatch2 = &match;
  
   1935                     {
  
   1936                         System.Parsing.Match match(false);
  
   1937                         System.Parsing.Match* parentMatch3 = &match;
  
   1938                         {
  
   1939                             System.Parsing.Match match(false);
  
   1940                             System.Parsing.Match* parentMatch4 = &match;
  
   1941                             {
  
   1942                                 long pos = lexer.GetPos();
  
   1943                                 System.Parsing.Match match(false);
  
   1944                                 if (*lexer == 49)
  
   1945                                 {
  
   1946                                     auto incResult0 = ++lexer;
  
   1947                                     if (incResult0.Error())
  
   1948                                     {
  
   1949                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   1950                                     }
  
   1951                                     match.hit = true;
  
   1952                                 }
  
   1953                                 if (match.hit)
  
   1954                                 {
  
   1955                                     m = lexer.GetToken(pos).match;
  
   1956                                 }
  
   1957                                 *parentMatch4 = match;
  
   1958                             }
  
   1959                             *parentMatch3 = match;
  
   1960                         }
  
   1961                         if (match.hit)
  
   1962                         {
  
   1963                             System.Parsing.Match match(false);
  
   1964                             System.Parsing.Match* parentMatch5 = &match;
  
   1965                             {
  
   1966                                 System.Parsing.Match match(false);
  
   1967                                 if (*lexer == 46)
  
   1968                                 {
  
   1969                                     auto incResult1 = ++lexer;
  
   1970                                     if (incResult1.Error())
  
   1971                                     {
  
   1972                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   1973                                     }
  
   1974                                     match.hit = true;
  
   1975                                 }
  
   1976                                 *parentMatch5 = match;
  
   1977                             }
  
   1978                             *parentMatch3 = match;
  
   1979                         }
  
   1980                         *parentMatch2 = match;
  
   1981                     }
  
   1982                     if (match.hit)
  
   1983                     {
  
   1984                         System.Parsing.Match match(false);
  
   1985                         System.Parsing.Match* parentMatch6 = &match;
  
   1986                         {
  
   1987                             System.Parsing.Match match(false);
  
   1988                             System.Parsing.Match* parentMatch7 = &match;
  
   1989                             {
  
   1990                                 System.Parsing.Match match(false);
  
   1991                                 System.Parsing.Match* parentMatch8 = &match;
  
   1992                                 {
  
   1993                                     System.Parsing.Match match(false);
  
   1994                                     System.Parsing.Match* parentMatch9 = &match;
  
   1995                                     {
  
   1996                                         long pos = lexer.GetPos();
  
   1997                                         System.Parsing.Match match(false);
  
   1998                                         for (const System.Parsing.Range& range : s7)
  
   1999                                         {
  
   2000                                             if (*lexer >= range.first && *lexer <= range.last)
  
   2001                                             {
  
   2002                                                 match.hit = true;
  
   2003                                                 auto incResult2 = ++lexer;
  
   2004                                                 if (incResult2.Error())
  
   2005                                                 {
  
   2006                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   2007                                                 }
  
   2008                                                 break;
  
   2009                                             }
  
   2010                                         }
  
   2011                                         if (match.hit)
  
   2012                                         {
  
   2013                                             m.end = lexer.GetToken(pos).match.end;
  
   2014                                         }
  
   2015                                         *parentMatch9 = match;
  
   2016                                     }
  
   2017                                     *parentMatch8 = match;
  
   2018                                 }
  
   2019                                 *parentMatch7 = match;
  
   2020                             }
  
   2021                             if (match.hit)
  
   2022                             {
  
   2023                                 System.Parsing.Match match(true);
  
   2024                                 System.Parsing.Match* parentMatch10 = &match;
  
   2025                                 while (true)
  
   2026                                 {
  
   2027                                     long save = lexer.GetPos();
  
   2028                                     {
  
   2029                                         System.Parsing.Match match(false);
  
   2030                                         System.Parsing.Match* parentMatch11 = &match;
  
   2031                                         {
  
   2032                                             System.Parsing.Match match(false);
  
   2033                                             System.Parsing.Match* parentMatch12 = &match;
  
   2034                                             {
  
   2035                                                 long pos = lexer.GetPos();
  
   2036                                                 System.Parsing.Match match(false);
  
   2037                                                 for (const System.Parsing.Range& range : s7)
  
   2038                                                 {
  
   2039                                                     if (*lexer >= range.first && *lexer <= range.last)
  
   2040                                                     {
  
   2041                                                         match.hit = true;
  
   2042                                                         auto incResult3 = ++lexer;
  
   2043                                                         if (incResult3.Error())
  
   2044                                                         {
  
   2045                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   2046                                                         }
  
   2047                                                         break;
  
   2048                                                     }
  
   2049                                                 }
  
   2050                                                 if (match.hit)
  
   2051                                                 {
  
   2052                                                     m.end = lexer.GetToken(pos).match.end;
  
   2053                                                 }
  
   2054                                                 *parentMatch12 = match;
  
   2055                                             }
  
   2056                                             *parentMatch11 = match;
  
   2057                                         }
  
   2058                                         if (match.hit)
  
   2059                                         {
  
   2060                                             *parentMatch10 = match;
  
   2061                                         }
  
   2062                                         else
  
   2063                                         {
  
   2064                                             lexer.SetPos(save);
  
   2065                                             break;
  
   2066                                         }
  
   2067                                     }
  
   2068                                 }
  
   2069                             }
  
   2070                             *parentMatch6 = match;
  
   2071                         }
  
   2072                         *parentMatch2 = match;
  
   2073                     }
  
   2074                     *parentMatch1 = match;
  
   2075                 }
  
   2076                 if (match.hit)
  
   2077                 {
  
   2078                     #if (DEBUG)
  
   2079                         if (parser_debug_write_to_log)
  
   2080                         {
  
   2081                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNum");
  
   2082                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2083                         }
  
   2084                     #endif
  
   2085                     auto result = processor->Version(m.ToString());
  
   2086                     if (result.Error())
  
   2087                     {
  
   2088                         return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
   2089                     }
  
   2090                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2091                 }
  
   2092                 *parentMatch0 = match;
  
   2093             }
  
   2094             #if (DEBUG)
  
   2095             if (parser_debug_write_to_log)
  
   2096             {
  
   2097                 if (match.hit)
  
   2098                 {
  
   2099                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNum");
  
   2100                     if (result.Error())
  
   2101                     {
  
   2102                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2103                     }
  
   2104                 }
  
   2105                 else
  
   2106                 {
  
   2107                     auto result = System.Lex.WriteFailureToLog(lexer, u"VersionNum");
  
   2108                     if (result.Error())
  
   2109                     {
  
   2110                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2111                     }
  
   2112                 }
  
   2113             }
  
   2114             #endif
  
   2115             if (!match.hit)
  
   2116             {
  
   2117                 match.value = null;
  
   2118             }
  
   2119             return System.Result<System.Parsing.Match>(match);
  
   2120         }
  
   2121         public static System.Result<System.Parsing.Match> VersionNumDQ(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   2122         {
  
   2123             #if (DEBUG)
  
   2124             long parser_debug_match_pos = 0;
  
   2125             bool parser_debug_write_to_log = lexer.Log() != null;
  
   2126             if (parser_debug_write_to_log)
  
   2127             {
  
   2128                 parser_debug_match_pos = lexer.GetPos();
  
   2129                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"VersionNumDQ");
  
   2130                 if (result.Error())
  
   2131                 {
  
   2132                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2133                 }
  
   2134             }
  
   2135             #endif
  
   2136             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475918);
  
   2137             System.UniquePtr<System.Parsing.Value<bool>> versionNum;
  
   2138             System.Parsing.Match match(false);
  
   2139             System.Parsing.Match* parentMatch0 = &match;
  
   2140             {
  
   2141                 long pos = lexer.GetPos();
  
   2142                 System.Parsing.Match match(false);
  
   2143                 System.Parsing.Match* parentMatch1 = &match;
  
   2144                 {
  
   2145                     System.Parsing.Match match(false);
  
   2146                     System.Parsing.Match* parentMatch2 = &match;
  
   2147                     {
  
   2148                         System.Parsing.Match match(false);
  
   2149                         System.Parsing.Match* parentMatch3 = &match;
  
   2150                         {
  
   2151                             System.Parsing.Match match(false);
  
   2152                             if (*lexer == 34)
  
   2153                             {
  
   2154                                 auto incResult0 = ++lexer;
  
   2155                                 if (incResult0.Error())
  
   2156                                 {
  
   2157                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   2158                                 }
  
   2159                                 match.hit = true;
  
   2160                             }
  
   2161                             *parentMatch3 = match;
  
   2162                         }
  
   2163                         if (match.hit)
  
   2164                         {
  
   2165                             System.Parsing.Match match(false);
  
   2166                             System.Parsing.Match* parentMatch4 = &match;
  
   2167                             {
  
   2168                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.VersionNum(lexer, processor);
  
   2169                                 if (matchResult.Error())
  
   2170                                 {
  
   2171                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2172                                 }
  
   2173                                 System.Parsing.Match match = matchResult.Value();
  
   2174                                 versionNum.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2175                                 *parentMatch4 = match;
  
   2176                             }
  
   2177                             *parentMatch3 = match;
  
   2178                         }
  
   2179                         *parentMatch2 = match;
  
   2180                     }
  
   2181                     if (match.hit)
  
   2182                     {
  
   2183                         System.Parsing.Match match(false);
  
   2184                         System.Parsing.Match* parentMatch5 = &match;
  
   2185                         {
  
   2186                             System.Parsing.Match match(false);
  
   2187                             if (*lexer == 34)
  
   2188                             {
  
   2189                                 auto incResult1 = ++lexer;
  
   2190                                 if (incResult1.Error())
  
   2191                                 {
  
   2192                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   2193                                 }
  
   2194                                 match.hit = true;
  
   2195                             }
  
   2196                             *parentMatch5 = match;
  
   2197                         }
  
   2198                         *parentMatch2 = match;
  
   2199                     }
  
   2200                     *parentMatch1 = match;
  
   2201                 }
  
   2202                 if (match.hit)
  
   2203                 {
  
   2204                     #if (DEBUG)
  
   2205                         if (parser_debug_write_to_log)
  
   2206                         {
  
   2207                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNumDQ");
  
   2208                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2209                         }
  
   2210                     #endif
  
   2211                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2212                 }
  
   2213                 *parentMatch0 = match;
  
   2214             }
  
   2215             #if (DEBUG)
  
   2216             if (parser_debug_write_to_log)
  
   2217             {
  
   2218                 if (match.hit)
  
   2219                 {
  
   2220                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNumDQ");
  
   2221                     if (result.Error())
  
   2222                     {
  
   2223                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2224                     }
  
   2225                 }
  
   2226                 else
  
   2227                 {
  
   2228                     auto result = System.Lex.WriteFailureToLog(lexer, u"VersionNumDQ");
  
   2229                     if (result.Error())
  
   2230                     {
  
   2231                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2232                     }
  
   2233                 }
  
   2234             }
  
   2235             #endif
  
   2236             if (!match.hit)
  
   2237             {
  
   2238                 match.value = null;
  
   2239             }
  
   2240             return System.Result<System.Parsing.Match>(match);
  
   2241         }
  
   2242         public static System.Result<System.Parsing.Match> VersionNumSQ(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   2243         {
  
   2244             #if (DEBUG)
  
   2245             long parser_debug_match_pos = 0;
  
   2246             bool parser_debug_write_to_log = lexer.Log() != null;
  
   2247             if (parser_debug_write_to_log)
  
   2248             {
  
   2249                 parser_debug_match_pos = lexer.GetPos();
  
   2250                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"VersionNumSQ");
  
   2251                 if (result.Error())
  
   2252                 {
  
   2253                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2254                 }
  
   2255             }
  
   2256             #endif
  
   2257             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475919);
  
   2258             System.UniquePtr<System.Parsing.Value<bool>> versionNum;
  
   2259             System.Parsing.Match match(false);
  
   2260             System.Parsing.Match* parentMatch0 = &match;
  
   2261             {
  
   2262                 long pos = lexer.GetPos();
  
   2263                 System.Parsing.Match match(false);
  
   2264                 System.Parsing.Match* parentMatch1 = &match;
  
   2265                 {
  
   2266                     System.Parsing.Match match(false);
  
   2267                     System.Parsing.Match* parentMatch2 = &match;
  
   2268                     {
  
   2269                         System.Parsing.Match match(false);
  
   2270                         System.Parsing.Match* parentMatch3 = &match;
  
   2271                         {
  
   2272                             System.Parsing.Match match(false);
  
   2273                             if (*lexer == 39)
  
   2274                             {
  
   2275                                 auto incResult0 = ++lexer;
  
   2276                                 if (incResult0.Error())
  
   2277                                 {
  
   2278                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   2279                                 }
  
   2280                                 match.hit = true;
  
   2281                             }
  
   2282                             *parentMatch3 = match;
  
   2283                         }
  
   2284                         if (match.hit)
  
   2285                         {
  
   2286                             System.Parsing.Match match(false);
  
   2287                             System.Parsing.Match* parentMatch4 = &match;
  
   2288                             {
  
   2289                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.VersionNum(lexer, processor);
  
   2290                                 if (matchResult.Error())
  
   2291                                 {
  
   2292                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2293                                 }
  
   2294                                 System.Parsing.Match match = matchResult.Value();
  
   2295                                 versionNum.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2296                                 *parentMatch4 = match;
  
   2297                             }
  
   2298                             *parentMatch3 = match;
  
   2299                         }
  
   2300                         *parentMatch2 = match;
  
   2301                     }
  
   2302                     if (match.hit)
  
   2303                     {
  
   2304                         System.Parsing.Match match(false);
  
   2305                         System.Parsing.Match* parentMatch5 = &match;
  
   2306                         {
  
   2307                             System.Parsing.Match match(false);
  
   2308                             if (*lexer == 39)
  
   2309                             {
  
   2310                                 auto incResult1 = ++lexer;
  
   2311                                 if (incResult1.Error())
  
   2312                                 {
  
   2313                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   2314                                 }
  
   2315                                 match.hit = true;
  
   2316                             }
  
   2317                             *parentMatch5 = match;
  
   2318                         }
  
   2319                         *parentMatch2 = match;
  
   2320                     }
  
   2321                     *parentMatch1 = match;
  
   2322                 }
  
   2323                 if (match.hit)
  
   2324                 {
  
   2325                     #if (DEBUG)
  
   2326                         if (parser_debug_write_to_log)
  
   2327                         {
  
   2328                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNumSQ");
  
   2329                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2330                         }
  
   2331                     #endif
  
   2332                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2333                 }
  
   2334                 *parentMatch0 = match;
  
   2335             }
  
   2336             #if (DEBUG)
  
   2337             if (parser_debug_write_to_log)
  
   2338             {
  
   2339                 if (match.hit)
  
   2340                 {
  
   2341                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNumSQ");
  
   2342                     if (result.Error())
  
   2343                     {
  
   2344                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2345                     }
  
   2346                 }
  
   2347                 else
  
   2348                 {
  
   2349                     auto result = System.Lex.WriteFailureToLog(lexer, u"VersionNumSQ");
  
   2350                     if (result.Error())
  
   2351                     {
  
   2352                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2353                     }
  
   2354                 }
  
   2355             }
  
   2356             #endif
  
   2357             if (!match.hit)
  
   2358             {
  
   2359                 match.value = null;
  
   2360             }
  
   2361             return System.Result<System.Parsing.Match>(match);
  
   2362         }
  
   2363         public static System.Result<System.Parsing.Match> VersionNumber(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   2364         {
  
   2365             #if (DEBUG)
  
   2366             long parser_debug_match_pos = 0;
  
   2367             bool parser_debug_write_to_log = lexer.Log() != null;
  
   2368             if (parser_debug_write_to_log)
  
   2369             {
  
   2370                 parser_debug_match_pos = lexer.GetPos();
  
   2371                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"VersionNumber");
  
   2372                 if (result.Error())
  
   2373                 {
  
   2374                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2375                 }
  
   2376             }
  
   2377             #endif
  
   2378             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475920);
  
   2379             System.UniquePtr<System.Parsing.Value<bool>> versionNumDQ;
  
   2380             System.UniquePtr<System.Parsing.Value<bool>> versionNumSQ;
  
   2381             System.Parsing.Match match(false);
  
   2382             System.Parsing.Match* parentMatch0 = &match;
  
   2383             {
  
   2384                 long pos = lexer.GetPos();
  
   2385                 System.Parsing.Match match(false);
  
   2386                 System.Parsing.Match* parentMatch1 = &match;
  
   2387                 {
  
   2388                     System.Parsing.Match match(false);
  
   2389                     System.Parsing.Match* parentMatch2 = &match;
  
   2390                     {
  
   2391                         long save = lexer.GetPos();
  
   2392                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.VersionNumDQ(lexer, processor);
  
   2393                         if (matchResult.Error())
  
   2394                         {
  
   2395                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2396                         }
  
   2397                         System.Parsing.Match match = matchResult.Value();
  
   2398                         versionNumDQ.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2399                         *parentMatch2 = match;
  
   2400                         if (!match.hit)
  
   2401                         {
  
   2402                             System.Parsing.Match match(false);
  
   2403                             System.Parsing.Match* parentMatch3 = &match;
  
   2404                             lexer.SetPos(save);
  
   2405                             {
  
   2406                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.VersionNumSQ(lexer, processor);
  
   2407                                 if (matchResult.Error())
  
   2408                                 {
  
   2409                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2410                                 }
  
   2411                                 System.Parsing.Match match = matchResult.Value();
  
   2412                                 versionNumSQ.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2413                                 *parentMatch3 = match;
  
   2414                             }
  
   2415                             *parentMatch2 = match;
  
   2416                         }
  
   2417                     }
  
   2418                     *parentMatch1 = match;
  
   2419                 }
  
   2420                 if (match.hit)
  
   2421                 {
  
   2422                     #if (DEBUG)
  
   2423                         if (parser_debug_write_to_log)
  
   2424                         {
  
   2425                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNumber");
  
   2426                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2427                         }
  
   2428                     #endif
  
   2429                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2430                 }
  
   2431                 *parentMatch0 = match;
  
   2432             }
  
   2433             #if (DEBUG)
  
   2434             if (parser_debug_write_to_log)
  
   2435             {
  
   2436                 if (match.hit)
  
   2437                 {
  
   2438                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"VersionNumber");
  
   2439                     if (result.Error())
  
   2440                     {
  
   2441                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2442                     }
  
   2443                 }
  
   2444                 else
  
   2445                 {
  
   2446                     auto result = System.Lex.WriteFailureToLog(lexer, u"VersionNumber");
  
   2447                     if (result.Error())
  
   2448                     {
  
   2449                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2450                     }
  
   2451                 }
  
   2452             }
  
   2453             #endif
  
   2454             if (!match.hit)
  
   2455             {
  
   2456                 match.value = null;
  
   2457             }
  
   2458             return System.Result<System.Parsing.Match>(match);
  
   2459         }
  
   2460         public static System.Result<System.Parsing.Match> EncodingDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   2461         {
  
   2462             #if (DEBUG)
  
   2463             long parser_debug_match_pos = 0;
  
   2464             bool parser_debug_write_to_log = lexer.Log() != null;
  
   2465             if (parser_debug_write_to_log)
  
   2466             {
  
   2467                 parser_debug_match_pos = lexer.GetPos();
  
   2468                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EncodingDecl");
  
   2469                 if (result.Error())
  
   2470                 {
  
   2471                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2472                 }
  
   2473             }
  
   2474             #endif
  
   2475             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475921);
  
   2476             System.UniquePtr<System.Parsing.Value<bool>> s;
  
   2477             System.UniquePtr<System.Parsing.Value<bool>> eq;
  
   2478             System.UniquePtr<System.Parsing.Value<bool>> encName;
  
   2479             System.Parsing.Match match(false);
  
   2480             System.Parsing.Match* parentMatch0 = &match;
  
   2481             {
  
   2482                 long pos = lexer.GetPos();
  
   2483                 System.Parsing.Match match(false);
  
   2484                 System.Parsing.Match* parentMatch1 = &match;
  
   2485                 {
  
   2486                     System.Parsing.Match match(false);
  
   2487                     System.Parsing.Match* parentMatch2 = &match;
  
   2488                     {
  
   2489                         System.Parsing.Match match(false);
  
   2490                         System.Parsing.Match* parentMatch3 = &match;
  
   2491                         {
  
   2492                             System.Parsing.Match match(false);
  
   2493                             System.Parsing.Match* parentMatch4 = &match;
  
   2494                             {
  
   2495                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   2496                                 if (matchResult.Error())
  
   2497                                 {
  
   2498                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2499                                 }
  
   2500                                 System.Parsing.Match match = matchResult.Value();
  
   2501                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2502                                 *parentMatch4 = match;
  
   2503                             }
  
   2504                             if (match.hit)
  
   2505                             {
  
   2506                                 System.Parsing.Match match(false);
  
   2507                                 System.Parsing.Match* parentMatch5 = &match;
  
   2508                                 {
  
   2509                                     System.Parsing.Match match(true);
  
   2510                                     for (int i : s8)
  
   2511                                     {
  
   2512                                         if (*lexer == i)
  
   2513                                         {
  
   2514                                             auto incResult0 = ++lexer;
  
   2515                                             if (incResult0.Error())
  
   2516                                             {
  
   2517                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   2518                                             }
  
   2519                                         }
  
   2520                                         else
  
   2521                                         {
  
   2522                                             match.hit = false;
  
   2523                                             break;
  
   2524                                         }
  
   2525                                     }
  
   2526                                     *parentMatch5 = match;
  
   2527                                 }
  
   2528                                 *parentMatch4 = match;
  
   2529                             }
  
   2530                             *parentMatch3 = match;
  
   2531                         }
  
   2532                         if (match.hit)
  
   2533                         {
  
   2534                             System.Parsing.Match match(false);
  
   2535                             System.Parsing.Match* parentMatch6 = &match;
  
   2536                             {
  
   2537                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Eq(lexer);
  
   2538                                 if (matchResult.Error())
  
   2539                                 {
  
   2540                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2541                                 }
  
   2542                                 System.Parsing.Match match = matchResult.Value();
  
   2543                                 eq.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2544                                 *parentMatch6 = match;
  
   2545                             }
  
   2546                             *parentMatch3 = match;
  
   2547                         }
  
   2548                         *parentMatch2 = match;
  
   2549                     }
  
   2550                     if (match.hit)
  
   2551                     {
  
   2552                         System.Parsing.Match match(false);
  
   2553                         System.Parsing.Match* parentMatch7 = &match;
  
   2554                         {
  
   2555                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EncName(lexer, processor);
  
   2556                             if (matchResult.Error())
  
   2557                             {
  
   2558                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2559                             }
  
   2560                             System.Parsing.Match match = matchResult.Value();
  
   2561                             encName.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2562                             *parentMatch7 = match;
  
   2563                         }
  
   2564                         *parentMatch2 = match;
  
   2565                     }
  
   2566                     *parentMatch1 = match;
  
   2567                 }
  
   2568                 if (match.hit)
  
   2569                 {
  
   2570                     #if (DEBUG)
  
   2571                         if (parser_debug_write_to_log)
  
   2572                         {
  
   2573                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncodingDecl");
  
   2574                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2575                         }
  
   2576                     #endif
  
   2577                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2578                 }
  
   2579                 *parentMatch0 = match;
  
   2580             }
  
   2581             #if (DEBUG)
  
   2582             if (parser_debug_write_to_log)
  
   2583             {
  
   2584                 if (match.hit)
  
   2585                 {
  
   2586                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncodingDecl");
  
   2587                     if (result.Error())
  
   2588                     {
  
   2589                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2590                     }
  
   2591                 }
  
   2592                 else
  
   2593                 {
  
   2594                     auto result = System.Lex.WriteFailureToLog(lexer, u"EncodingDecl");
  
   2595                     if (result.Error())
  
   2596                     {
  
   2597                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2598                     }
  
   2599                 }
  
   2600             }
  
   2601             #endif
  
   2602             if (!match.hit)
  
   2603             {
  
   2604                 match.value = null;
  
   2605             }
  
   2606             return System.Result<System.Parsing.Match>(match);
  
   2607         }
  
   2608         public static System.Result<System.Parsing.Match> EncodingName(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   2609         {
  
   2610             #if (DEBUG)
  
   2611             long parser_debug_match_pos = 0;
  
   2612             bool parser_debug_write_to_log = lexer.Log() != null;
  
   2613             if (parser_debug_write_to_log)
  
   2614             {
  
   2615                 parser_debug_match_pos = lexer.GetPos();
  
   2616                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EncodingName");
  
   2617                 if (result.Error())
  
   2618                 {
  
   2619                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2620                 }
  
   2621             }
  
   2622             #endif
  
   2623             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475922);
  
   2624             System.Lex.Lexeme m = System.Lex.Lexeme();
  
   2625             System.Parsing.Match match(false);
  
   2626             System.Parsing.Match* parentMatch0 = &match;
  
   2627             {
  
   2628                 long pos = lexer.GetPos();
  
   2629                 System.Parsing.Match match(false);
  
   2630                 System.Parsing.Match* parentMatch1 = &match;
  
   2631                 {
  
   2632                     System.Parsing.Match match(false);
  
   2633                     System.Parsing.Match* parentMatch2 = &match;
  
   2634                     {
  
   2635                         System.Parsing.Match match(false);
  
   2636                         System.Parsing.Match* parentMatch3 = &match;
  
   2637                         {
  
   2638                             long pos = lexer.GetPos();
  
   2639                             System.Parsing.Match match(false);
  
   2640                             for (const System.Parsing.Range& range : s9)
  
   2641                             {
  
   2642                                 if (*lexer >= range.first && *lexer <= range.last)
  
   2643                                 {
  
   2644                                     match.hit = true;
  
   2645                                     auto incResult0 = ++lexer;
  
   2646                                     if (incResult0.Error())
  
   2647                                     {
  
   2648                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   2649                                     }
  
   2650                                     break;
  
   2651                                 }
  
   2652                             }
  
   2653                             if (match.hit)
  
   2654                             {
  
   2655                                 m = lexer.GetToken(pos).match;
  
   2656                             }
  
   2657                             *parentMatch3 = match;
  
   2658                         }
  
   2659                         *parentMatch2 = match;
  
   2660                     }
  
   2661                     if (match.hit)
  
   2662                     {
  
   2663                         System.Parsing.Match match(false);
  
   2664                         System.Parsing.Match* parentMatch4 = &match;
  
   2665                         {
  
   2666                             System.Parsing.Match match(true);
  
   2667                             System.Parsing.Match* parentMatch5 = &match;
  
   2668                             {
  
   2669                                 while (true)
  
   2670                                 {
  
   2671                                     long save = lexer.GetPos();
  
   2672                                     {
  
   2673                                         System.Parsing.Match match(false);
  
   2674                                         System.Parsing.Match* parentMatch6 = &match;
  
   2675                                         {
  
   2676                                             System.Parsing.Match match(false);
  
   2677                                             System.Parsing.Match* parentMatch7 = &match;
  
   2678                                             {
  
   2679                                                 long pos = lexer.GetPos();
  
   2680                                                 System.Parsing.Match match(false);
  
   2681                                                 for (const System.Parsing.Range& range : s10)
  
   2682                                                 {
  
   2683                                                     if (*lexer >= range.first && *lexer <= range.last)
  
   2684                                                     {
  
   2685                                                         match.hit = true;
  
   2686                                                         auto incResult1 = ++lexer;
  
   2687                                                         if (incResult1.Error())
  
   2688                                                         {
  
   2689                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   2690                                                         }
  
   2691                                                         break;
  
   2692                                                     }
  
   2693                                                 }
  
   2694                                                 if (match.hit)
  
   2695                                                 {
  
   2696                                                     m.end = lexer.GetToken(pos).match.end;
  
   2697                                                 }
  
   2698                                                 *parentMatch7 = match;
  
   2699                                             }
  
   2700                                             *parentMatch6 = match;
  
   2701                                         }
  
   2702                                         if (match.hit)
  
   2703                                         {
  
   2704                                             *parentMatch5 = match;
  
   2705                                         }
  
   2706                                         else
  
   2707                                         {
  
   2708                                             lexer.SetPos(save);
  
   2709                                             break;
  
   2710                                         }
  
   2711                                     }
  
   2712                                 }
  
   2713                             }
  
   2714                             *parentMatch4 = match;
  
   2715                         }
  
   2716                         *parentMatch2 = match;
  
   2717                     }
  
   2718                     *parentMatch1 = match;
  
   2719                 }
  
   2720                 if (match.hit)
  
   2721                 {
  
   2722                     #if (DEBUG)
  
   2723                         if (parser_debug_write_to_log)
  
   2724                         {
  
   2725                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncodingName");
  
   2726                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2727                         }
  
   2728                     #endif
  
   2729                     auto result = processor->Encoding(m.ToString());
  
   2730                     if (result.Error())
  
   2731                     {
  
   2732                         return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
   2733                     }
  
   2734                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2735                 }
  
   2736                 *parentMatch0 = match;
  
   2737             }
  
   2738             #if (DEBUG)
  
   2739             if (parser_debug_write_to_log)
  
   2740             {
  
   2741                 if (match.hit)
  
   2742                 {
  
   2743                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncodingName");
  
   2744                     if (result.Error())
  
   2745                     {
  
   2746                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2747                     }
  
   2748                 }
  
   2749                 else
  
   2750                 {
  
   2751                     auto result = System.Lex.WriteFailureToLog(lexer, u"EncodingName");
  
   2752                     if (result.Error())
  
   2753                     {
  
   2754                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2755                     }
  
   2756                 }
  
   2757             }
  
   2758             #endif
  
   2759             if (!match.hit)
  
   2760             {
  
   2761                 match.value = null;
  
   2762             }
  
   2763             return System.Result<System.Parsing.Match>(match);
  
   2764         }
  
   2765         public static System.Result<System.Parsing.Match> EncNameDQ(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   2766         {
  
   2767             #if (DEBUG)
  
   2768             long parser_debug_match_pos = 0;
  
   2769             bool parser_debug_write_to_log = lexer.Log() != null;
  
   2770             if (parser_debug_write_to_log)
  
   2771             {
  
   2772                 parser_debug_match_pos = lexer.GetPos();
  
   2773                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EncNameDQ");
  
   2774                 if (result.Error())
  
   2775                 {
  
   2776                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2777                 }
  
   2778             }
  
   2779             #endif
  
   2780             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475923);
  
   2781             System.UniquePtr<System.Parsing.Value<bool>> encodingName;
  
   2782             System.Parsing.Match match(false);
  
   2783             System.Parsing.Match* parentMatch0 = &match;
  
   2784             {
  
   2785                 long pos = lexer.GetPos();
  
   2786                 System.Parsing.Match match(false);
  
   2787                 System.Parsing.Match* parentMatch1 = &match;
  
   2788                 {
  
   2789                     System.Parsing.Match match(false);
  
   2790                     System.Parsing.Match* parentMatch2 = &match;
  
   2791                     {
  
   2792                         System.Parsing.Match match(false);
  
   2793                         System.Parsing.Match* parentMatch3 = &match;
  
   2794                         {
  
   2795                             System.Parsing.Match match(false);
  
   2796                             if (*lexer == 34)
  
   2797                             {
  
   2798                                 auto incResult0 = ++lexer;
  
   2799                                 if (incResult0.Error())
  
   2800                                 {
  
   2801                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   2802                                 }
  
   2803                                 match.hit = true;
  
   2804                             }
  
   2805                             *parentMatch3 = match;
  
   2806                         }
  
   2807                         if (match.hit)
  
   2808                         {
  
   2809                             System.Parsing.Match match(false);
  
   2810                             System.Parsing.Match* parentMatch4 = &match;
  
   2811                             {
  
   2812                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EncodingName(lexer, processor);
  
   2813                                 if (matchResult.Error())
  
   2814                                 {
  
   2815                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2816                                 }
  
   2817                                 System.Parsing.Match match = matchResult.Value();
  
   2818                                 encodingName.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2819                                 *parentMatch4 = match;
  
   2820                             }
  
   2821                             *parentMatch3 = match;
  
   2822                         }
  
   2823                         *parentMatch2 = match;
  
   2824                     }
  
   2825                     if (match.hit)
  
   2826                     {
  
   2827                         System.Parsing.Match match(false);
  
   2828                         System.Parsing.Match* parentMatch5 = &match;
  
   2829                         {
  
   2830                             System.Parsing.Match match(false);
  
   2831                             if (*lexer == 34)
  
   2832                             {
  
   2833                                 auto incResult1 = ++lexer;
  
   2834                                 if (incResult1.Error())
  
   2835                                 {
  
   2836                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   2837                                 }
  
   2838                                 match.hit = true;
  
   2839                             }
  
   2840                             *parentMatch5 = match;
  
   2841                         }
  
   2842                         *parentMatch2 = match;
  
   2843                     }
  
   2844                     *parentMatch1 = match;
  
   2845                 }
  
   2846                 if (match.hit)
  
   2847                 {
  
   2848                     #if (DEBUG)
  
   2849                         if (parser_debug_write_to_log)
  
   2850                         {
  
   2851                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncNameDQ");
  
   2852                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2853                         }
  
   2854                     #endif
  
   2855                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2856                 }
  
   2857                 *parentMatch0 = match;
  
   2858             }
  
   2859             #if (DEBUG)
  
   2860             if (parser_debug_write_to_log)
  
   2861             {
  
   2862                 if (match.hit)
  
   2863                 {
  
   2864                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncNameDQ");
  
   2865                     if (result.Error())
  
   2866                     {
  
   2867                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2868                     }
  
   2869                 }
  
   2870                 else
  
   2871                 {
  
   2872                     auto result = System.Lex.WriteFailureToLog(lexer, u"EncNameDQ");
  
   2873                     if (result.Error())
  
   2874                     {
  
   2875                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2876                     }
  
   2877                 }
  
   2878             }
  
   2879             #endif
  
   2880             if (!match.hit)
  
   2881             {
  
   2882                 match.value = null;
  
   2883             }
  
   2884             return System.Result<System.Parsing.Match>(match);
  
   2885         }
  
   2886         public static System.Result<System.Parsing.Match> EncNameSQ(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   2887         {
  
   2888             #if (DEBUG)
  
   2889             long parser_debug_match_pos = 0;
  
   2890             bool parser_debug_write_to_log = lexer.Log() != null;
  
   2891             if (parser_debug_write_to_log)
  
   2892             {
  
   2893                 parser_debug_match_pos = lexer.GetPos();
  
   2894                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EncNameSQ");
  
   2895                 if (result.Error())
  
   2896                 {
  
   2897                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2898                 }
  
   2899             }
  
   2900             #endif
  
   2901             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475924);
  
   2902             System.UniquePtr<System.Parsing.Value<bool>> encodingName;
  
   2903             System.Parsing.Match match(false);
  
   2904             System.Parsing.Match* parentMatch0 = &match;
  
   2905             {
  
   2906                 long pos = lexer.GetPos();
  
   2907                 System.Parsing.Match match(false);
  
   2908                 System.Parsing.Match* parentMatch1 = &match;
  
   2909                 {
  
   2910                     System.Parsing.Match match(false);
  
   2911                     System.Parsing.Match* parentMatch2 = &match;
  
   2912                     {
  
   2913                         System.Parsing.Match match(false);
  
   2914                         System.Parsing.Match* parentMatch3 = &match;
  
   2915                         {
  
   2916                             System.Parsing.Match match(false);
  
   2917                             if (*lexer == 39)
  
   2918                             {
  
   2919                                 auto incResult0 = ++lexer;
  
   2920                                 if (incResult0.Error())
  
   2921                                 {
  
   2922                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   2923                                 }
  
   2924                                 match.hit = true;
  
   2925                             }
  
   2926                             *parentMatch3 = match;
  
   2927                         }
  
   2928                         if (match.hit)
  
   2929                         {
  
   2930                             System.Parsing.Match match(false);
  
   2931                             System.Parsing.Match* parentMatch4 = &match;
  
   2932                             {
  
   2933                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EncodingName(lexer, processor);
  
   2934                                 if (matchResult.Error())
  
   2935                                 {
  
   2936                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   2937                                 }
  
   2938                                 System.Parsing.Match match = matchResult.Value();
  
   2939                                 encodingName.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   2940                                 *parentMatch4 = match;
  
   2941                             }
  
   2942                             *parentMatch3 = match;
  
   2943                         }
  
   2944                         *parentMatch2 = match;
  
   2945                     }
  
   2946                     if (match.hit)
  
   2947                     {
  
   2948                         System.Parsing.Match match(false);
  
   2949                         System.Parsing.Match* parentMatch5 = &match;
  
   2950                         {
  
   2951                             System.Parsing.Match match(false);
  
   2952                             if (*lexer == 39)
  
   2953                             {
  
   2954                                 auto incResult1 = ++lexer;
  
   2955                                 if (incResult1.Error())
  
   2956                                 {
  
   2957                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   2958                                 }
  
   2959                                 match.hit = true;
  
   2960                             }
  
   2961                             *parentMatch5 = match;
  
   2962                         }
  
   2963                         *parentMatch2 = match;
  
   2964                     }
  
   2965                     *parentMatch1 = match;
  
   2966                 }
  
   2967                 if (match.hit)
  
   2968                 {
  
   2969                     #if (DEBUG)
  
   2970                         if (parser_debug_write_to_log)
  
   2971                         {
  
   2972                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncNameSQ");
  
   2973                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2974                         }
  
   2975                     #endif
  
   2976                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   2977                 }
  
   2978                 *parentMatch0 = match;
  
   2979             }
  
   2980             #if (DEBUG)
  
   2981             if (parser_debug_write_to_log)
  
   2982             {
  
   2983                 if (match.hit)
  
   2984                 {
  
   2985                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncNameSQ");
  
   2986                     if (result.Error())
  
   2987                     {
  
   2988                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2989                     }
  
   2990                 }
  
   2991                 else
  
   2992                 {
  
   2993                     auto result = System.Lex.WriteFailureToLog(lexer, u"EncNameSQ");
  
   2994                     if (result.Error())
  
   2995                     {
  
   2996                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   2997                     }
  
   2998                 }
  
   2999             }
  
   3000             #endif
  
   3001             if (!match.hit)
  
   3002             {
  
   3003                 match.value = null;
  
   3004             }
  
   3005             return System.Result<System.Parsing.Match>(match);
  
   3006         }
  
   3007         public static System.Result<System.Parsing.Match> EncName(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   3008         {
  
   3009             #if (DEBUG)
  
   3010             long parser_debug_match_pos = 0;
  
   3011             bool parser_debug_write_to_log = lexer.Log() != null;
  
   3012             if (parser_debug_write_to_log)
  
   3013             {
  
   3014                 parser_debug_match_pos = lexer.GetPos();
  
   3015                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EncName");
  
   3016                 if (result.Error())
  
   3017                 {
  
   3018                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3019                 }
  
   3020             }
  
   3021             #endif
  
   3022             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475925);
  
   3023             System.UniquePtr<System.Parsing.Value<bool>> encNameDQ;
  
   3024             System.UniquePtr<System.Parsing.Value<bool>> encNameSQ;
  
   3025             System.Parsing.Match match(false);
  
   3026             System.Parsing.Match* parentMatch0 = &match;
  
   3027             {
  
   3028                 long pos = lexer.GetPos();
  
   3029                 System.Parsing.Match match(false);
  
   3030                 System.Parsing.Match* parentMatch1 = &match;
  
   3031                 {
  
   3032                     System.Parsing.Match match(false);
  
   3033                     System.Parsing.Match* parentMatch2 = &match;
  
   3034                     {
  
   3035                         long save = lexer.GetPos();
  
   3036                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EncNameDQ(lexer, processor);
  
   3037                         if (matchResult.Error())
  
   3038                         {
  
   3039                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3040                         }
  
   3041                         System.Parsing.Match match = matchResult.Value();
  
   3042                         encNameDQ.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3043                         *parentMatch2 = match;
  
   3044                         if (!match.hit)
  
   3045                         {
  
   3046                             System.Parsing.Match match(false);
  
   3047                             System.Parsing.Match* parentMatch3 = &match;
  
   3048                             lexer.SetPos(save);
  
   3049                             {
  
   3050                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EncNameSQ(lexer, processor);
  
   3051                                 if (matchResult.Error())
  
   3052                                 {
  
   3053                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3054                                 }
  
   3055                                 System.Parsing.Match match = matchResult.Value();
  
   3056                                 encNameSQ.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3057                                 *parentMatch3 = match;
  
   3058                             }
  
   3059                             *parentMatch2 = match;
  
   3060                         }
  
   3061                     }
  
   3062                     *parentMatch1 = match;
  
   3063                 }
  
   3064                 if (match.hit)
  
   3065                 {
  
   3066                     #if (DEBUG)
  
   3067                         if (parser_debug_write_to_log)
  
   3068                         {
  
   3069                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncName");
  
   3070                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3071                         }
  
   3072                     #endif
  
   3073                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   3074                 }
  
   3075                 *parentMatch0 = match;
  
   3076             }
  
   3077             #if (DEBUG)
  
   3078             if (parser_debug_write_to_log)
  
   3079             {
  
   3080                 if (match.hit)
  
   3081                 {
  
   3082                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EncName");
  
   3083                     if (result.Error())
  
   3084                     {
  
   3085                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3086                     }
  
   3087                 }
  
   3088                 else
  
   3089                 {
  
   3090                     auto result = System.Lex.WriteFailureToLog(lexer, u"EncName");
  
   3091                     if (result.Error())
  
   3092                     {
  
   3093                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3094                     }
  
   3095                 }
  
   3096             }
  
   3097             #endif
  
   3098             if (!match.hit)
  
   3099             {
  
   3100                 match.value = null;
  
   3101             }
  
   3102             return System.Result<System.Parsing.Match>(match);
  
   3103         }
  
   3104         public static System.Result<System.Parsing.Match> SDDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   3105         {
  
   3106             #if (DEBUG)
  
   3107             long parser_debug_match_pos = 0;
  
   3108             bool parser_debug_write_to_log = lexer.Log() != null;
  
   3109             if (parser_debug_write_to_log)
  
   3110             {
  
   3111                 parser_debug_match_pos = lexer.GetPos();
  
   3112                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"SDDecl");
  
   3113                 if (result.Error())
  
   3114                 {
  
   3115                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3116                 }
  
   3117             }
  
   3118             #endif
  
   3119             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475926);
  
   3120             System.UniquePtr<System.Parsing.Value<bool>> s;
  
   3121             System.UniquePtr<System.Parsing.Value<bool>> eq;
  
   3122             System.UniquePtr<System.Parsing.Value<bool>> yn;
  
   3123             System.Parsing.Match match(false);
  
   3124             System.Parsing.Match* parentMatch0 = &match;
  
   3125             {
  
   3126                 long pos = lexer.GetPos();
  
   3127                 System.Parsing.Match match(false);
  
   3128                 System.Parsing.Match* parentMatch1 = &match;
  
   3129                 {
  
   3130                     System.Parsing.Match match(false);
  
   3131                     System.Parsing.Match* parentMatch2 = &match;
  
   3132                     {
  
   3133                         System.Parsing.Match match(false);
  
   3134                         System.Parsing.Match* parentMatch3 = &match;
  
   3135                         {
  
   3136                             System.Parsing.Match match(false);
  
   3137                             System.Parsing.Match* parentMatch4 = &match;
  
   3138                             {
  
   3139                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3140                                 if (matchResult.Error())
  
   3141                                 {
  
   3142                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3143                                 }
  
   3144                                 System.Parsing.Match match = matchResult.Value();
  
   3145                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3146                                 *parentMatch4 = match;
  
   3147                             }
  
   3148                             if (match.hit)
  
   3149                             {
  
   3150                                 System.Parsing.Match match(false);
  
   3151                                 System.Parsing.Match* parentMatch5 = &match;
  
   3152                                 {
  
   3153                                     System.Parsing.Match match(true);
  
   3154                                     for (int i : s11)
  
   3155                                     {
  
   3156                                         if (*lexer == i)
  
   3157                                         {
  
   3158                                             auto incResult0 = ++lexer;
  
   3159                                             if (incResult0.Error())
  
   3160                                             {
  
   3161                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   3162                                             }
  
   3163                                         }
  
   3164                                         else
  
   3165                                         {
  
   3166                                             match.hit = false;
  
   3167                                             break;
  
   3168                                         }
  
   3169                                     }
  
   3170                                     *parentMatch5 = match;
  
   3171                                 }
  
   3172                                 *parentMatch4 = match;
  
   3173                             }
  
   3174                             *parentMatch3 = match;
  
   3175                         }
  
   3176                         if (match.hit)
  
   3177                         {
  
   3178                             System.Parsing.Match match(false);
  
   3179                             System.Parsing.Match* parentMatch6 = &match;
  
   3180                             {
  
   3181                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Eq(lexer);
  
   3182                                 if (matchResult.Error())
  
   3183                                 {
  
   3184                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3185                                 }
  
   3186                                 System.Parsing.Match match = matchResult.Value();
  
   3187                                 eq.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3188                                 *parentMatch6 = match;
  
   3189                             }
  
   3190                             *parentMatch3 = match;
  
   3191                         }
  
   3192                         *parentMatch2 = match;
  
   3193                     }
  
   3194                     if (match.hit)
  
   3195                     {
  
   3196                         System.Parsing.Match match(false);
  
   3197                         System.Parsing.Match* parentMatch7 = &match;
  
   3198                         {
  
   3199                             System.Parsing.Match match(false);
  
   3200                             System.Parsing.Match* parentMatch8 = &match;
  
   3201                             {
  
   3202                                 long pos = lexer.GetPos();
  
   3203                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.YesNo(lexer);
  
   3204                                 if (matchResult.Error())
  
   3205                                 {
  
   3206                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3207                                 }
  
   3208                                 System.Parsing.Match match = matchResult.Value();
  
   3209                                 yn.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3210                                 if (match.hit)
  
   3211                                 {
  
   3212                                     auto result = processor->Standalone(yn->value);
  
   3213                                     if (result.Error())
  
   3214                                     {
  
   3215                                         return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
   3216                                     }
  
   3217                                 }
  
   3218                                 *parentMatch8 = match;
  
   3219                             }
  
   3220                             *parentMatch7 = match;
  
   3221                         }
  
   3222                         *parentMatch2 = match;
  
   3223                     }
  
   3224                     *parentMatch1 = match;
  
   3225                 }
  
   3226                 if (match.hit)
  
   3227                 {
  
   3228                     #if (DEBUG)
  
   3229                         if (parser_debug_write_to_log)
  
   3230                         {
  
   3231                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"SDDecl");
  
   3232                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3233                         }
  
   3234                     #endif
  
   3235                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   3236                 }
  
   3237                 *parentMatch0 = match;
  
   3238             }
  
   3239             #if (DEBUG)
  
   3240             if (parser_debug_write_to_log)
  
   3241             {
  
   3242                 if (match.hit)
  
   3243                 {
  
   3244                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"SDDecl");
  
   3245                     if (result.Error())
  
   3246                     {
  
   3247                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3248                     }
  
   3249                 }
  
   3250                 else
  
   3251                 {
  
   3252                     auto result = System.Lex.WriteFailureToLog(lexer, u"SDDecl");
  
   3253                     if (result.Error())
  
   3254                     {
  
   3255                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3256                     }
  
   3257                 }
  
   3258             }
  
   3259             #endif
  
   3260             if (!match.hit)
  
   3261             {
  
   3262                 match.value = null;
  
   3263             }
  
   3264             return System.Result<System.Parsing.Match>(match);
  
   3265         }
  
   3266         public static System.Result<System.Parsing.Match> DocTypeDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   3267         {
  
   3268             #if (DEBUG)
  
   3269             long parser_debug_match_pos = 0;
  
   3270             bool parser_debug_write_to_log = lexer.Log() != null;
  
   3271             if (parser_debug_write_to_log)
  
   3272             {
  
   3273                 parser_debug_match_pos = lexer.GetPos();
  
   3274                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"DocTypeDecl");
  
   3275                 if (result.Error())
  
   3276                 {
  
   3277                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3278                 }
  
   3279             }
  
   3280             #endif
  
   3281             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475927);
  
   3282             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   3283             System.UniquePtr<System.Parsing.Value<ustring>> rootElementName;
  
   3284             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   3285             System.UniquePtr<System.Parsing.Value<bool>> extID;
  
   3286             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   3287             System.UniquePtr<System.Parsing.Value<bool>> intSubset;
  
   3288             System.UniquePtr<System.Parsing.Value<bool>> s4;
  
   3289             System.Parsing.Match match(false);
  
   3290             System.Parsing.Match* parentMatch0 = &match;
  
   3291             {
  
   3292                 long pos = lexer.GetPos();
  
   3293                 System.Parsing.Match match(false);
  
   3294                 System.Parsing.Match* parentMatch1 = &match;
  
   3295                 {
  
   3296                     System.Parsing.Match match(false);
  
   3297                     System.Parsing.Match* parentMatch2 = &match;
  
   3298                     {
  
   3299                         System.Parsing.Match match(false);
  
   3300                         System.Parsing.Match* parentMatch3 = &match;
  
   3301                         {
  
   3302                             System.Parsing.Match match(false);
  
   3303                             System.Parsing.Match* parentMatch4 = &match;
  
   3304                             {
  
   3305                                 System.Parsing.Match match(false);
  
   3306                                 System.Parsing.Match* parentMatch5 = &match;
  
   3307                                 {
  
   3308                                     System.Parsing.Match match(false);
  
   3309                                     System.Parsing.Match* parentMatch6 = &match;
  
   3310                                     {
  
   3311                                         System.Parsing.Match match(false);
  
   3312                                         System.Parsing.Match* parentMatch7 = &match;
  
   3313                                         {
  
   3314                                             System.Parsing.Match match(true);
  
   3315                                             for (int i : s12)
  
   3316                                             {
  
   3317                                                 if (*lexer == i)
  
   3318                                                 {
  
   3319                                                     auto incResult0 = ++lexer;
  
   3320                                                     if (incResult0.Error())
  
   3321                                                     {
  
   3322                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   3323                                                     }
  
   3324                                                 }
  
   3325                                                 else
  
   3326                                                 {
  
   3327                                                     match.hit = false;
  
   3328                                                     break;
  
   3329                                                 }
  
   3330                                             }
  
   3331                                             *parentMatch7 = match;
  
   3332                                         }
  
   3333                                         if (match.hit)
  
   3334                                         {
  
   3335                                             System.Parsing.Match match(false);
  
   3336                                             System.Parsing.Match* parentMatch8 = &match;
  
   3337                                             {
  
   3338                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3339                                                 if (matchResult.Error())
  
   3340                                                 {
  
   3341                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3342                                                 }
  
   3343                                                 System.Parsing.Match match = matchResult.Value();
  
   3344                                                 s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3345                                                 *parentMatch8 = match;
  
   3346                                             }
  
   3347                                             *parentMatch7 = match;
  
   3348                                         }
  
   3349                                         *parentMatch6 = match;
  
   3350                                     }
  
   3351                                     if (match.hit)
  
   3352                                     {
  
   3353                                         System.Parsing.Match match(false);
  
   3354                                         System.Parsing.Match* parentMatch9 = &match;
  
   3355                                         {
  
   3356                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   3357                                             if (matchResult.Error())
  
   3358                                             {
  
   3359                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3360                                             }
  
   3361                                             System.Parsing.Match match = matchResult.Value();
  
   3362                                             rootElementName.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   3363                                             *parentMatch9 = match;
  
   3364                                         }
  
   3365                                         *parentMatch6 = match;
  
   3366                                     }
  
   3367                                     *parentMatch5 = match;
  
   3368                                 }
  
   3369                                 if (match.hit)
  
   3370                                 {
  
   3371                                     System.Parsing.Match match(false);
  
   3372                                     System.Parsing.Match* parentMatch10 = &match;
  
   3373                                     {
  
   3374                                         System.Parsing.Match match(true);
  
   3375                                         long save = lexer.GetPos();
  
   3376                                         System.Parsing.Match* parentMatch11 = &match;
  
   3377                                         {
  
   3378                                             System.Parsing.Match match(false);
  
   3379                                             System.Parsing.Match* parentMatch12 = &match;
  
   3380                                             {
  
   3381                                                 System.Parsing.Match match(false);
  
   3382                                                 System.Parsing.Match* parentMatch13 = &match;
  
   3383                                                 {
  
   3384                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3385                                                     if (matchResult.Error())
  
   3386                                                     {
  
   3387                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3388                                                     }
  
   3389                                                     System.Parsing.Match match = matchResult.Value();
  
   3390                                                     s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3391                                                     *parentMatch13 = match;
  
   3392                                                 }
  
   3393                                                 if (match.hit)
  
   3394                                                 {
  
   3395                                                     System.Parsing.Match match(false);
  
   3396                                                     System.Parsing.Match* parentMatch14 = &match;
  
   3397                                                     {
  
   3398                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.ExternalID(lexer);
  
   3399                                                         if (matchResult.Error())
  
   3400                                                         {
  
   3401                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3402                                                         }
  
   3403                                                         System.Parsing.Match match = matchResult.Value();
  
   3404                                                         extID.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3405                                                         *parentMatch14 = match;
  
   3406                                                     }
  
   3407                                                     *parentMatch13 = match;
  
   3408                                                 }
  
   3409                                                 *parentMatch12 = match;
  
   3410                                             }
  
   3411                                             if (match.hit)
  
   3412                                             {
  
   3413                                                 *parentMatch11 = match;
  
   3414                                             }
  
   3415                                             else
  
   3416                                             {
  
   3417                                                 lexer.SetPos(save);
  
   3418                                             }
  
   3419                                         }
  
   3420                                         *parentMatch10 = match;
  
   3421                                     }
  
   3422                                     *parentMatch5 = match;
  
   3423                                 }
  
   3424                                 *parentMatch4 = match;
  
   3425                             }
  
   3426                             if (match.hit)
  
   3427                             {
  
   3428                                 System.Parsing.Match match(false);
  
   3429                                 System.Parsing.Match* parentMatch15 = &match;
  
   3430                                 {
  
   3431                                     System.Parsing.Match match(true);
  
   3432                                     long save = lexer.GetPos();
  
   3433                                     System.Parsing.Match* parentMatch16 = &match;
  
   3434                                     {
  
   3435                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3436                                         if (matchResult.Error())
  
   3437                                         {
  
   3438                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3439                                         }
  
   3440                                         System.Parsing.Match match = matchResult.Value();
  
   3441                                         s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3442                                         if (match.hit)
  
   3443                                         {
  
   3444                                             *parentMatch16 = match;
  
   3445                                         }
  
   3446                                         else
  
   3447                                         {
  
   3448                                             lexer.SetPos(save);
  
   3449                                         }
  
   3450                                     }
  
   3451                                     *parentMatch15 = match;
  
   3452                                 }
  
   3453                                 *parentMatch4 = match;
  
   3454                             }
  
   3455                             *parentMatch3 = match;
  
   3456                         }
  
   3457                         if (match.hit)
  
   3458                         {
  
   3459                             System.Parsing.Match match(false);
  
   3460                             System.Parsing.Match* parentMatch17 = &match;
  
   3461                             {
  
   3462                                 System.Parsing.Match match(true);
  
   3463                                 long save = lexer.GetPos();
  
   3464                                 System.Parsing.Match* parentMatch18 = &match;
  
   3465                                 {
  
   3466                                     System.Parsing.Match match(false);
  
   3467                                     System.Parsing.Match* parentMatch19 = &match;
  
   3468                                     {
  
   3469                                         System.Parsing.Match match(false);
  
   3470                                         System.Parsing.Match* parentMatch20 = &match;
  
   3471                                         {
  
   3472                                             System.Parsing.Match match(false);
  
   3473                                             System.Parsing.Match* parentMatch21 = &match;
  
   3474                                             {
  
   3475                                                 System.Parsing.Match match(false);
  
   3476                                                 System.Parsing.Match* parentMatch22 = &match;
  
   3477                                                 {
  
   3478                                                     System.Parsing.Match match(false);
  
   3479                                                     if (*lexer == 91)
  
   3480                                                     {
  
   3481                                                         auto incResult1 = ++lexer;
  
   3482                                                         if (incResult1.Error())
  
   3483                                                         {
  
   3484                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   3485                                                         }
  
   3486                                                         match.hit = true;
  
   3487                                                     }
  
   3488                                                     *parentMatch22 = match;
  
   3489                                                 }
  
   3490                                                 if (match.hit)
  
   3491                                                 {
  
   3492                                                     System.Parsing.Match match(false);
  
   3493                                                     System.Parsing.Match* parentMatch23 = &match;
  
   3494                                                     {
  
   3495                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.IntSubset(lexer, processor);
  
   3496                                                         if (matchResult.Error())
  
   3497                                                         {
  
   3498                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3499                                                         }
  
   3500                                                         System.Parsing.Match match = matchResult.Value();
  
   3501                                                         intSubset.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3502                                                         *parentMatch23 = match;
  
   3503                                                     }
  
   3504                                                     *parentMatch22 = match;
  
   3505                                                 }
  
   3506                                                 *parentMatch21 = match;
  
   3507                                             }
  
   3508                                             if (match.hit)
  
   3509                                             {
  
   3510                                                 System.Parsing.Match match(false);
  
   3511                                                 System.Parsing.Match* parentMatch24 = &match;
  
   3512                                                 {
  
   3513                                                     System.Parsing.Match match(false);
  
   3514                                                     if (*lexer == 93)
  
   3515                                                     {
  
   3516                                                         auto incResult2 = ++lexer;
  
   3517                                                         if (incResult2.Error())
  
   3518                                                         {
  
   3519                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   3520                                                         }
  
   3521                                                         match.hit = true;
  
   3522                                                     }
  
   3523                                                     *parentMatch24 = match;
  
   3524                                                 }
  
   3525                                                 *parentMatch21 = match;
  
   3526                                             }
  
   3527                                             *parentMatch20 = match;
  
   3528                                         }
  
   3529                                         if (match.hit)
  
   3530                                         {
  
   3531                                             System.Parsing.Match match(false);
  
   3532                                             System.Parsing.Match* parentMatch25 = &match;
  
   3533                                             {
  
   3534                                                 System.Parsing.Match match(true);
  
   3535                                                 long save = lexer.GetPos();
  
   3536                                                 System.Parsing.Match* parentMatch26 = &match;
  
   3537                                                 {
  
   3538                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3539                                                     if (matchResult.Error())
  
   3540                                                     {
  
   3541                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3542                                                     }
  
   3543                                                     System.Parsing.Match match = matchResult.Value();
  
   3544                                                     s4.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3545                                                     if (match.hit)
  
   3546                                                     {
  
   3547                                                         *parentMatch26 = match;
  
   3548                                                     }
  
   3549                                                     else
  
   3550                                                     {
  
   3551                                                         lexer.SetPos(save);
  
   3552                                                     }
  
   3553                                                 }
  
   3554                                                 *parentMatch25 = match;
  
   3555                                             }
  
   3556                                             *parentMatch20 = match;
  
   3557                                         }
  
   3558                                         *parentMatch19 = match;
  
   3559                                     }
  
   3560                                     if (match.hit)
  
   3561                                     {
  
   3562                                         *parentMatch18 = match;
  
   3563                                     }
  
   3564                                     else
  
   3565                                     {
  
   3566                                         lexer.SetPos(save);
  
   3567                                     }
  
   3568                                 }
  
   3569                                 *parentMatch17 = match;
  
   3570                             }
  
   3571                             *parentMatch3 = match;
  
   3572                         }
  
   3573                         *parentMatch2 = match;
  
   3574                     }
  
   3575                     if (match.hit)
  
   3576                     {
  
   3577                         System.Parsing.Match match(false);
  
   3578                         System.Parsing.Match* parentMatch27 = &match;
  
   3579                         {
  
   3580                             System.Parsing.Match match(false);
  
   3581                             if (*lexer == 62)
  
   3582                             {
  
   3583                                 auto incResult3 = ++lexer;
  
   3584                                 if (incResult3.Error())
  
   3585                                 {
  
   3586                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   3587                                 }
  
   3588                                 match.hit = true;
  
   3589                             }
  
   3590                             *parentMatch27 = match;
  
   3591                         }
  
   3592                         *parentMatch2 = match;
  
   3593                     }
  
   3594                     *parentMatch1 = match;
  
   3595                 }
  
   3596                 if (match.hit)
  
   3597                 {
  
   3598                     #if (DEBUG)
  
   3599                         if (parser_debug_write_to_log)
  
   3600                         {
  
   3601                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DocTypeDecl");
  
   3602                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3603                         }
  
   3604                     #endif
  
   3605                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   3606                 }
  
   3607                 *parentMatch0 = match;
  
   3608             }
  
   3609             #if (DEBUG)
  
   3610             if (parser_debug_write_to_log)
  
   3611             {
  
   3612                 if (match.hit)
  
   3613                 {
  
   3614                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DocTypeDecl");
  
   3615                     if (result.Error())
  
   3616                     {
  
   3617                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3618                     }
  
   3619                 }
  
   3620                 else
  
   3621                 {
  
   3622                     auto result = System.Lex.WriteFailureToLog(lexer, u"DocTypeDecl");
  
   3623                     if (result.Error())
  
   3624                     {
  
   3625                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3626                     }
  
   3627                 }
  
   3628             }
  
   3629             #endif
  
   3630             if (!match.hit)
  
   3631             {
  
   3632                 match.value = null;
  
   3633             }
  
   3634             return System.Result<System.Parsing.Match>(match);
  
   3635         }
  
   3636         public static System.Result<System.Parsing.Match> ExternalID(LexerT& lexer)
  
   3637         {
  
   3638             #if (DEBUG)
  
   3639             long parser_debug_match_pos = 0;
  
   3640             bool parser_debug_write_to_log = lexer.Log() != null;
  
   3641             if (parser_debug_write_to_log)
  
   3642             {
  
   3643                 parser_debug_match_pos = lexer.GetPos();
  
   3644                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"ExternalID");
  
   3645                 if (result.Error())
  
   3646                 {
  
   3647                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3648                 }
  
   3649             }
  
   3650             #endif
  
   3651             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475928);
  
   3652             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   3653             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   3654             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   3655             System.UniquePtr<System.Parsing.Value<bool>> p2;
  
   3656             System.UniquePtr<System.Parsing.Value<bool>> s4;
  
   3657             System.UniquePtr<System.Parsing.Value<bool>> s5;
  
   3658             System.Parsing.Match match(false);
  
   3659             System.Parsing.Match* parentMatch0 = &match;
  
   3660             {
  
   3661                 long pos = lexer.GetPos();
  
   3662                 System.Parsing.Match match(false);
  
   3663                 System.Parsing.Match* parentMatch1 = &match;
  
   3664                 {
  
   3665                     System.Parsing.Match match(false);
  
   3666                     System.Parsing.Match* parentMatch2 = &match;
  
   3667                     {
  
   3668                         long save = lexer.GetPos();
  
   3669                         System.Parsing.Match match(false);
  
   3670                         System.Parsing.Match* parentMatch3 = &match;
  
   3671                         {
  
   3672                             System.Parsing.Match match(false);
  
   3673                             System.Parsing.Match* parentMatch4 = &match;
  
   3674                             {
  
   3675                                 System.Parsing.Match match(false);
  
   3676                                 System.Parsing.Match* parentMatch5 = &match;
  
   3677                                 {
  
   3678                                     System.Parsing.Match match(true);
  
   3679                                     for (int i : s13)
  
   3680                                     {
  
   3681                                         if (*lexer == i)
  
   3682                                         {
  
   3683                                             auto incResult0 = ++lexer;
  
   3684                                             if (incResult0.Error())
  
   3685                                             {
  
   3686                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   3687                                             }
  
   3688                                         }
  
   3689                                         else
  
   3690                                         {
  
   3691                                             match.hit = false;
  
   3692                                             break;
  
   3693                                         }
  
   3694                                     }
  
   3695                                     *parentMatch5 = match;
  
   3696                                 }
  
   3697                                 if (match.hit)
  
   3698                                 {
  
   3699                                     System.Parsing.Match match(false);
  
   3700                                     System.Parsing.Match* parentMatch6 = &match;
  
   3701                                     {
  
   3702                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3703                                         if (matchResult.Error())
  
   3704                                         {
  
   3705                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3706                                         }
  
   3707                                         System.Parsing.Match match = matchResult.Value();
  
   3708                                         s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3709                                         *parentMatch6 = match;
  
   3710                                     }
  
   3711                                     *parentMatch5 = match;
  
   3712                                 }
  
   3713                                 *parentMatch4 = match;
  
   3714                             }
  
   3715                             if (match.hit)
  
   3716                             {
  
   3717                                 System.Parsing.Match match(false);
  
   3718                                 System.Parsing.Match* parentMatch7 = &match;
  
   3719                                 {
  
   3720                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.SystemLiteral(lexer);
  
   3721                                     if (matchResult.Error())
  
   3722                                     {
  
   3723                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3724                                     }
  
   3725                                     System.Parsing.Match match = matchResult.Value();
  
   3726                                     s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3727                                     *parentMatch7 = match;
  
   3728                                 }
  
   3729                                 *parentMatch4 = match;
  
   3730                             }
  
   3731                             *parentMatch3 = match;
  
   3732                         }
  
   3733                         *parentMatch2 = match;
  
   3734                         if (!match.hit)
  
   3735                         {
  
   3736                             System.Parsing.Match match(false);
  
   3737                             System.Parsing.Match* parentMatch8 = &match;
  
   3738                             lexer.SetPos(save);
  
   3739                             {
  
   3740                                 System.Parsing.Match match(false);
  
   3741                                 System.Parsing.Match* parentMatch9 = &match;
  
   3742                                 {
  
   3743                                     System.Parsing.Match match(false);
  
   3744                                     System.Parsing.Match* parentMatch10 = &match;
  
   3745                                     {
  
   3746                                         System.Parsing.Match match(false);
  
   3747                                         System.Parsing.Match* parentMatch11 = &match;
  
   3748                                         {
  
   3749                                             System.Parsing.Match match(false);
  
   3750                                             System.Parsing.Match* parentMatch12 = &match;
  
   3751                                             {
  
   3752                                                 System.Parsing.Match match(false);
  
   3753                                                 System.Parsing.Match* parentMatch13 = &match;
  
   3754                                                 {
  
   3755                                                     System.Parsing.Match match(true);
  
   3756                                                     for (int i : s14)
  
   3757                                                     {
  
   3758                                                         if (*lexer == i)
  
   3759                                                         {
  
   3760                                                             auto incResult1 = ++lexer;
  
   3761                                                             if (incResult1.Error())
  
   3762                                                             {
  
   3763                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   3764                                                             }
  
   3765                                                         }
  
   3766                                                         else
  
   3767                                                         {
  
   3768                                                             match.hit = false;
  
   3769                                                             break;
  
   3770                                                         }
  
   3771                                                     }
  
   3772                                                     *parentMatch13 = match;
  
   3773                                                 }
  
   3774                                                 if (match.hit)
  
   3775                                                 {
  
   3776                                                     System.Parsing.Match match(false);
  
   3777                                                     System.Parsing.Match* parentMatch14 = &match;
  
   3778                                                     {
  
   3779                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3780                                                         if (matchResult.Error())
  
   3781                                                         {
  
   3782                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3783                                                         }
  
   3784                                                         System.Parsing.Match match = matchResult.Value();
  
   3785                                                         s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3786                                                         *parentMatch14 = match;
  
   3787                                                     }
  
   3788                                                     *parentMatch13 = match;
  
   3789                                                 }
  
   3790                                                 *parentMatch12 = match;
  
   3791                                             }
  
   3792                                             if (match.hit)
  
   3793                                             {
  
   3794                                                 System.Parsing.Match match(false);
  
   3795                                                 System.Parsing.Match* parentMatch15 = &match;
  
   3796                                                 {
  
   3797                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PubidLiteral(lexer);
  
   3798                                                     if (matchResult.Error())
  
   3799                                                     {
  
   3800                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3801                                                     }
  
   3802                                                     System.Parsing.Match match = matchResult.Value();
  
   3803                                                     p2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3804                                                     *parentMatch15 = match;
  
   3805                                                 }
  
   3806                                                 *parentMatch12 = match;
  
   3807                                             }
  
   3808                                             *parentMatch11 = match;
  
   3809                                         }
  
   3810                                         if (match.hit)
  
   3811                                         {
  
   3812                                             System.Parsing.Match match(false);
  
   3813                                             System.Parsing.Match* parentMatch16 = &match;
  
   3814                                             {
  
   3815                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   3816                                                 if (matchResult.Error())
  
   3817                                                 {
  
   3818                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3819                                                 }
  
   3820                                                 System.Parsing.Match match = matchResult.Value();
  
   3821                                                 s4.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3822                                                 *parentMatch16 = match;
  
   3823                                             }
  
   3824                                             *parentMatch11 = match;
  
   3825                                         }
  
   3826                                         *parentMatch10 = match;
  
   3827                                     }
  
   3828                                     if (match.hit)
  
   3829                                     {
  
   3830                                         System.Parsing.Match match(false);
  
   3831                                         System.Parsing.Match* parentMatch17 = &match;
  
   3832                                         {
  
   3833                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.SystemLiteral(lexer);
  
   3834                                             if (matchResult.Error())
  
   3835                                             {
  
   3836                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   3837                                             }
  
   3838                                             System.Parsing.Match match = matchResult.Value();
  
   3839                                             s5.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   3840                                             *parentMatch17 = match;
  
   3841                                         }
  
   3842                                         *parentMatch10 = match;
  
   3843                                     }
  
   3844                                     *parentMatch9 = match;
  
   3845                                 }
  
   3846                                 *parentMatch8 = match;
  
   3847                             }
  
   3848                             *parentMatch2 = match;
  
   3849                         }
  
   3850                     }
  
   3851                     *parentMatch1 = match;
  
   3852                 }
  
   3853                 if (match.hit)
  
   3854                 {
  
   3855                     #if (DEBUG)
  
   3856                         if (parser_debug_write_to_log)
  
   3857                         {
  
   3858                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ExternalID");
  
   3859                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3860                         }
  
   3861                     #endif
  
   3862                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   3863                 }
  
   3864                 *parentMatch0 = match;
  
   3865             }
  
   3866             #if (DEBUG)
  
   3867             if (parser_debug_write_to_log)
  
   3868             {
  
   3869                 if (match.hit)
  
   3870                 {
  
   3871                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ExternalID");
  
   3872                     if (result.Error())
  
   3873                     {
  
   3874                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3875                     }
  
   3876                 }
  
   3877                 else
  
   3878                 {
  
   3879                     auto result = System.Lex.WriteFailureToLog(lexer, u"ExternalID");
  
   3880                     if (result.Error())
  
   3881                     {
  
   3882                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3883                     }
  
   3884                 }
  
   3885             }
  
   3886             #endif
  
   3887             if (!match.hit)
  
   3888             {
  
   3889                 match.value = null;
  
   3890             }
  
   3891             return System.Result<System.Parsing.Match>(match);
  
   3892         }
  
   3893         public static System.Result<System.Parsing.Match> SystemLiteral(LexerT& lexer)
  
   3894         {
  
   3895             #if (DEBUG)
  
   3896             long parser_debug_match_pos = 0;
  
   3897             bool parser_debug_write_to_log = lexer.Log() != null;
  
   3898             if (parser_debug_write_to_log)
  
   3899             {
  
   3900                 parser_debug_match_pos = lexer.GetPos();
  
   3901                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"SystemLiteral");
  
   3902                 if (result.Error())
  
   3903                 {
  
   3904                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   3905                 }
  
   3906             }
  
   3907             #endif
  
   3908             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475929);
  
   3909             System.Parsing.Match match(false);
  
   3910             System.Parsing.Match* parentMatch0 = &match;
  
   3911             {
  
   3912                 long pos = lexer.GetPos();
  
   3913                 System.Parsing.Match match(false);
  
   3914                 System.Parsing.Match* parentMatch1 = &match;
  
   3915                 {
  
   3916                     System.Parsing.Match match(false);
  
   3917                     System.Parsing.Match* parentMatch2 = &match;
  
   3918                     {
  
   3919                         long save = lexer.GetPos();
  
   3920                         System.Parsing.Match match(false);
  
   3921                         System.Parsing.Match* parentMatch3 = &match;
  
   3922                         {
  
   3923                             System.Parsing.Match match(false);
  
   3924                             System.Parsing.Match* parentMatch4 = &match;
  
   3925                             {
  
   3926                                 System.Parsing.Match match(false);
  
   3927                                 System.Parsing.Match* parentMatch5 = &match;
  
   3928                                 {
  
   3929                                     System.Parsing.Match match(false);
  
   3930                                     if (*lexer == 34)
  
   3931                                     {
  
   3932                                         auto incResult0 = ++lexer;
  
   3933                                         if (incResult0.Error())
  
   3934                                         {
  
   3935                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   3936                                         }
  
   3937                                         match.hit = true;
  
   3938                                     }
  
   3939                                     *parentMatch5 = match;
  
   3940                                 }
  
   3941                                 if (match.hit)
  
   3942                                 {
  
   3943                                     System.Parsing.Match match(false);
  
   3944                                     System.Parsing.Match* parentMatch6 = &match;
  
   3945                                     {
  
   3946                                         System.Parsing.Match match(false);
  
   3947                                         System.Parsing.Match* parentMatch7 = &match;
  
   3948                                         {
  
   3949                                             System.Parsing.Match match(true);
  
   3950                                             System.Parsing.Match* parentMatch8 = &match;
  
   3951                                             {
  
   3952                                                 while (true)
  
   3953                                                 {
  
   3954                                                     long save = lexer.GetPos();
  
   3955                                                     {
  
   3956                                                         System.Parsing.Match match(lexer.Pos() != lexer.End());
  
   3957                                                         for (const System.Parsing.Range& range : s15)
  
   3958                                                         {
  
   3959                                                             if (*lexer >= range.first && *lexer <= range.last)
  
   3960                                                             {
  
   3961                                                                 match.hit = false;
  
   3962                                                                 break;
  
   3963                                                             }
  
   3964                                                         }
  
   3965                                                         if (match.hit)
  
   3966                                                         {
  
   3967                                                             auto incResult1 = ++lexer;
  
   3968                                                             if (incResult1.Error())
  
   3969                                                             {
  
   3970                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   3971                                                             }
  
   3972                                                         }
  
   3973                                                         if (match.hit)
  
   3974                                                         {
  
   3975                                                             *parentMatch8 = match;
  
   3976                                                         }
  
   3977                                                         else
  
   3978                                                         {
  
   3979                                                             lexer.SetPos(save);
  
   3980                                                             break;
  
   3981                                                         }
  
   3982                                                     }
  
   3983                                                 }
  
   3984                                             }
  
   3985                                             *parentMatch7 = match;
  
   3986                                         }
  
   3987                                         *parentMatch6 = match;
  
   3988                                     }
  
   3989                                     *parentMatch5 = match;
  
   3990                                 }
  
   3991                                 *parentMatch4 = match;
  
   3992                             }
  
   3993                             if (match.hit)
  
   3994                             {
  
   3995                                 System.Parsing.Match match(false);
  
   3996                                 System.Parsing.Match* parentMatch9 = &match;
  
   3997                                 {
  
   3998                                     System.Parsing.Match match(false);
  
   3999                                     if (*lexer == 34)
  
   4000                                     {
  
   4001                                         auto incResult2 = ++lexer;
  
   4002                                         if (incResult2.Error())
  
   4003                                         {
  
   4004                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   4005                                         }
  
   4006                                         match.hit = true;
  
   4007                                     }
  
   4008                                     *parentMatch9 = match;
  
   4009                                 }
  
   4010                                 *parentMatch4 = match;
  
   4011                             }
  
   4012                             *parentMatch3 = match;
  
   4013                         }
  
   4014                         *parentMatch2 = match;
  
   4015                         if (!match.hit)
  
   4016                         {
  
   4017                             System.Parsing.Match match(false);
  
   4018                             System.Parsing.Match* parentMatch10 = &match;
  
   4019                             lexer.SetPos(save);
  
   4020                             {
  
   4021                                 System.Parsing.Match match(false);
  
   4022                                 System.Parsing.Match* parentMatch11 = &match;
  
   4023                                 {
  
   4024                                     System.Parsing.Match match(false);
  
   4025                                     System.Parsing.Match* parentMatch12 = &match;
  
   4026                                     {
  
   4027                                         System.Parsing.Match match(false);
  
   4028                                         System.Parsing.Match* parentMatch13 = &match;
  
   4029                                         {
  
   4030                                             System.Parsing.Match match(false);
  
   4031                                             if (*lexer == 39)
  
   4032                                             {
  
   4033                                                 auto incResult3 = ++lexer;
  
   4034                                                 if (incResult3.Error())
  
   4035                                                 {
  
   4036                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   4037                                                 }
  
   4038                                                 match.hit = true;
  
   4039                                             }
  
   4040                                             *parentMatch13 = match;
  
   4041                                         }
  
   4042                                         if (match.hit)
  
   4043                                         {
  
   4044                                             System.Parsing.Match match(false);
  
   4045                                             System.Parsing.Match* parentMatch14 = &match;
  
   4046                                             {
  
   4047                                                 System.Parsing.Match match(false);
  
   4048                                                 System.Parsing.Match* parentMatch15 = &match;
  
   4049                                                 {
  
   4050                                                     System.Parsing.Match match(true);
  
   4051                                                     System.Parsing.Match* parentMatch16 = &match;
  
   4052                                                     {
  
   4053                                                         while (true)
  
   4054                                                         {
  
   4055                                                             long save = lexer.GetPos();
  
   4056                                                             {
  
   4057                                                                 System.Parsing.Match match(lexer.Pos() != lexer.End());
  
   4058                                                                 for (const System.Parsing.Range& range : s16)
  
   4059                                                                 {
  
   4060                                                                     if (*lexer >= range.first && *lexer <= range.last)
  
   4061                                                                     {
  
   4062                                                                         match.hit = false;
  
   4063                                                                         break;
  
   4064                                                                     }
  
   4065                                                                 }
  
   4066                                                                 if (match.hit)
  
   4067                                                                 {
  
   4068                                                                     auto incResult4 = ++lexer;
  
   4069                                                                     if (incResult4.Error())
  
   4070                                                                     {
  
   4071                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult4.GetErrorId()));
  
   4072                                                                     }
  
   4073                                                                 }
  
   4074                                                                 if (match.hit)
  
   4075                                                                 {
  
   4076                                                                     *parentMatch16 = match;
  
   4077                                                                 }
  
   4078                                                                 else
  
   4079                                                                 {
  
   4080                                                                     lexer.SetPos(save);
  
   4081                                                                     break;
  
   4082                                                                 }
  
   4083                                                             }
  
   4084                                                         }
  
   4085                                                     }
  
   4086                                                     *parentMatch15 = match;
  
   4087                                                 }
  
   4088                                                 *parentMatch14 = match;
  
   4089                                             }
  
   4090                                             *parentMatch13 = match;
  
   4091                                         }
  
   4092                                         *parentMatch12 = match;
  
   4093                                     }
  
   4094                                     if (match.hit)
  
   4095                                     {
  
   4096                                         System.Parsing.Match match(false);
  
   4097                                         System.Parsing.Match* parentMatch17 = &match;
  
   4098                                         {
  
   4099                                             System.Parsing.Match match(false);
  
   4100                                             if (*lexer == 39)
  
   4101                                             {
  
   4102                                                 auto incResult5 = ++lexer;
  
   4103                                                 if (incResult5.Error())
  
   4104                                                 {
  
   4105                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult5.GetErrorId()));
  
   4106                                                 }
  
   4107                                                 match.hit = true;
  
   4108                                             }
  
   4109                                             *parentMatch17 = match;
  
   4110                                         }
  
   4111                                         *parentMatch12 = match;
  
   4112                                     }
  
   4113                                     *parentMatch11 = match;
  
   4114                                 }
  
   4115                                 *parentMatch10 = match;
  
   4116                             }
  
   4117                             *parentMatch2 = match;
  
   4118                         }
  
   4119                     }
  
   4120                     *parentMatch1 = match;
  
   4121                 }
  
   4122                 if (match.hit)
  
   4123                 {
  
   4124                     #if (DEBUG)
  
   4125                         if (parser_debug_write_to_log)
  
   4126                         {
  
   4127                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"SystemLiteral");
  
   4128                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4129                         }
  
   4130                     #endif
  
   4131                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   4132                 }
  
   4133                 *parentMatch0 = match;
  
   4134             }
  
   4135             #if (DEBUG)
  
   4136             if (parser_debug_write_to_log)
  
   4137             {
  
   4138                 if (match.hit)
  
   4139                 {
  
   4140                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"SystemLiteral");
  
   4141                     if (result.Error())
  
   4142                     {
  
   4143                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4144                     }
  
   4145                 }
  
   4146                 else
  
   4147                 {
  
   4148                     auto result = System.Lex.WriteFailureToLog(lexer, u"SystemLiteral");
  
   4149                     if (result.Error())
  
   4150                     {
  
   4151                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4152                     }
  
   4153                 }
  
   4154             }
  
   4155             #endif
  
   4156             if (!match.hit)
  
   4157             {
  
   4158                 match.value = null;
  
   4159             }
  
   4160             return System.Result<System.Parsing.Match>(match);
  
   4161         }
  
   4162         public static System.Result<System.Parsing.Match> PubidLiteral(LexerT& lexer)
  
   4163         {
  
   4164             #if (DEBUG)
  
   4165             long parser_debug_match_pos = 0;
  
   4166             bool parser_debug_write_to_log = lexer.Log() != null;
  
   4167             if (parser_debug_write_to_log)
  
   4168             {
  
   4169                 parser_debug_match_pos = lexer.GetPos();
  
   4170                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PubidLiteral");
  
   4171                 if (result.Error())
  
   4172                 {
  
   4173                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4174                 }
  
   4175             }
  
   4176             #endif
  
   4177             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475930);
  
   4178             System.UniquePtr<System.Parsing.Value<bool>> p1;
  
   4179             System.UniquePtr<System.Parsing.Value<bool>> p2;
  
   4180             System.Parsing.Match match(false);
  
   4181             System.Parsing.Match* parentMatch0 = &match;
  
   4182             {
  
   4183                 long pos = lexer.GetPos();
  
   4184                 System.Parsing.Match match(false);
  
   4185                 System.Parsing.Match* parentMatch1 = &match;
  
   4186                 {
  
   4187                     System.Parsing.Match match(false);
  
   4188                     System.Parsing.Match* parentMatch2 = &match;
  
   4189                     {
  
   4190                         long save = lexer.GetPos();
  
   4191                         System.Parsing.Match match(false);
  
   4192                         System.Parsing.Match* parentMatch3 = &match;
  
   4193                         {
  
   4194                             System.Parsing.Match match(false);
  
   4195                             System.Parsing.Match* parentMatch4 = &match;
  
   4196                             {
  
   4197                                 System.Parsing.Match match(false);
  
   4198                                 if (*lexer == 34)
  
   4199                                 {
  
   4200                                     auto incResult0 = ++lexer;
  
   4201                                     if (incResult0.Error())
  
   4202                                     {
  
   4203                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   4204                                     }
  
   4205                                     match.hit = true;
  
   4206                                 }
  
   4207                                 *parentMatch4 = match;
  
   4208                             }
  
   4209                             if (match.hit)
  
   4210                             {
  
   4211                                 System.Parsing.Match match(false);
  
   4212                                 System.Parsing.Match* parentMatch5 = &match;
  
   4213                                 {
  
   4214                                     System.Parsing.Match match(false);
  
   4215                                     System.Parsing.Match* parentMatch6 = &match;
  
   4216                                     {
  
   4217                                         System.Parsing.Match match(true);
  
   4218                                         System.Parsing.Match* parentMatch7 = &match;
  
   4219                                         {
  
   4220                                             while (true)
  
   4221                                             {
  
   4222                                                 long save = lexer.GetPos();
  
   4223                                                 {
  
   4224                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PubidChar(lexer);
  
   4225                                                     if (matchResult.Error())
  
   4226                                                     {
  
   4227                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4228                                                     }
  
   4229                                                     System.Parsing.Match match = matchResult.Value();
  
   4230                                                     p1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4231                                                     if (match.hit)
  
   4232                                                     {
  
   4233                                                         *parentMatch7 = match;
  
   4234                                                     }
  
   4235                                                     else
  
   4236                                                     {
  
   4237                                                         lexer.SetPos(save);
  
   4238                                                         break;
  
   4239                                                     }
  
   4240                                                 }
  
   4241                                             }
  
   4242                                         }
  
   4243                                         *parentMatch6 = match;
  
   4244                                     }
  
   4245                                     *parentMatch5 = match;
  
   4246                                 }
  
   4247                                 *parentMatch4 = match;
  
   4248                             }
  
   4249                             *parentMatch3 = match;
  
   4250                         }
  
   4251                         if (match.hit)
  
   4252                         {
  
   4253                             System.Parsing.Match match(false);
  
   4254                             System.Parsing.Match* parentMatch8 = &match;
  
   4255                             {
  
   4256                                 System.Parsing.Match match(false);
  
   4257                                 if (*lexer == 34)
  
   4258                                 {
  
   4259                                     auto incResult1 = ++lexer;
  
   4260                                     if (incResult1.Error())
  
   4261                                     {
  
   4262                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   4263                                     }
  
   4264                                     match.hit = true;
  
   4265                                 }
  
   4266                                 *parentMatch8 = match;
  
   4267                             }
  
   4268                             *parentMatch3 = match;
  
   4269                         }
  
   4270                         *parentMatch2 = match;
  
   4271                         if (!match.hit)
  
   4272                         {
  
   4273                             System.Parsing.Match match(false);
  
   4274                             System.Parsing.Match* parentMatch9 = &match;
  
   4275                             lexer.SetPos(save);
  
   4276                             {
  
   4277                                 System.Parsing.Match match(false);
  
   4278                                 System.Parsing.Match* parentMatch10 = &match;
  
   4279                                 {
  
   4280                                     System.Parsing.Match match(false);
  
   4281                                     System.Parsing.Match* parentMatch11 = &match;
  
   4282                                     {
  
   4283                                         System.Parsing.Match match(false);
  
   4284                                         if (*lexer == 39)
  
   4285                                         {
  
   4286                                             auto incResult2 = ++lexer;
  
   4287                                             if (incResult2.Error())
  
   4288                                             {
  
   4289                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   4290                                             }
  
   4291                                             match.hit = true;
  
   4292                                         }
  
   4293                                         *parentMatch11 = match;
  
   4294                                     }
  
   4295                                     if (match.hit)
  
   4296                                     {
  
   4297                                         System.Parsing.Match match(false);
  
   4298                                         System.Parsing.Match* parentMatch12 = &match;
  
   4299                                         {
  
   4300                                             System.Parsing.Match match(false);
  
   4301                                             System.Parsing.Match* parentMatch13 = &match;
  
   4302                                             {
  
   4303                                                 System.Parsing.Match match(true);
  
   4304                                                 System.Parsing.Match* parentMatch14 = &match;
  
   4305                                                 {
  
   4306                                                     while (true)
  
   4307                                                     {
  
   4308                                                         long save = lexer.GetPos();
  
   4309                                                         {
  
   4310                                                             System.Parsing.Match match(false);
  
   4311                                                             System.Parsing.Match* parentMatch15 = &match;
  
   4312                                                             {
  
   4313                                                                 System.Parsing.Match match(false);
  
   4314                                                                 System.Parsing.Match* parentMatch16 = &match;
  
   4315                                                                 long save = lexer.GetPos();
  
   4316                                                                 {
  
   4317                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PubidChar(lexer);
  
   4318                                                                     if (matchResult.Error())
  
   4319                                                                     {
  
   4320                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4321                                                                     }
  
   4322                                                                     System.Parsing.Match match = matchResult.Value();
  
   4323                                                                     p2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4324                                                                     *parentMatch16 = match;
  
   4325                                                                 }
  
   4326                                                                 if (match.hit)
  
   4327                                                                 {
  
   4328                                                                     System.Parsing.Match match(false);
  
   4329                                                                     System.Parsing.Match* parentMatch17 = &match;
  
   4330                                                                     {
  
   4331                                                                         long tmp = lexer.GetPos();
  
   4332                                                                         lexer.SetPos(save);
  
   4333                                                                         save = tmp;
  
   4334                                                                         System.Parsing.Match match(false);
  
   4335                                                                         if (*lexer == 39)
  
   4336                                                                         {
  
   4337                                                                             auto incResult3 = ++lexer;
  
   4338                                                                             if (incResult3.Error())
  
   4339                                                                             {
  
   4340                                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   4341                                                                             }
  
   4342                                                                             match.hit = true;
  
   4343                                                                         }
  
   4344                                                                         *parentMatch17 = match;
  
   4345                                                                     }
  
   4346                                                                     if (!match.hit)
  
   4347                                                                     {
  
   4348                                                                         lexer.SetPos(save);
  
   4349                                                                     }
  
   4350                                                                     *parentMatch16 = System.Parsing.Match(!match.hit, match.value);
  
   4351                                                                 }
  
   4352                                                                 *parentMatch15 = match;
  
   4353                                                             }
  
   4354                                                             if (match.hit)
  
   4355                                                             {
  
   4356                                                                 *parentMatch14 = match;
  
   4357                                                             }
  
   4358                                                             else
  
   4359                                                             {
  
   4360                                                                 lexer.SetPos(save);
  
   4361                                                                 break;
  
   4362                                                             }
  
   4363                                                         }
  
   4364                                                     }
  
   4365                                                 }
  
   4366                                                 *parentMatch13 = match;
  
   4367                                             }
  
   4368                                             *parentMatch12 = match;
  
   4369                                         }
  
   4370                                         *parentMatch11 = match;
  
   4371                                     }
  
   4372                                     *parentMatch10 = match;
  
   4373                                 }
  
   4374                                 if (match.hit)
  
   4375                                 {
  
   4376                                     System.Parsing.Match match(false);
  
   4377                                     System.Parsing.Match* parentMatch18 = &match;
  
   4378                                     {
  
   4379                                         System.Parsing.Match match(false);
  
   4380                                         if (*lexer == 39)
  
   4381                                         {
  
   4382                                             auto incResult4 = ++lexer;
  
   4383                                             if (incResult4.Error())
  
   4384                                             {
  
   4385                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult4.GetErrorId()));
  
   4386                                             }
  
   4387                                             match.hit = true;
  
   4388                                         }
  
   4389                                         *parentMatch18 = match;
  
   4390                                     }
  
   4391                                     *parentMatch10 = match;
  
   4392                                 }
  
   4393                                 *parentMatch9 = match;
  
   4394                             }
  
   4395                             *parentMatch2 = match;
  
   4396                         }
  
   4397                     }
  
   4398                     *parentMatch1 = match;
  
   4399                 }
  
   4400                 if (match.hit)
  
   4401                 {
  
   4402                     #if (DEBUG)
  
   4403                         if (parser_debug_write_to_log)
  
   4404                         {
  
   4405                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PubidLiteral");
  
   4406                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4407                         }
  
   4408                     #endif
  
   4409                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   4410                 }
  
   4411                 *parentMatch0 = match;
  
   4412             }
  
   4413             #if (DEBUG)
  
   4414             if (parser_debug_write_to_log)
  
   4415             {
  
   4416                 if (match.hit)
  
   4417                 {
  
   4418                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PubidLiteral");
  
   4419                     if (result.Error())
  
   4420                     {
  
   4421                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4422                     }
  
   4423                 }
  
   4424                 else
  
   4425                 {
  
   4426                     auto result = System.Lex.WriteFailureToLog(lexer, u"PubidLiteral");
  
   4427                     if (result.Error())
  
   4428                     {
  
   4429                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4430                     }
  
   4431                 }
  
   4432             }
  
   4433             #endif
  
   4434             if (!match.hit)
  
   4435             {
  
   4436                 match.value = null;
  
   4437             }
  
   4438             return System.Result<System.Parsing.Match>(match);
  
   4439         }
  
   4440         public static System.Result<System.Parsing.Match> PubidChar(LexerT& lexer)
  
   4441         {
  
   4442             #if (DEBUG)
  
   4443             long parser_debug_match_pos = 0;
  
   4444             bool parser_debug_write_to_log = lexer.Log() != null;
  
   4445             if (parser_debug_write_to_log)
  
   4446             {
  
   4447                 parser_debug_match_pos = lexer.GetPos();
  
   4448                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PubidChar");
  
   4449                 if (result.Error())
  
   4450                 {
  
   4451                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4452                 }
  
   4453             }
  
   4454             #endif
  
   4455             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475931);
  
   4456             System.Parsing.Match match(false);
  
   4457             System.Parsing.Match* parentMatch0 = &match;
  
   4458             {
  
   4459                 long pos = lexer.GetPos();
  
   4460                 System.Parsing.Match match(false);
  
   4461                 System.Parsing.Match* parentMatch1 = &match;
  
   4462                 {
  
   4463                     System.Parsing.Match match(false);
  
   4464                     System.Parsing.Match* parentMatch2 = &match;
  
   4465                     {
  
   4466                         long save = lexer.GetPos();
  
   4467                         System.Parsing.Match match(false);
  
   4468                         System.Parsing.Match* parentMatch3 = &match;
  
   4469                         {
  
   4470                             long save = lexer.GetPos();
  
   4471                             System.Parsing.Match match(false);
  
   4472                             for (const System.Parsing.Range& range : s17)
  
   4473                             {
  
   4474                                 if (*lexer >= range.first && *lexer <= range.last)
  
   4475                                 {
  
   4476                                     match.hit = true;
  
   4477                                     auto incResult0 = ++lexer;
  
   4478                                     if (incResult0.Error())
  
   4479                                     {
  
   4480                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   4481                                     }
  
   4482                                     break;
  
   4483                                 }
  
   4484                             }
  
   4485                             *parentMatch3 = match;
  
   4486                             if (!match.hit)
  
   4487                             {
  
   4488                                 System.Parsing.Match match(false);
  
   4489                                 System.Parsing.Match* parentMatch4 = &match;
  
   4490                                 lexer.SetPos(save);
  
   4491                                 {
  
   4492                                     System.Parsing.Match match(false);
  
   4493                                     for (const System.Parsing.Range& range : s18)
  
   4494                                     {
  
   4495                                         if (*lexer >= range.first && *lexer <= range.last)
  
   4496                                         {
  
   4497                                             match.hit = true;
  
   4498                                             auto incResult1 = ++lexer;
  
   4499                                             if (incResult1.Error())
  
   4500                                             {
  
   4501                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   4502                                             }
  
   4503                                             break;
  
   4504                                         }
  
   4505                                     }
  
   4506                                     *parentMatch4 = match;
  
   4507                                 }
  
   4508                                 *parentMatch3 = match;
  
   4509                             }
  
   4510                         }
  
   4511                         *parentMatch2 = match;
  
   4512                         if (!match.hit)
  
   4513                         {
  
   4514                             System.Parsing.Match match(false);
  
   4515                             System.Parsing.Match* parentMatch5 = &match;
  
   4516                             lexer.SetPos(save);
  
   4517                             {
  
   4518                                 System.Parsing.Match match(false);
  
   4519                                 for (const System.Parsing.Range& range : s19)
  
   4520                                 {
  
   4521                                     if (*lexer >= range.first && *lexer <= range.last)
  
   4522                                     {
  
   4523                                         match.hit = true;
  
   4524                                         auto incResult2 = ++lexer;
  
   4525                                         if (incResult2.Error())
  
   4526                                         {
  
   4527                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   4528                                         }
  
   4529                                         break;
  
   4530                                     }
  
   4531                                 }
  
   4532                                 *parentMatch5 = match;
  
   4533                             }
  
   4534                             *parentMatch2 = match;
  
   4535                         }
  
   4536                     }
  
   4537                     *parentMatch1 = match;
  
   4538                 }
  
   4539                 if (match.hit)
  
   4540                 {
  
   4541                     #if (DEBUG)
  
   4542                         if (parser_debug_write_to_log)
  
   4543                         {
  
   4544                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PubidChar");
  
   4545                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4546                         }
  
   4547                     #endif
  
   4548                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   4549                 }
  
   4550                 *parentMatch0 = match;
  
   4551             }
  
   4552             #if (DEBUG)
  
   4553             if (parser_debug_write_to_log)
  
   4554             {
  
   4555                 if (match.hit)
  
   4556                 {
  
   4557                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PubidChar");
  
   4558                     if (result.Error())
  
   4559                     {
  
   4560                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4561                     }
  
   4562                 }
  
   4563                 else
  
   4564                 {
  
   4565                     auto result = System.Lex.WriteFailureToLog(lexer, u"PubidChar");
  
   4566                     if (result.Error())
  
   4567                     {
  
   4568                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4569                     }
  
   4570                 }
  
   4571             }
  
   4572             #endif
  
   4573             if (!match.hit)
  
   4574             {
  
   4575                 match.value = null;
  
   4576             }
  
   4577             return System.Result<System.Parsing.Match>(match);
  
   4578         }
  
   4579         public static System.Result<System.Parsing.Match> IntSubset(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   4580         {
  
   4581             #if (DEBUG)
  
   4582             long parser_debug_match_pos = 0;
  
   4583             bool parser_debug_write_to_log = lexer.Log() != null;
  
   4584             if (parser_debug_write_to_log)
  
   4585             {
  
   4586                 parser_debug_match_pos = lexer.GetPos();
  
   4587                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"IntSubset");
  
   4588                 if (result.Error())
  
   4589                 {
  
   4590                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4591                 }
  
   4592             }
  
   4593             #endif
  
   4594             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475932);
  
   4595             System.UniquePtr<System.Parsing.Value<bool>> mdecl;
  
   4596             System.UniquePtr<System.Parsing.Value<bool>> declsep;
  
   4597             System.Parsing.Match match(false);
  
   4598             System.Parsing.Match* parentMatch0 = &match;
  
   4599             {
  
   4600                 long pos = lexer.GetPos();
  
   4601                 System.Parsing.Match match(false);
  
   4602                 System.Parsing.Match* parentMatch1 = &match;
  
   4603                 {
  
   4604                     System.Parsing.Match match(true);
  
   4605                     System.Parsing.Match* parentMatch2 = &match;
  
   4606                     {
  
   4607                         while (true)
  
   4608                         {
  
   4609                             long save = lexer.GetPos();
  
   4610                             {
  
   4611                                 System.Parsing.Match match(false);
  
   4612                                 System.Parsing.Match* parentMatch3 = &match;
  
   4613                                 {
  
   4614                                     System.Parsing.Match match(false);
  
   4615                                     System.Parsing.Match* parentMatch4 = &match;
  
   4616                                     {
  
   4617                                         long save = lexer.GetPos();
  
   4618                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.MarkupDecl(lexer, processor);
  
   4619                                         if (matchResult.Error())
  
   4620                                         {
  
   4621                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4622                                         }
  
   4623                                         System.Parsing.Match match = matchResult.Value();
  
   4624                                         mdecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4625                                         *parentMatch4 = match;
  
   4626                                         if (!match.hit)
  
   4627                                         {
  
   4628                                             System.Parsing.Match match(false);
  
   4629                                             System.Parsing.Match* parentMatch5 = &match;
  
   4630                                             lexer.SetPos(save);
  
   4631                                             {
  
   4632                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.DeclSep(lexer, processor);
  
   4633                                                 if (matchResult.Error())
  
   4634                                                 {
  
   4635                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4636                                                 }
  
   4637                                                 System.Parsing.Match match = matchResult.Value();
  
   4638                                                 declsep.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4639                                                 *parentMatch5 = match;
  
   4640                                             }
  
   4641                                             *parentMatch4 = match;
  
   4642                                         }
  
   4643                                     }
  
   4644                                     *parentMatch3 = match;
  
   4645                                 }
  
   4646                                 if (match.hit)
  
   4647                                 {
  
   4648                                     *parentMatch2 = match;
  
   4649                                 }
  
   4650                                 else
  
   4651                                 {
  
   4652                                     lexer.SetPos(save);
  
   4653                                     break;
  
   4654                                 }
  
   4655                             }
  
   4656                         }
  
   4657                     }
  
   4658                     *parentMatch1 = match;
  
   4659                 }
  
   4660                 if (match.hit)
  
   4661                 {
  
   4662                     #if (DEBUG)
  
   4663                         if (parser_debug_write_to_log)
  
   4664                         {
  
   4665                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"IntSubset");
  
   4666                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4667                         }
  
   4668                     #endif
  
   4669                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   4670                 }
  
   4671                 *parentMatch0 = match;
  
   4672             }
  
   4673             #if (DEBUG)
  
   4674             if (parser_debug_write_to_log)
  
   4675             {
  
   4676                 if (match.hit)
  
   4677                 {
  
   4678                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"IntSubset");
  
   4679                     if (result.Error())
  
   4680                     {
  
   4681                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4682                     }
  
   4683                 }
  
   4684                 else
  
   4685                 {
  
   4686                     auto result = System.Lex.WriteFailureToLog(lexer, u"IntSubset");
  
   4687                     if (result.Error())
  
   4688                     {
  
   4689                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4690                     }
  
   4691                 }
  
   4692             }
  
   4693             #endif
  
   4694             if (!match.hit)
  
   4695             {
  
   4696                 match.value = null;
  
   4697             }
  
   4698             return System.Result<System.Parsing.Match>(match);
  
   4699         }
  
   4700         public static System.Result<System.Parsing.Match> MarkupDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   4701         {
  
   4702             #if (DEBUG)
  
   4703             long parser_debug_match_pos = 0;
  
   4704             bool parser_debug_write_to_log = lexer.Log() != null;
  
   4705             if (parser_debug_write_to_log)
  
   4706             {
  
   4707                 parser_debug_match_pos = lexer.GetPos();
  
   4708                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"MarkupDecl");
  
   4709                 if (result.Error())
  
   4710                 {
  
   4711                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4712                 }
  
   4713             }
  
   4714             #endif
  
   4715             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475933);
  
   4716             System.UniquePtr<System.Parsing.Value<bool>> elementDecl;
  
   4717             System.UniquePtr<System.Parsing.Value<bool>> attlistDecl;
  
   4718             System.UniquePtr<System.Parsing.Value<bool>> entityDecl;
  
   4719             System.UniquePtr<System.Parsing.Value<bool>> notationDecl;
  
   4720             System.UniquePtr<System.Parsing.Value<bool>> pi;
  
   4721             System.UniquePtr<System.Parsing.Value<bool>> comment;
  
   4722             System.Parsing.Match match(false);
  
   4723             System.Parsing.Match* parentMatch0 = &match;
  
   4724             {
  
   4725                 long pos = lexer.GetPos();
  
   4726                 System.Parsing.Match match(false);
  
   4727                 System.Parsing.Match* parentMatch1 = &match;
  
   4728                 {
  
   4729                     System.Parsing.Match match(false);
  
   4730                     System.Parsing.Match* parentMatch2 = &match;
  
   4731                     {
  
   4732                         long save = lexer.GetPos();
  
   4733                         System.Parsing.Match match(false);
  
   4734                         System.Parsing.Match* parentMatch3 = &match;
  
   4735                         {
  
   4736                             long save = lexer.GetPos();
  
   4737                             System.Parsing.Match match(false);
  
   4738                             System.Parsing.Match* parentMatch4 = &match;
  
   4739                             {
  
   4740                                 long save = lexer.GetPos();
  
   4741                                 System.Parsing.Match match(false);
  
   4742                                 System.Parsing.Match* parentMatch5 = &match;
  
   4743                                 {
  
   4744                                     long save = lexer.GetPos();
  
   4745                                     System.Parsing.Match match(false);
  
   4746                                     System.Parsing.Match* parentMatch6 = &match;
  
   4747                                     {
  
   4748                                         long save = lexer.GetPos();
  
   4749                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.ElementDecl(lexer, processor);
  
   4750                                         if (matchResult.Error())
  
   4751                                         {
  
   4752                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4753                                         }
  
   4754                                         System.Parsing.Match match = matchResult.Value();
  
   4755                                         elementDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4756                                         *parentMatch6 = match;
  
   4757                                         if (!match.hit)
  
   4758                                         {
  
   4759                                             System.Parsing.Match match(false);
  
   4760                                             System.Parsing.Match* parentMatch7 = &match;
  
   4761                                             lexer.SetPos(save);
  
   4762                                             {
  
   4763                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.AttlistDecl(lexer, processor);
  
   4764                                                 if (matchResult.Error())
  
   4765                                                 {
  
   4766                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4767                                                 }
  
   4768                                                 System.Parsing.Match match = matchResult.Value();
  
   4769                                                 attlistDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4770                                                 *parentMatch7 = match;
  
   4771                                             }
  
   4772                                             *parentMatch6 = match;
  
   4773                                         }
  
   4774                                     }
  
   4775                                     *parentMatch5 = match;
  
   4776                                     if (!match.hit)
  
   4777                                     {
  
   4778                                         System.Parsing.Match match(false);
  
   4779                                         System.Parsing.Match* parentMatch8 = &match;
  
   4780                                         lexer.SetPos(save);
  
   4781                                         {
  
   4782                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EntityDecl(lexer, processor);
  
   4783                                             if (matchResult.Error())
  
   4784                                             {
  
   4785                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4786                                             }
  
   4787                                             System.Parsing.Match match = matchResult.Value();
  
   4788                                             entityDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4789                                             *parentMatch8 = match;
  
   4790                                         }
  
   4791                                         *parentMatch5 = match;
  
   4792                                     }
  
   4793                                 }
  
   4794                                 *parentMatch4 = match;
  
   4795                                 if (!match.hit)
  
   4796                                 {
  
   4797                                     System.Parsing.Match match(false);
  
   4798                                     System.Parsing.Match* parentMatch9 = &match;
  
   4799                                     lexer.SetPos(save);
  
   4800                                     {
  
   4801                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NotationDecl(lexer, processor);
  
   4802                                         if (matchResult.Error())
  
   4803                                         {
  
   4804                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4805                                         }
  
   4806                                         System.Parsing.Match match = matchResult.Value();
  
   4807                                         notationDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4808                                         *parentMatch9 = match;
  
   4809                                     }
  
   4810                                     *parentMatch4 = match;
  
   4811                                 }
  
   4812                             }
  
   4813                             *parentMatch3 = match;
  
   4814                             if (!match.hit)
  
   4815                             {
  
   4816                                 System.Parsing.Match match(false);
  
   4817                                 System.Parsing.Match* parentMatch10 = &match;
  
   4818                                 lexer.SetPos(save);
  
   4819                                 {
  
   4820                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PI(lexer, processor);
  
   4821                                     if (matchResult.Error())
  
   4822                                     {
  
   4823                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4824                                     }
  
   4825                                     System.Parsing.Match match = matchResult.Value();
  
   4826                                     pi.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4827                                     *parentMatch10 = match;
  
   4828                                 }
  
   4829                                 *parentMatch3 = match;
  
   4830                             }
  
   4831                         }
  
   4832                         *parentMatch2 = match;
  
   4833                         if (!match.hit)
  
   4834                         {
  
   4835                             System.Parsing.Match match(false);
  
   4836                             System.Parsing.Match* parentMatch11 = &match;
  
   4837                             lexer.SetPos(save);
  
   4838                             {
  
   4839                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Comment(lexer, processor);
  
   4840                                 if (matchResult.Error())
  
   4841                                 {
  
   4842                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4843                                 }
  
   4844                                 System.Parsing.Match match = matchResult.Value();
  
   4845                                 comment.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4846                                 *parentMatch11 = match;
  
   4847                             }
  
   4848                             *parentMatch2 = match;
  
   4849                         }
  
   4850                     }
  
   4851                     *parentMatch1 = match;
  
   4852                 }
  
   4853                 if (match.hit)
  
   4854                 {
  
   4855                     #if (DEBUG)
  
   4856                         if (parser_debug_write_to_log)
  
   4857                         {
  
   4858                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"MarkupDecl");
  
   4859                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4860                         }
  
   4861                     #endif
  
   4862                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   4863                 }
  
   4864                 *parentMatch0 = match;
  
   4865             }
  
   4866             #if (DEBUG)
  
   4867             if (parser_debug_write_to_log)
  
   4868             {
  
   4869                 if (match.hit)
  
   4870                 {
  
   4871                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"MarkupDecl");
  
   4872                     if (result.Error())
  
   4873                     {
  
   4874                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4875                     }
  
   4876                 }
  
   4877                 else
  
   4878                 {
  
   4879                     auto result = System.Lex.WriteFailureToLog(lexer, u"MarkupDecl");
  
   4880                     if (result.Error())
  
   4881                     {
  
   4882                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4883                     }
  
   4884                 }
  
   4885             }
  
   4886             #endif
  
   4887             if (!match.hit)
  
   4888             {
  
   4889                 match.value = null;
  
   4890             }
  
   4891             return System.Result<System.Parsing.Match>(match);
  
   4892         }
  
   4893         public static System.Result<System.Parsing.Match> DeclSep(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   4894         {
  
   4895             #if (DEBUG)
  
   4896             long parser_debug_match_pos = 0;
  
   4897             bool parser_debug_write_to_log = lexer.Log() != null;
  
   4898             if (parser_debug_write_to_log)
  
   4899             {
  
   4900                 parser_debug_match_pos = lexer.GetPos();
  
   4901                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"DeclSep");
  
   4902                 if (result.Error())
  
   4903                 {
  
   4904                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4905                 }
  
   4906             }
  
   4907             #endif
  
   4908             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475934);
  
   4909             System.UniquePtr<System.Parsing.Value<bool>> peref;
  
   4910             System.UniquePtr<System.Parsing.Value<bool>> s;
  
   4911             System.Parsing.Match match(false);
  
   4912             System.Parsing.Match* parentMatch0 = &match;
  
   4913             {
  
   4914                 long pos = lexer.GetPos();
  
   4915                 System.Parsing.Match match(false);
  
   4916                 System.Parsing.Match* parentMatch1 = &match;
  
   4917                 {
  
   4918                     System.Parsing.Match match(false);
  
   4919                     System.Parsing.Match* parentMatch2 = &match;
  
   4920                     {
  
   4921                         long save = lexer.GetPos();
  
   4922                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PEReference(lexer, processor);
  
   4923                         if (matchResult.Error())
  
   4924                         {
  
   4925                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4926                         }
  
   4927                         System.Parsing.Match match = matchResult.Value();
  
   4928                         peref.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4929                         *parentMatch2 = match;
  
   4930                         if (!match.hit)
  
   4931                         {
  
   4932                             System.Parsing.Match match(false);
  
   4933                             System.Parsing.Match* parentMatch3 = &match;
  
   4934                             lexer.SetPos(save);
  
   4935                             {
  
   4936                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   4937                                 if (matchResult.Error())
  
   4938                                 {
  
   4939                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   4940                                 }
  
   4941                                 System.Parsing.Match match = matchResult.Value();
  
   4942                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   4943                                 *parentMatch3 = match;
  
   4944                             }
  
   4945                             *parentMatch2 = match;
  
   4946                         }
  
   4947                     }
  
   4948                     *parentMatch1 = match;
  
   4949                 }
  
   4950                 if (match.hit)
  
   4951                 {
  
   4952                     #if (DEBUG)
  
   4953                         if (parser_debug_write_to_log)
  
   4954                         {
  
   4955                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DeclSep");
  
   4956                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4957                         }
  
   4958                     #endif
  
   4959                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   4960                 }
  
   4961                 *parentMatch0 = match;
  
   4962             }
  
   4963             #if (DEBUG)
  
   4964             if (parser_debug_write_to_log)
  
   4965             {
  
   4966                 if (match.hit)
  
   4967                 {
  
   4968                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DeclSep");
  
   4969                     if (result.Error())
  
   4970                     {
  
   4971                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4972                     }
  
   4973                 }
  
   4974                 else
  
   4975                 {
  
   4976                     auto result = System.Lex.WriteFailureToLog(lexer, u"DeclSep");
  
   4977                     if (result.Error())
  
   4978                     {
  
   4979                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   4980                     }
  
   4981                 }
  
   4982             }
  
   4983             #endif
  
   4984             if (!match.hit)
  
   4985             {
  
   4986                 match.value = null;
  
   4987             }
  
   4988             return System.Result<System.Parsing.Match>(match);
  
   4989         }
  
   4990         public static System.Result<System.Parsing.Match> ElementDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   4991         {
  
   4992             #if (DEBUG)
  
   4993             long parser_debug_match_pos = 0;
  
   4994             bool parser_debug_write_to_log = lexer.Log() != null;
  
   4995             if (parser_debug_write_to_log)
  
   4996             {
  
   4997                 parser_debug_match_pos = lexer.GetPos();
  
   4998                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"ElementDecl");
  
   4999                 if (result.Error())
  
   5000                 {
  
   5001                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5002                 }
  
   5003             }
  
   5004             #endif
  
   5005             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475935);
  
   5006             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   5007             System.UniquePtr<System.Parsing.Value<ustring>> elementName;
  
   5008             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   5009             System.UniquePtr<System.Parsing.Value<bool>> contentSpec;
  
   5010             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   5011             System.Parsing.Match match(false);
  
   5012             System.Parsing.Match* parentMatch0 = &match;
  
   5013             {
  
   5014                 long pos = lexer.GetPos();
  
   5015                 System.Parsing.Match match(false);
  
   5016                 System.Parsing.Match* parentMatch1 = &match;
  
   5017                 {
  
   5018                     System.Parsing.Match match(false);
  
   5019                     System.Parsing.Match* parentMatch2 = &match;
  
   5020                     {
  
   5021                         System.Parsing.Match match(false);
  
   5022                         System.Parsing.Match* parentMatch3 = &match;
  
   5023                         {
  
   5024                             System.Parsing.Match match(false);
  
   5025                             System.Parsing.Match* parentMatch4 = &match;
  
   5026                             {
  
   5027                                 System.Parsing.Match match(false);
  
   5028                                 System.Parsing.Match* parentMatch5 = &match;
  
   5029                                 {
  
   5030                                     System.Parsing.Match match(false);
  
   5031                                     System.Parsing.Match* parentMatch6 = &match;
  
   5032                                     {
  
   5033                                         System.Parsing.Match match(false);
  
   5034                                         System.Parsing.Match* parentMatch7 = &match;
  
   5035                                         {
  
   5036                                             System.Parsing.Match match(true);
  
   5037                                             for (int i : s20)
  
   5038                                             {
  
   5039                                                 if (*lexer == i)
  
   5040                                                 {
  
   5041                                                     auto incResult0 = ++lexer;
  
   5042                                                     if (incResult0.Error())
  
   5043                                                     {
  
   5044                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   5045                                                     }
  
   5046                                                 }
  
   5047                                                 else
  
   5048                                                 {
  
   5049                                                     match.hit = false;
  
   5050                                                     break;
  
   5051                                                 }
  
   5052                                             }
  
   5053                                             *parentMatch7 = match;
  
   5054                                         }
  
   5055                                         if (match.hit)
  
   5056                                         {
  
   5057                                             System.Parsing.Match match(false);
  
   5058                                             System.Parsing.Match* parentMatch8 = &match;
  
   5059                                             {
  
   5060                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   5061                                                 if (matchResult.Error())
  
   5062                                                 {
  
   5063                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5064                                                 }
  
   5065                                                 System.Parsing.Match match = matchResult.Value();
  
   5066                                                 s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5067                                                 *parentMatch8 = match;
  
   5068                                             }
  
   5069                                             *parentMatch7 = match;
  
   5070                                         }
  
   5071                                         *parentMatch6 = match;
  
   5072                                     }
  
   5073                                     if (match.hit)
  
   5074                                     {
  
   5075                                         System.Parsing.Match match(false);
  
   5076                                         System.Parsing.Match* parentMatch9 = &match;
  
   5077                                         {
  
   5078                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   5079                                             if (matchResult.Error())
  
   5080                                             {
  
   5081                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5082                                             }
  
   5083                                             System.Parsing.Match match = matchResult.Value();
  
   5084                                             elementName.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   5085                                             *parentMatch9 = match;
  
   5086                                         }
  
   5087                                         *parentMatch6 = match;
  
   5088                                     }
  
   5089                                     *parentMatch5 = match;
  
   5090                                 }
  
   5091                                 if (match.hit)
  
   5092                                 {
  
   5093                                     System.Parsing.Match match(false);
  
   5094                                     System.Parsing.Match* parentMatch10 = &match;
  
   5095                                     {
  
   5096                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   5097                                         if (matchResult.Error())
  
   5098                                         {
  
   5099                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5100                                         }
  
   5101                                         System.Parsing.Match match = matchResult.Value();
  
   5102                                         s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5103                                         *parentMatch10 = match;
  
   5104                                     }
  
   5105                                     *parentMatch5 = match;
  
   5106                                 }
  
   5107                                 *parentMatch4 = match;
  
   5108                             }
  
   5109                             if (match.hit)
  
   5110                             {
  
   5111                                 System.Parsing.Match match(false);
  
   5112                                 System.Parsing.Match* parentMatch11 = &match;
  
   5113                                 {
  
   5114                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.ContentSpec(lexer);
  
   5115                                     if (matchResult.Error())
  
   5116                                     {
  
   5117                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5118                                     }
  
   5119                                     System.Parsing.Match match = matchResult.Value();
  
   5120                                     contentSpec.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5121                                     *parentMatch11 = match;
  
   5122                                 }
  
   5123                                 *parentMatch4 = match;
  
   5124                             }
  
   5125                             *parentMatch3 = match;
  
   5126                         }
  
   5127                         if (match.hit)
  
   5128                         {
  
   5129                             System.Parsing.Match match(false);
  
   5130                             System.Parsing.Match* parentMatch12 = &match;
  
   5131                             {
  
   5132                                 System.Parsing.Match match(true);
  
   5133                                 long save = lexer.GetPos();
  
   5134                                 System.Parsing.Match* parentMatch13 = &match;
  
   5135                                 {
  
   5136                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   5137                                     if (matchResult.Error())
  
   5138                                     {
  
   5139                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5140                                     }
  
   5141                                     System.Parsing.Match match = matchResult.Value();
  
   5142                                     s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5143                                     if (match.hit)
  
   5144                                     {
  
   5145                                         *parentMatch13 = match;
  
   5146                                     }
  
   5147                                     else
  
   5148                                     {
  
   5149                                         lexer.SetPos(save);
  
   5150                                     }
  
   5151                                 }
  
   5152                                 *parentMatch12 = match;
  
   5153                             }
  
   5154                             *parentMatch3 = match;
  
   5155                         }
  
   5156                         *parentMatch2 = match;
  
   5157                     }
  
   5158                     if (match.hit)
  
   5159                     {
  
   5160                         System.Parsing.Match match(false);
  
   5161                         System.Parsing.Match* parentMatch14 = &match;
  
   5162                         {
  
   5163                             System.Parsing.Match match(false);
  
   5164                             if (*lexer == 62)
  
   5165                             {
  
   5166                                 auto incResult1 = ++lexer;
  
   5167                                 if (incResult1.Error())
  
   5168                                 {
  
   5169                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   5170                                 }
  
   5171                                 match.hit = true;
  
   5172                             }
  
   5173                             *parentMatch14 = match;
  
   5174                         }
  
   5175                         *parentMatch2 = match;
  
   5176                     }
  
   5177                     *parentMatch1 = match;
  
   5178                 }
  
   5179                 if (match.hit)
  
   5180                 {
  
   5181                     #if (DEBUG)
  
   5182                         if (parser_debug_write_to_log)
  
   5183                         {
  
   5184                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ElementDecl");
  
   5185                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5186                         }
  
   5187                     #endif
  
   5188                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   5189                 }
  
   5190                 *parentMatch0 = match;
  
   5191             }
  
   5192             #if (DEBUG)
  
   5193             if (parser_debug_write_to_log)
  
   5194             {
  
   5195                 if (match.hit)
  
   5196                 {
  
   5197                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ElementDecl");
  
   5198                     if (result.Error())
  
   5199                     {
  
   5200                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5201                     }
  
   5202                 }
  
   5203                 else
  
   5204                 {
  
   5205                     auto result = System.Lex.WriteFailureToLog(lexer, u"ElementDecl");
  
   5206                     if (result.Error())
  
   5207                     {
  
   5208                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5209                     }
  
   5210                 }
  
   5211             }
  
   5212             #endif
  
   5213             if (!match.hit)
  
   5214             {
  
   5215                 match.value = null;
  
   5216             }
  
   5217             return System.Result<System.Parsing.Match>(match);
  
   5218         }
  
   5219         public static System.Result<System.Parsing.Match> ContentSpec(LexerT& lexer)
  
   5220         {
  
   5221             #if (DEBUG)
  
   5222             long parser_debug_match_pos = 0;
  
   5223             bool parser_debug_write_to_log = lexer.Log() != null;
  
   5224             if (parser_debug_write_to_log)
  
   5225             {
  
   5226                 parser_debug_match_pos = lexer.GetPos();
  
   5227                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"ContentSpec");
  
   5228                 if (result.Error())
  
   5229                 {
  
   5230                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5231                 }
  
   5232             }
  
   5233             #endif
  
   5234             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475936);
  
   5235             System.UniquePtr<System.Parsing.Value<bool>> mixed;
  
   5236             System.UniquePtr<System.Parsing.Value<bool>> children;
  
   5237             System.Parsing.Match match(false);
  
   5238             System.Parsing.Match* parentMatch0 = &match;
  
   5239             {
  
   5240                 long pos = lexer.GetPos();
  
   5241                 System.Parsing.Match match(false);
  
   5242                 System.Parsing.Match* parentMatch1 = &match;
  
   5243                 {
  
   5244                     System.Parsing.Match match(false);
  
   5245                     System.Parsing.Match* parentMatch2 = &match;
  
   5246                     {
  
   5247                         long save = lexer.GetPos();
  
   5248                         System.Parsing.Match match(false);
  
   5249                         System.Parsing.Match* parentMatch3 = &match;
  
   5250                         {
  
   5251                             long save = lexer.GetPos();
  
   5252                             System.Parsing.Match match(false);
  
   5253                             System.Parsing.Match* parentMatch4 = &match;
  
   5254                             {
  
   5255                                 long save = lexer.GetPos();
  
   5256                                 System.Parsing.Match match(true);
  
   5257                                 for (int i : s21)
  
   5258                                 {
  
   5259                                     if (*lexer == i)
  
   5260                                     {
  
   5261                                         auto incResult0 = ++lexer;
  
   5262                                         if (incResult0.Error())
  
   5263                                         {
  
   5264                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   5265                                         }
  
   5266                                     }
  
   5267                                     else
  
   5268                                     {
  
   5269                                         match.hit = false;
  
   5270                                         break;
  
   5271                                     }
  
   5272                                 }
  
   5273                                 *parentMatch4 = match;
  
   5274                                 if (!match.hit)
  
   5275                                 {
  
   5276                                     System.Parsing.Match match(false);
  
   5277                                     System.Parsing.Match* parentMatch5 = &match;
  
   5278                                     lexer.SetPos(save);
  
   5279                                     {
  
   5280                                         System.Parsing.Match match(true);
  
   5281                                         for (int i : s22)
  
   5282                                         {
  
   5283                                             if (*lexer == i)
  
   5284                                             {
  
   5285                                                 auto incResult1 = ++lexer;
  
   5286                                                 if (incResult1.Error())
  
   5287                                                 {
  
   5288                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   5289                                                 }
  
   5290                                             }
  
   5291                                             else
  
   5292                                             {
  
   5293                                                 match.hit = false;
  
   5294                                                 break;
  
   5295                                             }
  
   5296                                         }
  
   5297                                         *parentMatch5 = match;
  
   5298                                     }
  
   5299                                     *parentMatch4 = match;
  
   5300                                 }
  
   5301                             }
  
   5302                             *parentMatch3 = match;
  
   5303                             if (!match.hit)
  
   5304                             {
  
   5305                                 System.Parsing.Match match(false);
  
   5306                                 System.Parsing.Match* parentMatch6 = &match;
  
   5307                                 lexer.SetPos(save);
  
   5308                                 {
  
   5309                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Mixed(lexer);
  
   5310                                     if (matchResult.Error())
  
   5311                                     {
  
   5312                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5313                                     }
  
   5314                                     System.Parsing.Match match = matchResult.Value();
  
   5315                                     mixed.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5316                                     *parentMatch6 = match;
  
   5317                                 }
  
   5318                                 *parentMatch3 = match;
  
   5319                             }
  
   5320                         }
  
   5321                         *parentMatch2 = match;
  
   5322                         if (!match.hit)
  
   5323                         {
  
   5324                             System.Parsing.Match match(false);
  
   5325                             System.Parsing.Match* parentMatch7 = &match;
  
   5326                             lexer.SetPos(save);
  
   5327                             {
  
   5328                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Children(lexer);
  
   5329                                 if (matchResult.Error())
  
   5330                                 {
  
   5331                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5332                                 }
  
   5333                                 System.Parsing.Match match = matchResult.Value();
  
   5334                                 children.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5335                                 *parentMatch7 = match;
  
   5336                             }
  
   5337                             *parentMatch2 = match;
  
   5338                         }
  
   5339                     }
  
   5340                     *parentMatch1 = match;
  
   5341                 }
  
   5342                 if (match.hit)
  
   5343                 {
  
   5344                     #if (DEBUG)
  
   5345                         if (parser_debug_write_to_log)
  
   5346                         {
  
   5347                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ContentSpec");
  
   5348                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5349                         }
  
   5350                     #endif
  
   5351                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   5352                 }
  
   5353                 *parentMatch0 = match;
  
   5354             }
  
   5355             #if (DEBUG)
  
   5356             if (parser_debug_write_to_log)
  
   5357             {
  
   5358                 if (match.hit)
  
   5359                 {
  
   5360                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ContentSpec");
  
   5361                     if (result.Error())
  
   5362                     {
  
   5363                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5364                     }
  
   5365                 }
  
   5366                 else
  
   5367                 {
  
   5368                     auto result = System.Lex.WriteFailureToLog(lexer, u"ContentSpec");
  
   5369                     if (result.Error())
  
   5370                     {
  
   5371                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5372                     }
  
   5373                 }
  
   5374             }
  
   5375             #endif
  
   5376             if (!match.hit)
  
   5377             {
  
   5378                 match.value = null;
  
   5379             }
  
   5380             return System.Result<System.Parsing.Match>(match);
  
   5381         }
  
   5382         public static System.Result<System.Parsing.Match> Children(LexerT& lexer)
  
   5383         {
  
   5384             #if (DEBUG)
  
   5385             long parser_debug_match_pos = 0;
  
   5386             bool parser_debug_write_to_log = lexer.Log() != null;
  
   5387             if (parser_debug_write_to_log)
  
   5388             {
  
   5389                 parser_debug_match_pos = lexer.GetPos();
  
   5390                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Children");
  
   5391                 if (result.Error())
  
   5392                 {
  
   5393                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5394                 }
  
   5395             }
  
   5396             #endif
  
   5397             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475937);
  
   5398             System.UniquePtr<System.Parsing.Value<bool>> choice;
  
   5399             System.UniquePtr<System.Parsing.Value<bool>> seq;
  
   5400             System.Parsing.Match match(false);
  
   5401             System.Parsing.Match* parentMatch0 = &match;
  
   5402             {
  
   5403                 long pos = lexer.GetPos();
  
   5404                 System.Parsing.Match match(false);
  
   5405                 System.Parsing.Match* parentMatch1 = &match;
  
   5406                 {
  
   5407                     System.Parsing.Match match(false);
  
   5408                     System.Parsing.Match* parentMatch2 = &match;
  
   5409                     {
  
   5410                         System.Parsing.Match match(false);
  
   5411                         System.Parsing.Match* parentMatch3 = &match;
  
   5412                         {
  
   5413                             System.Parsing.Match match(false);
  
   5414                             System.Parsing.Match* parentMatch4 = &match;
  
   5415                             {
  
   5416                                 long save = lexer.GetPos();
  
   5417                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Choice(lexer);
  
   5418                                 if (matchResult.Error())
  
   5419                                 {
  
   5420                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5421                                 }
  
   5422                                 System.Parsing.Match match = matchResult.Value();
  
   5423                                 choice.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5424                                 *parentMatch4 = match;
  
   5425                                 if (!match.hit)
  
   5426                                 {
  
   5427                                     System.Parsing.Match match(false);
  
   5428                                     System.Parsing.Match* parentMatch5 = &match;
  
   5429                                     lexer.SetPos(save);
  
   5430                                     {
  
   5431                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Seq(lexer);
  
   5432                                         if (matchResult.Error())
  
   5433                                         {
  
   5434                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5435                                         }
  
   5436                                         System.Parsing.Match match = matchResult.Value();
  
   5437                                         seq.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5438                                         *parentMatch5 = match;
  
   5439                                     }
  
   5440                                     *parentMatch4 = match;
  
   5441                                 }
  
   5442                             }
  
   5443                             *parentMatch3 = match;
  
   5444                         }
  
   5445                         *parentMatch2 = match;
  
   5446                     }
  
   5447                     if (match.hit)
  
   5448                     {
  
   5449                         System.Parsing.Match match(false);
  
   5450                         System.Parsing.Match* parentMatch6 = &match;
  
   5451                         {
  
   5452                             System.Parsing.Match match(true);
  
   5453                             long save = lexer.GetPos();
  
   5454                             System.Parsing.Match* parentMatch7 = &match;
  
   5455                             {
  
   5456                                 System.Parsing.Match match(false);
  
   5457                                 System.Parsing.Match* parentMatch8 = &match;
  
   5458                                 {
  
   5459                                     System.Parsing.Match match(false);
  
   5460                                     System.Parsing.Match* parentMatch9 = &match;
  
   5461                                     {
  
   5462                                         long save = lexer.GetPos();
  
   5463                                         System.Parsing.Match match(false);
  
   5464                                         System.Parsing.Match* parentMatch10 = &match;
  
   5465                                         {
  
   5466                                             long save = lexer.GetPos();
  
   5467                                             System.Parsing.Match match(false);
  
   5468                                             if (*lexer == 63)
  
   5469                                             {
  
   5470                                                 auto incResult0 = ++lexer;
  
   5471                                                 if (incResult0.Error())
  
   5472                                                 {
  
   5473                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   5474                                                 }
  
   5475                                                 match.hit = true;
  
   5476                                             }
  
   5477                                             *parentMatch10 = match;
  
   5478                                             if (!match.hit)
  
   5479                                             {
  
   5480                                                 System.Parsing.Match match(false);
  
   5481                                                 System.Parsing.Match* parentMatch11 = &match;
  
   5482                                                 lexer.SetPos(save);
  
   5483                                                 {
  
   5484                                                     System.Parsing.Match match(false);
  
   5485                                                     if (*lexer == 42)
  
   5486                                                     {
  
   5487                                                         auto incResult1 = ++lexer;
  
   5488                                                         if (incResult1.Error())
  
   5489                                                         {
  
   5490                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   5491                                                         }
  
   5492                                                         match.hit = true;
  
   5493                                                     }
  
   5494                                                     *parentMatch11 = match;
  
   5495                                                 }
  
   5496                                                 *parentMatch10 = match;
  
   5497                                             }
  
   5498                                         }
  
   5499                                         *parentMatch9 = match;
  
   5500                                         if (!match.hit)
  
   5501                                         {
  
   5502                                             System.Parsing.Match match(false);
  
   5503                                             System.Parsing.Match* parentMatch12 = &match;
  
   5504                                             lexer.SetPos(save);
  
   5505                                             {
  
   5506                                                 System.Parsing.Match match(false);
  
   5507                                                 if (*lexer == 43)
  
   5508                                                 {
  
   5509                                                     auto incResult2 = ++lexer;
  
   5510                                                     if (incResult2.Error())
  
   5511                                                     {
  
   5512                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   5513                                                     }
  
   5514                                                     match.hit = true;
  
   5515                                                 }
  
   5516                                                 *parentMatch12 = match;
  
   5517                                             }
  
   5518                                             *parentMatch9 = match;
  
   5519                                         }
  
   5520                                     }
  
   5521                                     *parentMatch8 = match;
  
   5522                                 }
  
   5523                                 if (match.hit)
  
   5524                                 {
  
   5525                                     *parentMatch7 = match;
  
   5526                                 }
  
   5527                                 else
  
   5528                                 {
  
   5529                                     lexer.SetPos(save);
  
   5530                                 }
  
   5531                             }
  
   5532                             *parentMatch6 = match;
  
   5533                         }
  
   5534                         *parentMatch2 = match;
  
   5535                     }
  
   5536                     *parentMatch1 = match;
  
   5537                 }
  
   5538                 if (match.hit)
  
   5539                 {
  
   5540                     #if (DEBUG)
  
   5541                         if (parser_debug_write_to_log)
  
   5542                         {
  
   5543                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Children");
  
   5544                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5545                         }
  
   5546                     #endif
  
   5547                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   5548                 }
  
   5549                 *parentMatch0 = match;
  
   5550             }
  
   5551             #if (DEBUG)
  
   5552             if (parser_debug_write_to_log)
  
   5553             {
  
   5554                 if (match.hit)
  
   5555                 {
  
   5556                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Children");
  
   5557                     if (result.Error())
  
   5558                     {
  
   5559                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5560                     }
  
   5561                 }
  
   5562                 else
  
   5563                 {
  
   5564                     auto result = System.Lex.WriteFailureToLog(lexer, u"Children");
  
   5565                     if (result.Error())
  
   5566                     {
  
   5567                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5568                     }
  
   5569                 }
  
   5570             }
  
   5571             #endif
  
   5572             if (!match.hit)
  
   5573             {
  
   5574                 match.value = null;
  
   5575             }
  
   5576             return System.Result<System.Parsing.Match>(match);
  
   5577         }
  
   5578         public static System.Result<System.Parsing.Match> CP(LexerT& lexer)
  
   5579         {
  
   5580             #if (DEBUG)
  
   5581             long parser_debug_match_pos = 0;
  
   5582             bool parser_debug_write_to_log = lexer.Log() != null;
  
   5583             if (parser_debug_write_to_log)
  
   5584             {
  
   5585                 parser_debug_match_pos = lexer.GetPos();
  
   5586                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"CP");
  
   5587                 if (result.Error())
  
   5588                 {
  
   5589                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5590                 }
  
   5591             }
  
   5592             #endif
  
   5593             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475938);
  
   5594             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
   5595             System.UniquePtr<System.Parsing.Value<bool>> choice;
  
   5596             System.UniquePtr<System.Parsing.Value<bool>> seq;
  
   5597             System.Parsing.Match match(false);
  
   5598             System.Parsing.Match* parentMatch0 = &match;
  
   5599             {
  
   5600                 long pos = lexer.GetPos();
  
   5601                 System.Parsing.Match match(false);
  
   5602                 System.Parsing.Match* parentMatch1 = &match;
  
   5603                 {
  
   5604                     System.Parsing.Match match(false);
  
   5605                     System.Parsing.Match* parentMatch2 = &match;
  
   5606                     {
  
   5607                         System.Parsing.Match match(false);
  
   5608                         System.Parsing.Match* parentMatch3 = &match;
  
   5609                         {
  
   5610                             System.Parsing.Match match(false);
  
   5611                             System.Parsing.Match* parentMatch4 = &match;
  
   5612                             {
  
   5613                                 long save = lexer.GetPos();
  
   5614                                 System.Parsing.Match match(false);
  
   5615                                 System.Parsing.Match* parentMatch5 = &match;
  
   5616                                 {
  
   5617                                     long save = lexer.GetPos();
  
   5618                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   5619                                     if (matchResult.Error())
  
   5620                                     {
  
   5621                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5622                                     }
  
   5623                                     System.Parsing.Match match = matchResult.Value();
  
   5624                                     name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   5625                                     *parentMatch5 = match;
  
   5626                                     if (!match.hit)
  
   5627                                     {
  
   5628                                         System.Parsing.Match match(false);
  
   5629                                         System.Parsing.Match* parentMatch6 = &match;
  
   5630                                         lexer.SetPos(save);
  
   5631                                         {
  
   5632                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Choice(lexer);
  
   5633                                             if (matchResult.Error())
  
   5634                                             {
  
   5635                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5636                                             }
  
   5637                                             System.Parsing.Match match = matchResult.Value();
  
   5638                                             choice.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5639                                             *parentMatch6 = match;
  
   5640                                         }
  
   5641                                         *parentMatch5 = match;
  
   5642                                     }
  
   5643                                 }
  
   5644                                 *parentMatch4 = match;
  
   5645                                 if (!match.hit)
  
   5646                                 {
  
   5647                                     System.Parsing.Match match(false);
  
   5648                                     System.Parsing.Match* parentMatch7 = &match;
  
   5649                                     lexer.SetPos(save);
  
   5650                                     {
  
   5651                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Seq(lexer);
  
   5652                                         if (matchResult.Error())
  
   5653                                         {
  
   5654                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5655                                         }
  
   5656                                         System.Parsing.Match match = matchResult.Value();
  
   5657                                         seq.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5658                                         *parentMatch7 = match;
  
   5659                                     }
  
   5660                                     *parentMatch4 = match;
  
   5661                                 }
  
   5662                             }
  
   5663                             *parentMatch3 = match;
  
   5664                         }
  
   5665                         *parentMatch2 = match;
  
   5666                     }
  
   5667                     if (match.hit)
  
   5668                     {
  
   5669                         System.Parsing.Match match(false);
  
   5670                         System.Parsing.Match* parentMatch8 = &match;
  
   5671                         {
  
   5672                             System.Parsing.Match match(true);
  
   5673                             long save = lexer.GetPos();
  
   5674                             System.Parsing.Match* parentMatch9 = &match;
  
   5675                             {
  
   5676                                 System.Parsing.Match match(false);
  
   5677                                 System.Parsing.Match* parentMatch10 = &match;
  
   5678                                 {
  
   5679                                     System.Parsing.Match match(false);
  
   5680                                     System.Parsing.Match* parentMatch11 = &match;
  
   5681                                     {
  
   5682                                         long save = lexer.GetPos();
  
   5683                                         System.Parsing.Match match(false);
  
   5684                                         System.Parsing.Match* parentMatch12 = &match;
  
   5685                                         {
  
   5686                                             long save = lexer.GetPos();
  
   5687                                             System.Parsing.Match match(false);
  
   5688                                             if (*lexer == 63)
  
   5689                                             {
  
   5690                                                 auto incResult0 = ++lexer;
  
   5691                                                 if (incResult0.Error())
  
   5692                                                 {
  
   5693                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   5694                                                 }
  
   5695                                                 match.hit = true;
  
   5696                                             }
  
   5697                                             *parentMatch12 = match;
  
   5698                                             if (!match.hit)
  
   5699                                             {
  
   5700                                                 System.Parsing.Match match(false);
  
   5701                                                 System.Parsing.Match* parentMatch13 = &match;
  
   5702                                                 lexer.SetPos(save);
  
   5703                                                 {
  
   5704                                                     System.Parsing.Match match(false);
  
   5705                                                     if (*lexer == 42)
  
   5706                                                     {
  
   5707                                                         auto incResult1 = ++lexer;
  
   5708                                                         if (incResult1.Error())
  
   5709                                                         {
  
   5710                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   5711                                                         }
  
   5712                                                         match.hit = true;
  
   5713                                                     }
  
   5714                                                     *parentMatch13 = match;
  
   5715                                                 }
  
   5716                                                 *parentMatch12 = match;
  
   5717                                             }
  
   5718                                         }
  
   5719                                         *parentMatch11 = match;
  
   5720                                         if (!match.hit)
  
   5721                                         {
  
   5722                                             System.Parsing.Match match(false);
  
   5723                                             System.Parsing.Match* parentMatch14 = &match;
  
   5724                                             lexer.SetPos(save);
  
   5725                                             {
  
   5726                                                 System.Parsing.Match match(false);
  
   5727                                                 if (*lexer == 43)
  
   5728                                                 {
  
   5729                                                     auto incResult2 = ++lexer;
  
   5730                                                     if (incResult2.Error())
  
   5731                                                     {
  
   5732                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   5733                                                     }
  
   5734                                                     match.hit = true;
  
   5735                                                 }
  
   5736                                                 *parentMatch14 = match;
  
   5737                                             }
  
   5738                                             *parentMatch11 = match;
  
   5739                                         }
  
   5740                                     }
  
   5741                                     *parentMatch10 = match;
  
   5742                                 }
  
   5743                                 if (match.hit)
  
   5744                                 {
  
   5745                                     *parentMatch9 = match;
  
   5746                                 }
  
   5747                                 else
  
   5748                                 {
  
   5749                                     lexer.SetPos(save);
  
   5750                                 }
  
   5751                             }
  
   5752                             *parentMatch8 = match;
  
   5753                         }
  
   5754                         *parentMatch2 = match;
  
   5755                     }
  
   5756                     *parentMatch1 = match;
  
   5757                 }
  
   5758                 if (match.hit)
  
   5759                 {
  
   5760                     #if (DEBUG)
  
   5761                         if (parser_debug_write_to_log)
  
   5762                         {
  
   5763                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CP");
  
   5764                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5765                         }
  
   5766                     #endif
  
   5767                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   5768                 }
  
   5769                 *parentMatch0 = match;
  
   5770             }
  
   5771             #if (DEBUG)
  
   5772             if (parser_debug_write_to_log)
  
   5773             {
  
   5774                 if (match.hit)
  
   5775                 {
  
   5776                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CP");
  
   5777                     if (result.Error())
  
   5778                     {
  
   5779                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5780                     }
  
   5781                 }
  
   5782                 else
  
   5783                 {
  
   5784                     auto result = System.Lex.WriteFailureToLog(lexer, u"CP");
  
   5785                     if (result.Error())
  
   5786                     {
  
   5787                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5788                     }
  
   5789                 }
  
   5790             }
  
   5791             #endif
  
   5792             if (!match.hit)
  
   5793             {
  
   5794                 match.value = null;
  
   5795             }
  
   5796             return System.Result<System.Parsing.Match>(match);
  
   5797         }
  
   5798         public static System.Result<System.Parsing.Match> Choice(LexerT& lexer)
  
   5799         {
  
   5800             #if (DEBUG)
  
   5801             long parser_debug_match_pos = 0;
  
   5802             bool parser_debug_write_to_log = lexer.Log() != null;
  
   5803             if (parser_debug_write_to_log)
  
   5804             {
  
   5805                 parser_debug_match_pos = lexer.GetPos();
  
   5806                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Choice");
  
   5807                 if (result.Error())
  
   5808                 {
  
   5809                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   5810                 }
  
   5811             }
  
   5812             #endif
  
   5813             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475939);
  
   5814             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   5815             System.UniquePtr<System.Parsing.Value<bool>> cp1;
  
   5816             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   5817             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   5818             System.UniquePtr<System.Parsing.Value<bool>> cp2;
  
   5819             System.UniquePtr<System.Parsing.Value<bool>> s4;
  
   5820             System.Parsing.Match match(false);
  
   5821             System.Parsing.Match* parentMatch0 = &match;
  
   5822             {
  
   5823                 long pos = lexer.GetPos();
  
   5824                 System.Parsing.Match match(false);
  
   5825                 System.Parsing.Match* parentMatch1 = &match;
  
   5826                 {
  
   5827                     System.Parsing.Match match(false);
  
   5828                     System.Parsing.Match* parentMatch2 = &match;
  
   5829                     {
  
   5830                         System.Parsing.Match match(false);
  
   5831                         System.Parsing.Match* parentMatch3 = &match;
  
   5832                         {
  
   5833                             System.Parsing.Match match(false);
  
   5834                             System.Parsing.Match* parentMatch4 = &match;
  
   5835                             {
  
   5836                                 System.Parsing.Match match(false);
  
   5837                                 System.Parsing.Match* parentMatch5 = &match;
  
   5838                                 {
  
   5839                                     System.Parsing.Match match(false);
  
   5840                                     System.Parsing.Match* parentMatch6 = &match;
  
   5841                                     {
  
   5842                                         System.Parsing.Match match(false);
  
   5843                                         if (*lexer == 40)
  
   5844                                         {
  
   5845                                             auto incResult0 = ++lexer;
  
   5846                                             if (incResult0.Error())
  
   5847                                             {
  
   5848                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   5849                                             }
  
   5850                                             match.hit = true;
  
   5851                                         }
  
   5852                                         *parentMatch6 = match;
  
   5853                                     }
  
   5854                                     if (match.hit)
  
   5855                                     {
  
   5856                                         System.Parsing.Match match(false);
  
   5857                                         System.Parsing.Match* parentMatch7 = &match;
  
   5858                                         {
  
   5859                                             System.Parsing.Match match(true);
  
   5860                                             long save = lexer.GetPos();
  
   5861                                             System.Parsing.Match* parentMatch8 = &match;
  
   5862                                             {
  
   5863                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   5864                                                 if (matchResult.Error())
  
   5865                                                 {
  
   5866                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5867                                                 }
  
   5868                                                 System.Parsing.Match match = matchResult.Value();
  
   5869                                                 s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5870                                                 if (match.hit)
  
   5871                                                 {
  
   5872                                                     *parentMatch8 = match;
  
   5873                                                 }
  
   5874                                                 else
  
   5875                                                 {
  
   5876                                                     lexer.SetPos(save);
  
   5877                                                 }
  
   5878                                             }
  
   5879                                             *parentMatch7 = match;
  
   5880                                         }
  
   5881                                         *parentMatch6 = match;
  
   5882                                     }
  
   5883                                     *parentMatch5 = match;
  
   5884                                 }
  
   5885                                 if (match.hit)
  
   5886                                 {
  
   5887                                     System.Parsing.Match match(false);
  
   5888                                     System.Parsing.Match* parentMatch9 = &match;
  
   5889                                     {
  
   5890                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CP(lexer);
  
   5891                                         if (matchResult.Error())
  
   5892                                         {
  
   5893                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5894                                         }
  
   5895                                         System.Parsing.Match match = matchResult.Value();
  
   5896                                         cp1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5897                                         *parentMatch9 = match;
  
   5898                                     }
  
   5899                                     *parentMatch5 = match;
  
   5900                                 }
  
   5901                                 *parentMatch4 = match;
  
   5902                             }
  
   5903                             if (match.hit)
  
   5904                             {
  
   5905                                 System.Parsing.Match match(false);
  
   5906                                 System.Parsing.Match* parentMatch10 = &match;
  
   5907                                 {
  
   5908                                     System.Parsing.Match match(false);
  
   5909                                     System.Parsing.Match* parentMatch11 = &match;
  
   5910                                     {
  
   5911                                         System.Parsing.Match match(false);
  
   5912                                         System.Parsing.Match* parentMatch12 = &match;
  
   5913                                         {
  
   5914                                             System.Parsing.Match match(false);
  
   5915                                             System.Parsing.Match* parentMatch13 = &match;
  
   5916                                             {
  
   5917                                                 System.Parsing.Match match(false);
  
   5918                                                 System.Parsing.Match* parentMatch14 = &match;
  
   5919                                                 {
  
   5920                                                     System.Parsing.Match match(false);
  
   5921                                                     System.Parsing.Match* parentMatch15 = &match;
  
   5922                                                     {
  
   5923                                                         System.Parsing.Match match(true);
  
   5924                                                         long save = lexer.GetPos();
  
   5925                                                         System.Parsing.Match* parentMatch16 = &match;
  
   5926                                                         {
  
   5927                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   5928                                                             if (matchResult.Error())
  
   5929                                                             {
  
   5930                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5931                                                             }
  
   5932                                                             System.Parsing.Match match = matchResult.Value();
  
   5933                                                             s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5934                                                             if (match.hit)
  
   5935                                                             {
  
   5936                                                                 *parentMatch16 = match;
  
   5937                                                             }
  
   5938                                                             else
  
   5939                                                             {
  
   5940                                                                 lexer.SetPos(save);
  
   5941                                                             }
  
   5942                                                         }
  
   5943                                                         *parentMatch15 = match;
  
   5944                                                     }
  
   5945                                                     if (match.hit)
  
   5946                                                     {
  
   5947                                                         System.Parsing.Match match(false);
  
   5948                                                         System.Parsing.Match* parentMatch17 = &match;
  
   5949                                                         {
  
   5950                                                             System.Parsing.Match match(false);
  
   5951                                                             if (*lexer == 124)
  
   5952                                                             {
  
   5953                                                                 auto incResult1 = ++lexer;
  
   5954                                                                 if (incResult1.Error())
  
   5955                                                                 {
  
   5956                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   5957                                                                 }
  
   5958                                                                 match.hit = true;
  
   5959                                                             }
  
   5960                                                             *parentMatch17 = match;
  
   5961                                                         }
  
   5962                                                         *parentMatch15 = match;
  
   5963                                                     }
  
   5964                                                     *parentMatch14 = match;
  
   5965                                                 }
  
   5966                                                 if (match.hit)
  
   5967                                                 {
  
   5968                                                     System.Parsing.Match match(false);
  
   5969                                                     System.Parsing.Match* parentMatch18 = &match;
  
   5970                                                     {
  
   5971                                                         System.Parsing.Match match(true);
  
   5972                                                         long save = lexer.GetPos();
  
   5973                                                         System.Parsing.Match* parentMatch19 = &match;
  
   5974                                                         {
  
   5975                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   5976                                                             if (matchResult.Error())
  
   5977                                                             {
  
   5978                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   5979                                                             }
  
   5980                                                             System.Parsing.Match match = matchResult.Value();
  
   5981                                                             s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   5982                                                             if (match.hit)
  
   5983                                                             {
  
   5984                                                                 *parentMatch19 = match;
  
   5985                                                             }
  
   5986                                                             else
  
   5987                                                             {
  
   5988                                                                 lexer.SetPos(save);
  
   5989                                                             }
  
   5990                                                         }
  
   5991                                                         *parentMatch18 = match;
  
   5992                                                     }
  
   5993                                                     *parentMatch14 = match;
  
   5994                                                 }
  
   5995                                                 *parentMatch13 = match;
  
   5996                                             }
  
   5997                                             if (match.hit)
  
   5998                                             {
  
   5999                                                 System.Parsing.Match match(false);
  
   6000                                                 System.Parsing.Match* parentMatch20 = &match;
  
   6001                                                 {
  
   6002                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CP(lexer);
  
   6003                                                     if (matchResult.Error())
  
   6004                                                     {
  
   6005                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6006                                                     }
  
   6007                                                     System.Parsing.Match match = matchResult.Value();
  
   6008                                                     cp2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6009                                                     *parentMatch20 = match;
  
   6010                                                 }
  
   6011                                                 *parentMatch13 = match;
  
   6012                                             }
  
   6013                                             *parentMatch12 = match;
  
   6014                                         }
  
   6015                                         *parentMatch11 = match;
  
   6016                                     }
  
   6017                                     if (match.hit)
  
   6018                                     {
  
   6019                                         System.Parsing.Match match(true);
  
   6020                                         System.Parsing.Match* parentMatch21 = &match;
  
   6021                                         while (true)
  
   6022                                         {
  
   6023                                             long save = lexer.GetPos();
  
   6024                                             {
  
   6025                                                 System.Parsing.Match match(false);
  
   6026                                                 System.Parsing.Match* parentMatch22 = &match;
  
   6027                                                 {
  
   6028                                                     System.Parsing.Match match(false);
  
   6029                                                     System.Parsing.Match* parentMatch23 = &match;
  
   6030                                                     {
  
   6031                                                         System.Parsing.Match match(false);
  
   6032                                                         System.Parsing.Match* parentMatch24 = &match;
  
   6033                                                         {
  
   6034                                                             System.Parsing.Match match(false);
  
   6035                                                             System.Parsing.Match* parentMatch25 = &match;
  
   6036                                                             {
  
   6037                                                                 System.Parsing.Match match(true);
  
   6038                                                                 long save = lexer.GetPos();
  
   6039                                                                 System.Parsing.Match* parentMatch26 = &match;
  
   6040                                                                 {
  
   6041                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6042                                                                     if (matchResult.Error())
  
   6043                                                                     {
  
   6044                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6045                                                                     }
  
   6046                                                                     System.Parsing.Match match = matchResult.Value();
  
   6047                                                                     s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6048                                                                     if (match.hit)
  
   6049                                                                     {
  
   6050                                                                         *parentMatch26 = match;
  
   6051                                                                     }
  
   6052                                                                     else
  
   6053                                                                     {
  
   6054                                                                         lexer.SetPos(save);
  
   6055                                                                     }
  
   6056                                                                 }
  
   6057                                                                 *parentMatch25 = match;
  
   6058                                                             }
  
   6059                                                             if (match.hit)
  
   6060                                                             {
  
   6061                                                                 System.Parsing.Match match(false);
  
   6062                                                                 System.Parsing.Match* parentMatch27 = &match;
  
   6063                                                                 {
  
   6064                                                                     System.Parsing.Match match(false);
  
   6065                                                                     if (*lexer == 124)
  
   6066                                                                     {
  
   6067                                                                         auto incResult2 = ++lexer;
  
   6068                                                                         if (incResult2.Error())
  
   6069                                                                         {
  
   6070                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   6071                                                                         }
  
   6072                                                                         match.hit = true;
  
   6073                                                                     }
  
   6074                                                                     *parentMatch27 = match;
  
   6075                                                                 }
  
   6076                                                                 *parentMatch25 = match;
  
   6077                                                             }
  
   6078                                                             *parentMatch24 = match;
  
   6079                                                         }
  
   6080                                                         if (match.hit)
  
   6081                                                         {
  
   6082                                                             System.Parsing.Match match(false);
  
   6083                                                             System.Parsing.Match* parentMatch28 = &match;
  
   6084                                                             {
  
   6085                                                                 System.Parsing.Match match(true);
  
   6086                                                                 long save = lexer.GetPos();
  
   6087                                                                 System.Parsing.Match* parentMatch29 = &match;
  
   6088                                                                 {
  
   6089                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6090                                                                     if (matchResult.Error())
  
   6091                                                                     {
  
   6092                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6093                                                                     }
  
   6094                                                                     System.Parsing.Match match = matchResult.Value();
  
   6095                                                                     s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6096                                                                     if (match.hit)
  
   6097                                                                     {
  
   6098                                                                         *parentMatch29 = match;
  
   6099                                                                     }
  
   6100                                                                     else
  
   6101                                                                     {
  
   6102                                                                         lexer.SetPos(save);
  
   6103                                                                     }
  
   6104                                                                 }
  
   6105                                                                 *parentMatch28 = match;
  
   6106                                                             }
  
   6107                                                             *parentMatch24 = match;
  
   6108                                                         }
  
   6109                                                         *parentMatch23 = match;
  
   6110                                                     }
  
   6111                                                     if (match.hit)
  
   6112                                                     {
  
   6113                                                         System.Parsing.Match match(false);
  
   6114                                                         System.Parsing.Match* parentMatch30 = &match;
  
   6115                                                         {
  
   6116                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CP(lexer);
  
   6117                                                             if (matchResult.Error())
  
   6118                                                             {
  
   6119                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6120                                                             }
  
   6121                                                             System.Parsing.Match match = matchResult.Value();
  
   6122                                                             cp2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6123                                                             *parentMatch30 = match;
  
   6124                                                         }
  
   6125                                                         *parentMatch23 = match;
  
   6126                                                     }
  
   6127                                                     *parentMatch22 = match;
  
   6128                                                 }
  
   6129                                                 if (match.hit)
  
   6130                                                 {
  
   6131                                                     *parentMatch21 = match;
  
   6132                                                 }
  
   6133                                                 else
  
   6134                                                 {
  
   6135                                                     lexer.SetPos(save);
  
   6136                                                     break;
  
   6137                                                 }
  
   6138                                             }
  
   6139                                         }
  
   6140                                     }
  
   6141                                     *parentMatch10 = match;
  
   6142                                 }
  
   6143                                 *parentMatch4 = match;
  
   6144                             }
  
   6145                             *parentMatch3 = match;
  
   6146                         }
  
   6147                         if (match.hit)
  
   6148                         {
  
   6149                             System.Parsing.Match match(false);
  
   6150                             System.Parsing.Match* parentMatch31 = &match;
  
   6151                             {
  
   6152                                 System.Parsing.Match match(true);
  
   6153                                 long save = lexer.GetPos();
  
   6154                                 System.Parsing.Match* parentMatch32 = &match;
  
   6155                                 {
  
   6156                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6157                                     if (matchResult.Error())
  
   6158                                     {
  
   6159                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6160                                     }
  
   6161                                     System.Parsing.Match match = matchResult.Value();
  
   6162                                     s4.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6163                                     if (match.hit)
  
   6164                                     {
  
   6165                                         *parentMatch32 = match;
  
   6166                                     }
  
   6167                                     else
  
   6168                                     {
  
   6169                                         lexer.SetPos(save);
  
   6170                                     }
  
   6171                                 }
  
   6172                                 *parentMatch31 = match;
  
   6173                             }
  
   6174                             *parentMatch3 = match;
  
   6175                         }
  
   6176                         *parentMatch2 = match;
  
   6177                     }
  
   6178                     if (match.hit)
  
   6179                     {
  
   6180                         System.Parsing.Match match(false);
  
   6181                         System.Parsing.Match* parentMatch33 = &match;
  
   6182                         {
  
   6183                             System.Parsing.Match match(false);
  
   6184                             if (*lexer == 41)
  
   6185                             {
  
   6186                                 auto incResult3 = ++lexer;
  
   6187                                 if (incResult3.Error())
  
   6188                                 {
  
   6189                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   6190                                 }
  
   6191                                 match.hit = true;
  
   6192                             }
  
   6193                             *parentMatch33 = match;
  
   6194                         }
  
   6195                         *parentMatch2 = match;
  
   6196                     }
  
   6197                     *parentMatch1 = match;
  
   6198                 }
  
   6199                 if (match.hit)
  
   6200                 {
  
   6201                     #if (DEBUG)
  
   6202                         if (parser_debug_write_to_log)
  
   6203                         {
  
   6204                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Choice");
  
   6205                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6206                         }
  
   6207                     #endif
  
   6208                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   6209                 }
  
   6210                 *parentMatch0 = match;
  
   6211             }
  
   6212             #if (DEBUG)
  
   6213             if (parser_debug_write_to_log)
  
   6214             {
  
   6215                 if (match.hit)
  
   6216                 {
  
   6217                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Choice");
  
   6218                     if (result.Error())
  
   6219                     {
  
   6220                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6221                     }
  
   6222                 }
  
   6223                 else
  
   6224                 {
  
   6225                     auto result = System.Lex.WriteFailureToLog(lexer, u"Choice");
  
   6226                     if (result.Error())
  
   6227                     {
  
   6228                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6229                     }
  
   6230                 }
  
   6231             }
  
   6232             #endif
  
   6233             if (!match.hit)
  
   6234             {
  
   6235                 match.value = null;
  
   6236             }
  
   6237             return System.Result<System.Parsing.Match>(match);
  
   6238         }
  
   6239         public static System.Result<System.Parsing.Match> Seq(LexerT& lexer)
  
   6240         {
  
   6241             #if (DEBUG)
  
   6242             long parser_debug_match_pos = 0;
  
   6243             bool parser_debug_write_to_log = lexer.Log() != null;
  
   6244             if (parser_debug_write_to_log)
  
   6245             {
  
   6246                 parser_debug_match_pos = lexer.GetPos();
  
   6247                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Seq");
  
   6248                 if (result.Error())
  
   6249                 {
  
   6250                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6251                 }
  
   6252             }
  
   6253             #endif
  
   6254             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475940);
  
   6255             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   6256             System.UniquePtr<System.Parsing.Value<bool>> cp1;
  
   6257             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   6258             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   6259             System.UniquePtr<System.Parsing.Value<bool>> cp2;
  
   6260             System.UniquePtr<System.Parsing.Value<bool>> s4;
  
   6261             System.Parsing.Match match(false);
  
   6262             System.Parsing.Match* parentMatch0 = &match;
  
   6263             {
  
   6264                 long pos = lexer.GetPos();
  
   6265                 System.Parsing.Match match(false);
  
   6266                 System.Parsing.Match* parentMatch1 = &match;
  
   6267                 {
  
   6268                     System.Parsing.Match match(false);
  
   6269                     System.Parsing.Match* parentMatch2 = &match;
  
   6270                     {
  
   6271                         System.Parsing.Match match(false);
  
   6272                         System.Parsing.Match* parentMatch3 = &match;
  
   6273                         {
  
   6274                             System.Parsing.Match match(false);
  
   6275                             System.Parsing.Match* parentMatch4 = &match;
  
   6276                             {
  
   6277                                 System.Parsing.Match match(false);
  
   6278                                 System.Parsing.Match* parentMatch5 = &match;
  
   6279                                 {
  
   6280                                     System.Parsing.Match match(false);
  
   6281                                     System.Parsing.Match* parentMatch6 = &match;
  
   6282                                     {
  
   6283                                         System.Parsing.Match match(false);
  
   6284                                         if (*lexer == 40)
  
   6285                                         {
  
   6286                                             auto incResult0 = ++lexer;
  
   6287                                             if (incResult0.Error())
  
   6288                                             {
  
   6289                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   6290                                             }
  
   6291                                             match.hit = true;
  
   6292                                         }
  
   6293                                         *parentMatch6 = match;
  
   6294                                     }
  
   6295                                     if (match.hit)
  
   6296                                     {
  
   6297                                         System.Parsing.Match match(false);
  
   6298                                         System.Parsing.Match* parentMatch7 = &match;
  
   6299                                         {
  
   6300                                             System.Parsing.Match match(true);
  
   6301                                             long save = lexer.GetPos();
  
   6302                                             System.Parsing.Match* parentMatch8 = &match;
  
   6303                                             {
  
   6304                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6305                                                 if (matchResult.Error())
  
   6306                                                 {
  
   6307                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6308                                                 }
  
   6309                                                 System.Parsing.Match match = matchResult.Value();
  
   6310                                                 s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6311                                                 if (match.hit)
  
   6312                                                 {
  
   6313                                                     *parentMatch8 = match;
  
   6314                                                 }
  
   6315                                                 else
  
   6316                                                 {
  
   6317                                                     lexer.SetPos(save);
  
   6318                                                 }
  
   6319                                             }
  
   6320                                             *parentMatch7 = match;
  
   6321                                         }
  
   6322                                         *parentMatch6 = match;
  
   6323                                     }
  
   6324                                     *parentMatch5 = match;
  
   6325                                 }
  
   6326                                 if (match.hit)
  
   6327                                 {
  
   6328                                     System.Parsing.Match match(false);
  
   6329                                     System.Parsing.Match* parentMatch9 = &match;
  
   6330                                     {
  
   6331                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CP(lexer);
  
   6332                                         if (matchResult.Error())
  
   6333                                         {
  
   6334                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6335                                         }
  
   6336                                         System.Parsing.Match match = matchResult.Value();
  
   6337                                         cp1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6338                                         *parentMatch9 = match;
  
   6339                                     }
  
   6340                                     *parentMatch5 = match;
  
   6341                                 }
  
   6342                                 *parentMatch4 = match;
  
   6343                             }
  
   6344                             if (match.hit)
  
   6345                             {
  
   6346                                 System.Parsing.Match match(false);
  
   6347                                 System.Parsing.Match* parentMatch10 = &match;
  
   6348                                 {
  
   6349                                     System.Parsing.Match match(true);
  
   6350                                     System.Parsing.Match* parentMatch11 = &match;
  
   6351                                     {
  
   6352                                         while (true)
  
   6353                                         {
  
   6354                                             long save = lexer.GetPos();
  
   6355                                             {
  
   6356                                                 System.Parsing.Match match(false);
  
   6357                                                 System.Parsing.Match* parentMatch12 = &match;
  
   6358                                                 {
  
   6359                                                     System.Parsing.Match match(false);
  
   6360                                                     System.Parsing.Match* parentMatch13 = &match;
  
   6361                                                     {
  
   6362                                                         System.Parsing.Match match(false);
  
   6363                                                         System.Parsing.Match* parentMatch14 = &match;
  
   6364                                                         {
  
   6365                                                             System.Parsing.Match match(false);
  
   6366                                                             System.Parsing.Match* parentMatch15 = &match;
  
   6367                                                             {
  
   6368                                                                 System.Parsing.Match match(true);
  
   6369                                                                 long save = lexer.GetPos();
  
   6370                                                                 System.Parsing.Match* parentMatch16 = &match;
  
   6371                                                                 {
  
   6372                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6373                                                                     if (matchResult.Error())
  
   6374                                                                     {
  
   6375                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6376                                                                     }
  
   6377                                                                     System.Parsing.Match match = matchResult.Value();
  
   6378                                                                     s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6379                                                                     if (match.hit)
  
   6380                                                                     {
  
   6381                                                                         *parentMatch16 = match;
  
   6382                                                                     }
  
   6383                                                                     else
  
   6384                                                                     {
  
   6385                                                                         lexer.SetPos(save);
  
   6386                                                                     }
  
   6387                                                                 }
  
   6388                                                                 *parentMatch15 = match;
  
   6389                                                             }
  
   6390                                                             if (match.hit)
  
   6391                                                             {
  
   6392                                                                 System.Parsing.Match match(false);
  
   6393                                                                 System.Parsing.Match* parentMatch17 = &match;
  
   6394                                                                 {
  
   6395                                                                     System.Parsing.Match match(false);
  
   6396                                                                     if (*lexer == 44)
  
   6397                                                                     {
  
   6398                                                                         auto incResult1 = ++lexer;
  
   6399                                                                         if (incResult1.Error())
  
   6400                                                                         {
  
   6401                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   6402                                                                         }
  
   6403                                                                         match.hit = true;
  
   6404                                                                     }
  
   6405                                                                     *parentMatch17 = match;
  
   6406                                                                 }
  
   6407                                                                 *parentMatch15 = match;
  
   6408                                                             }
  
   6409                                                             *parentMatch14 = match;
  
   6410                                                         }
  
   6411                                                         if (match.hit)
  
   6412                                                         {
  
   6413                                                             System.Parsing.Match match(false);
  
   6414                                                             System.Parsing.Match* parentMatch18 = &match;
  
   6415                                                             {
  
   6416                                                                 System.Parsing.Match match(true);
  
   6417                                                                 long save = lexer.GetPos();
  
   6418                                                                 System.Parsing.Match* parentMatch19 = &match;
  
   6419                                                                 {
  
   6420                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6421                                                                     if (matchResult.Error())
  
   6422                                                                     {
  
   6423                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6424                                                                     }
  
   6425                                                                     System.Parsing.Match match = matchResult.Value();
  
   6426                                                                     s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6427                                                                     if (match.hit)
  
   6428                                                                     {
  
   6429                                                                         *parentMatch19 = match;
  
   6430                                                                     }
  
   6431                                                                     else
  
   6432                                                                     {
  
   6433                                                                         lexer.SetPos(save);
  
   6434                                                                     }
  
   6435                                                                 }
  
   6436                                                                 *parentMatch18 = match;
  
   6437                                                             }
  
   6438                                                             *parentMatch14 = match;
  
   6439                                                         }
  
   6440                                                         *parentMatch13 = match;
  
   6441                                                     }
  
   6442                                                     if (match.hit)
  
   6443                                                     {
  
   6444                                                         System.Parsing.Match match(false);
  
   6445                                                         System.Parsing.Match* parentMatch20 = &match;
  
   6446                                                         {
  
   6447                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CP(lexer);
  
   6448                                                             if (matchResult.Error())
  
   6449                                                             {
  
   6450                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6451                                                             }
  
   6452                                                             System.Parsing.Match match = matchResult.Value();
  
   6453                                                             cp2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6454                                                             *parentMatch20 = match;
  
   6455                                                         }
  
   6456                                                         *parentMatch13 = match;
  
   6457                                                     }
  
   6458                                                     *parentMatch12 = match;
  
   6459                                                 }
  
   6460                                                 if (match.hit)
  
   6461                                                 {
  
   6462                                                     *parentMatch11 = match;
  
   6463                                                 }
  
   6464                                                 else
  
   6465                                                 {
  
   6466                                                     lexer.SetPos(save);
  
   6467                                                     break;
  
   6468                                                 }
  
   6469                                             }
  
   6470                                         }
  
   6471                                     }
  
   6472                                     *parentMatch10 = match;
  
   6473                                 }
  
   6474                                 *parentMatch4 = match;
  
   6475                             }
  
   6476                             *parentMatch3 = match;
  
   6477                         }
  
   6478                         if (match.hit)
  
   6479                         {
  
   6480                             System.Parsing.Match match(false);
  
   6481                             System.Parsing.Match* parentMatch21 = &match;
  
   6482                             {
  
   6483                                 System.Parsing.Match match(true);
  
   6484                                 long save = lexer.GetPos();
  
   6485                                 System.Parsing.Match* parentMatch22 = &match;
  
   6486                                 {
  
   6487                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6488                                     if (matchResult.Error())
  
   6489                                     {
  
   6490                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6491                                     }
  
   6492                                     System.Parsing.Match match = matchResult.Value();
  
   6493                                     s4.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6494                                     if (match.hit)
  
   6495                                     {
  
   6496                                         *parentMatch22 = match;
  
   6497                                     }
  
   6498                                     else
  
   6499                                     {
  
   6500                                         lexer.SetPos(save);
  
   6501                                     }
  
   6502                                 }
  
   6503                                 *parentMatch21 = match;
  
   6504                             }
  
   6505                             *parentMatch3 = match;
  
   6506                         }
  
   6507                         *parentMatch2 = match;
  
   6508                     }
  
   6509                     if (match.hit)
  
   6510                     {
  
   6511                         System.Parsing.Match match(false);
  
   6512                         System.Parsing.Match* parentMatch23 = &match;
  
   6513                         {
  
   6514                             System.Parsing.Match match(false);
  
   6515                             if (*lexer == 41)
  
   6516                             {
  
   6517                                 auto incResult2 = ++lexer;
  
   6518                                 if (incResult2.Error())
  
   6519                                 {
  
   6520                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   6521                                 }
  
   6522                                 match.hit = true;
  
   6523                             }
  
   6524                             *parentMatch23 = match;
  
   6525                         }
  
   6526                         *parentMatch2 = match;
  
   6527                     }
  
   6528                     *parentMatch1 = match;
  
   6529                 }
  
   6530                 if (match.hit)
  
   6531                 {
  
   6532                     #if (DEBUG)
  
   6533                         if (parser_debug_write_to_log)
  
   6534                         {
  
   6535                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Seq");
  
   6536                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6537                         }
  
   6538                     #endif
  
   6539                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   6540                 }
  
   6541                 *parentMatch0 = match;
  
   6542             }
  
   6543             #if (DEBUG)
  
   6544             if (parser_debug_write_to_log)
  
   6545             {
  
   6546                 if (match.hit)
  
   6547                 {
  
   6548                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Seq");
  
   6549                     if (result.Error())
  
   6550                     {
  
   6551                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6552                     }
  
   6553                 }
  
   6554                 else
  
   6555                 {
  
   6556                     auto result = System.Lex.WriteFailureToLog(lexer, u"Seq");
  
   6557                     if (result.Error())
  
   6558                     {
  
   6559                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6560                     }
  
   6561                 }
  
   6562             }
  
   6563             #endif
  
   6564             if (!match.hit)
  
   6565             {
  
   6566                 match.value = null;
  
   6567             }
  
   6568             return System.Result<System.Parsing.Match>(match);
  
   6569         }
  
   6570         public static System.Result<System.Parsing.Match> Mixed(LexerT& lexer)
  
   6571         {
  
   6572             #if (DEBUG)
  
   6573             long parser_debug_match_pos = 0;
  
   6574             bool parser_debug_write_to_log = lexer.Log() != null;
  
   6575             if (parser_debug_write_to_log)
  
   6576             {
  
   6577                 parser_debug_match_pos = lexer.GetPos();
  
   6578                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Mixed");
  
   6579                 if (result.Error())
  
   6580                 {
  
   6581                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   6582                 }
  
   6583             }
  
   6584             #endif
  
   6585             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475941);
  
   6586             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   6587             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   6588             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   6589             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
   6590             System.UniquePtr<System.Parsing.Value<bool>> s4;
  
   6591             System.UniquePtr<System.Parsing.Value<bool>> s5;
  
   6592             System.UniquePtr<System.Parsing.Value<bool>> s6;
  
   6593             System.Parsing.Match match(false);
  
   6594             System.Parsing.Match* parentMatch0 = &match;
  
   6595             {
  
   6596                 long pos = lexer.GetPos();
  
   6597                 System.Parsing.Match match(false);
  
   6598                 System.Parsing.Match* parentMatch1 = &match;
  
   6599                 {
  
   6600                     System.Parsing.Match match(false);
  
   6601                     System.Parsing.Match* parentMatch2 = &match;
  
   6602                     {
  
   6603                         long save = lexer.GetPos();
  
   6604                         System.Parsing.Match match(false);
  
   6605                         System.Parsing.Match* parentMatch3 = &match;
  
   6606                         {
  
   6607                             System.Parsing.Match match(false);
  
   6608                             System.Parsing.Match* parentMatch4 = &match;
  
   6609                             {
  
   6610                                 System.Parsing.Match match(false);
  
   6611                                 System.Parsing.Match* parentMatch5 = &match;
  
   6612                                 {
  
   6613                                     System.Parsing.Match match(false);
  
   6614                                     System.Parsing.Match* parentMatch6 = &match;
  
   6615                                     {
  
   6616                                         System.Parsing.Match match(false);
  
   6617                                         System.Parsing.Match* parentMatch7 = &match;
  
   6618                                         {
  
   6619                                             System.Parsing.Match match(false);
  
   6620                                             if (*lexer == 40)
  
   6621                                             {
  
   6622                                                 auto incResult0 = ++lexer;
  
   6623                                                 if (incResult0.Error())
  
   6624                                                 {
  
   6625                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   6626                                                 }
  
   6627                                                 match.hit = true;
  
   6628                                             }
  
   6629                                             *parentMatch7 = match;
  
   6630                                         }
  
   6631                                         if (match.hit)
  
   6632                                         {
  
   6633                                             System.Parsing.Match match(false);
  
   6634                                             System.Parsing.Match* parentMatch8 = &match;
  
   6635                                             {
  
   6636                                                 System.Parsing.Match match(true);
  
   6637                                                 long save = lexer.GetPos();
  
   6638                                                 System.Parsing.Match* parentMatch9 = &match;
  
   6639                                                 {
  
   6640                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6641                                                     if (matchResult.Error())
  
   6642                                                     {
  
   6643                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6644                                                     }
  
   6645                                                     System.Parsing.Match match = matchResult.Value();
  
   6646                                                     s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6647                                                     if (match.hit)
  
   6648                                                     {
  
   6649                                                         *parentMatch9 = match;
  
   6650                                                     }
  
   6651                                                     else
  
   6652                                                     {
  
   6653                                                         lexer.SetPos(save);
  
   6654                                                     }
  
   6655                                                 }
  
   6656                                                 *parentMatch8 = match;
  
   6657                                             }
  
   6658                                             *parentMatch7 = match;
  
   6659                                         }
  
   6660                                         *parentMatch6 = match;
  
   6661                                     }
  
   6662                                     if (match.hit)
  
   6663                                     {
  
   6664                                         System.Parsing.Match match(false);
  
   6665                                         System.Parsing.Match* parentMatch10 = &match;
  
   6666                                         {
  
   6667                                             System.Parsing.Match match(true);
  
   6668                                             for (int i : s23)
  
   6669                                             {
  
   6670                                                 if (*lexer == i)
  
   6671                                                 {
  
   6672                                                     auto incResult1 = ++lexer;
  
   6673                                                     if (incResult1.Error())
  
   6674                                                     {
  
   6675                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   6676                                                     }
  
   6677                                                 }
  
   6678                                                 else
  
   6679                                                 {
  
   6680                                                     match.hit = false;
  
   6681                                                     break;
  
   6682                                                 }
  
   6683                                             }
  
   6684                                             *parentMatch10 = match;
  
   6685                                         }
  
   6686                                         *parentMatch6 = match;
  
   6687                                     }
  
   6688                                     *parentMatch5 = match;
  
   6689                                 }
  
   6690                                 if (match.hit)
  
   6691                                 {
  
   6692                                     System.Parsing.Match match(false);
  
   6693                                     System.Parsing.Match* parentMatch11 = &match;
  
   6694                                     {
  
   6695                                         System.Parsing.Match match(true);
  
   6696                                         System.Parsing.Match* parentMatch12 = &match;
  
   6697                                         {
  
   6698                                             while (true)
  
   6699                                             {
  
   6700                                                 long save = lexer.GetPos();
  
   6701                                                 {
  
   6702                                                     System.Parsing.Match match(false);
  
   6703                                                     System.Parsing.Match* parentMatch13 = &match;
  
   6704                                                     {
  
   6705                                                         System.Parsing.Match match(false);
  
   6706                                                         System.Parsing.Match* parentMatch14 = &match;
  
   6707                                                         {
  
   6708                                                             System.Parsing.Match match(false);
  
   6709                                                             System.Parsing.Match* parentMatch15 = &match;
  
   6710                                                             {
  
   6711                                                                 System.Parsing.Match match(false);
  
   6712                                                                 System.Parsing.Match* parentMatch16 = &match;
  
   6713                                                                 {
  
   6714                                                                     System.Parsing.Match match(true);
  
   6715                                                                     long save = lexer.GetPos();
  
   6716                                                                     System.Parsing.Match* parentMatch17 = &match;
  
   6717                                                                     {
  
   6718                                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6719                                                                         if (matchResult.Error())
  
   6720                                                                         {
  
   6721                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6722                                                                         }
  
   6723                                                                         System.Parsing.Match match = matchResult.Value();
  
   6724                                                                         s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6725                                                                         if (match.hit)
  
   6726                                                                         {
  
   6727                                                                             *parentMatch17 = match;
  
   6728                                                                         }
  
   6729                                                                         else
  
   6730                                                                         {
  
   6731                                                                             lexer.SetPos(save);
  
   6732                                                                         }
  
   6733                                                                     }
  
   6734                                                                     *parentMatch16 = match;
  
   6735                                                                 }
  
   6736                                                                 if (match.hit)
  
   6737                                                                 {
  
   6738                                                                     System.Parsing.Match match(false);
  
   6739                                                                     System.Parsing.Match* parentMatch18 = &match;
  
   6740                                                                     {
  
   6741                                                                         System.Parsing.Match match(false);
  
   6742                                                                         if (*lexer == 124)
  
   6743                                                                         {
  
   6744                                                                             auto incResult2 = ++lexer;
  
   6745                                                                             if (incResult2.Error())
  
   6746                                                                             {
  
   6747                                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   6748                                                                             }
  
   6749                                                                             match.hit = true;
  
   6750                                                                         }
  
   6751                                                                         *parentMatch18 = match;
  
   6752                                                                     }
  
   6753                                                                     *parentMatch16 = match;
  
   6754                                                                 }
  
   6755                                                                 *parentMatch15 = match;
  
   6756                                                             }
  
   6757                                                             if (match.hit)
  
   6758                                                             {
  
   6759                                                                 System.Parsing.Match match(false);
  
   6760                                                                 System.Parsing.Match* parentMatch19 = &match;
  
   6761                                                                 {
  
   6762                                                                     System.Parsing.Match match(true);
  
   6763                                                                     long save = lexer.GetPos();
  
   6764                                                                     System.Parsing.Match* parentMatch20 = &match;
  
   6765                                                                     {
  
   6766                                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6767                                                                         if (matchResult.Error())
  
   6768                                                                         {
  
   6769                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6770                                                                         }
  
   6771                                                                         System.Parsing.Match match = matchResult.Value();
  
   6772                                                                         s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6773                                                                         if (match.hit)
  
   6774                                                                         {
  
   6775                                                                             *parentMatch20 = match;
  
   6776                                                                         }
  
   6777                                                                         else
  
   6778                                                                         {
  
   6779                                                                             lexer.SetPos(save);
  
   6780                                                                         }
  
   6781                                                                     }
  
   6782                                                                     *parentMatch19 = match;
  
   6783                                                                 }
  
   6784                                                                 *parentMatch15 = match;
  
   6785                                                             }
  
   6786                                                             *parentMatch14 = match;
  
   6787                                                         }
  
   6788                                                         if (match.hit)
  
   6789                                                         {
  
   6790                                                             System.Parsing.Match match(false);
  
   6791                                                             System.Parsing.Match* parentMatch21 = &match;
  
   6792                                                             {
  
   6793                                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   6794                                                                 if (matchResult.Error())
  
   6795                                                                 {
  
   6796                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6797                                                                 }
  
   6798                                                                 System.Parsing.Match match = matchResult.Value();
  
   6799                                                                 name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   6800                                                                 *parentMatch21 = match;
  
   6801                                                             }
  
   6802                                                             *parentMatch14 = match;
  
   6803                                                         }
  
   6804                                                         *parentMatch13 = match;
  
   6805                                                     }
  
   6806                                                     if (match.hit)
  
   6807                                                     {
  
   6808                                                         *parentMatch12 = match;
  
   6809                                                     }
  
   6810                                                     else
  
   6811                                                     {
  
   6812                                                         lexer.SetPos(save);
  
   6813                                                         break;
  
   6814                                                     }
  
   6815                                                 }
  
   6816                                             }
  
   6817                                         }
  
   6818                                         *parentMatch11 = match;
  
   6819                                     }
  
   6820                                     *parentMatch5 = match;
  
   6821                                 }
  
   6822                                 *parentMatch4 = match;
  
   6823                             }
  
   6824                             if (match.hit)
  
   6825                             {
  
   6826                                 System.Parsing.Match match(false);
  
   6827                                 System.Parsing.Match* parentMatch22 = &match;
  
   6828                                 {
  
   6829                                     System.Parsing.Match match(true);
  
   6830                                     long save = lexer.GetPos();
  
   6831                                     System.Parsing.Match* parentMatch23 = &match;
  
   6832                                     {
  
   6833                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6834                                         if (matchResult.Error())
  
   6835                                         {
  
   6836                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6837                                         }
  
   6838                                         System.Parsing.Match match = matchResult.Value();
  
   6839                                         s4.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6840                                         if (match.hit)
  
   6841                                         {
  
   6842                                             *parentMatch23 = match;
  
   6843                                         }
  
   6844                                         else
  
   6845                                         {
  
   6846                                             lexer.SetPos(save);
  
   6847                                         }
  
   6848                                     }
  
   6849                                     *parentMatch22 = match;
  
   6850                                 }
  
   6851                                 *parentMatch4 = match;
  
   6852                             }
  
   6853                             *parentMatch3 = match;
  
   6854                         }
  
   6855                         if (match.hit)
  
   6856                         {
  
   6857                             System.Parsing.Match match(false);
  
   6858                             System.Parsing.Match* parentMatch24 = &match;
  
   6859                             {
  
   6860                                 System.Parsing.Match match(true);
  
   6861                                 for (int i : s24)
  
   6862                                 {
  
   6863                                     if (*lexer == i)
  
   6864                                     {
  
   6865                                         auto incResult3 = ++lexer;
  
   6866                                         if (incResult3.Error())
  
   6867                                         {
  
   6868                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   6869                                         }
  
   6870                                     }
  
   6871                                     else
  
   6872                                     {
  
   6873                                         match.hit = false;
  
   6874                                         break;
  
   6875                                     }
  
   6876                                 }
  
   6877                                 *parentMatch24 = match;
  
   6878                             }
  
   6879                             *parentMatch3 = match;
  
   6880                         }
  
   6881                         *parentMatch2 = match;
  
   6882                         if (!match.hit)
  
   6883                         {
  
   6884                             System.Parsing.Match match(false);
  
   6885                             System.Parsing.Match* parentMatch25 = &match;
  
   6886                             lexer.SetPos(save);
  
   6887                             {
  
   6888                                 System.Parsing.Match match(false);
  
   6889                                 System.Parsing.Match* parentMatch26 = &match;
  
   6890                                 {
  
   6891                                     System.Parsing.Match match(false);
  
   6892                                     System.Parsing.Match* parentMatch27 = &match;
  
   6893                                     {
  
   6894                                         System.Parsing.Match match(false);
  
   6895                                         System.Parsing.Match* parentMatch28 = &match;
  
   6896                                         {
  
   6897                                             System.Parsing.Match match(false);
  
   6898                                             System.Parsing.Match* parentMatch29 = &match;
  
   6899                                             {
  
   6900                                                 System.Parsing.Match match(false);
  
   6901                                                 if (*lexer == 40)
  
   6902                                                 {
  
   6903                                                     auto incResult4 = ++lexer;
  
   6904                                                     if (incResult4.Error())
  
   6905                                                     {
  
   6906                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult4.GetErrorId()));
  
   6907                                                     }
  
   6908                                                     match.hit = true;
  
   6909                                                 }
  
   6910                                                 *parentMatch29 = match;
  
   6911                                             }
  
   6912                                             if (match.hit)
  
   6913                                             {
  
   6914                                                 System.Parsing.Match match(false);
  
   6915                                                 System.Parsing.Match* parentMatch30 = &match;
  
   6916                                                 {
  
   6917                                                     System.Parsing.Match match(true);
  
   6918                                                     long save = lexer.GetPos();
  
   6919                                                     System.Parsing.Match* parentMatch31 = &match;
  
   6920                                                     {
  
   6921                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6922                                                         if (matchResult.Error())
  
   6923                                                         {
  
   6924                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6925                                                         }
  
   6926                                                         System.Parsing.Match match = matchResult.Value();
  
   6927                                                         s5.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6928                                                         if (match.hit)
  
   6929                                                         {
  
   6930                                                             *parentMatch31 = match;
  
   6931                                                         }
  
   6932                                                         else
  
   6933                                                         {
  
   6934                                                             lexer.SetPos(save);
  
   6935                                                         }
  
   6936                                                     }
  
   6937                                                     *parentMatch30 = match;
  
   6938                                                 }
  
   6939                                                 *parentMatch29 = match;
  
   6940                                             }
  
   6941                                             *parentMatch28 = match;
  
   6942                                         }
  
   6943                                         if (match.hit)
  
   6944                                         {
  
   6945                                             System.Parsing.Match match(false);
  
   6946                                             System.Parsing.Match* parentMatch32 = &match;
  
   6947                                             {
  
   6948                                                 System.Parsing.Match match(true);
  
   6949                                                 for (int i : s25)
  
   6950                                                 {
  
   6951                                                     if (*lexer == i)
  
   6952                                                     {
  
   6953                                                         auto incResult5 = ++lexer;
  
   6954                                                         if (incResult5.Error())
  
   6955                                                         {
  
   6956                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult5.GetErrorId()));
  
   6957                                                         }
  
   6958                                                     }
  
   6959                                                     else
  
   6960                                                     {
  
   6961                                                         match.hit = false;
  
   6962                                                         break;
  
   6963                                                     }
  
   6964                                                 }
  
   6965                                                 *parentMatch32 = match;
  
   6966                                             }
  
   6967                                             *parentMatch28 = match;
  
   6968                                         }
  
   6969                                         *parentMatch27 = match;
  
   6970                                     }
  
   6971                                     if (match.hit)
  
   6972                                     {
  
   6973                                         System.Parsing.Match match(false);
  
   6974                                         System.Parsing.Match* parentMatch33 = &match;
  
   6975                                         {
  
   6976                                             System.Parsing.Match match(true);
  
   6977                                             long save = lexer.GetPos();
  
   6978                                             System.Parsing.Match* parentMatch34 = &match;
  
   6979                                             {
  
   6980                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   6981                                                 if (matchResult.Error())
  
   6982                                                 {
  
   6983                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   6984                                                 }
  
   6985                                                 System.Parsing.Match match = matchResult.Value();
  
   6986                                                 s6.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   6987                                                 if (match.hit)
  
   6988                                                 {
  
   6989                                                     *parentMatch34 = match;
  
   6990                                                 }
  
   6991                                                 else
  
   6992                                                 {
  
   6993                                                     lexer.SetPos(save);
  
   6994                                                 }
  
   6995                                             }
  
   6996                                             *parentMatch33 = match;
  
   6997                                         }
  
   6998                                         *parentMatch27 = match;
  
   6999                                     }
  
   7000                                     *parentMatch26 = match;
  
   7001                                 }
  
   7002                                 if (match.hit)
  
   7003                                 {
  
   7004                                     System.Parsing.Match match(false);
  
   7005                                     System.Parsing.Match* parentMatch35 = &match;
  
   7006                                     {
  
   7007                                         System.Parsing.Match match(false);
  
   7008                                         if (*lexer == 41)
  
   7009                                         {
  
   7010                                             auto incResult6 = ++lexer;
  
   7011                                             if (incResult6.Error())
  
   7012                                             {
  
   7013                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult6.GetErrorId()));
  
   7014                                             }
  
   7015                                             match.hit = true;
  
   7016                                         }
  
   7017                                         *parentMatch35 = match;
  
   7018                                     }
  
   7019                                     *parentMatch26 = match;
  
   7020                                 }
  
   7021                                 *parentMatch25 = match;
  
   7022                             }
  
   7023                             *parentMatch2 = match;
  
   7024                         }
  
   7025                     }
  
   7026                     *parentMatch1 = match;
  
   7027                 }
  
   7028                 if (match.hit)
  
   7029                 {
  
   7030                     #if (DEBUG)
  
   7031                         if (parser_debug_write_to_log)
  
   7032                         {
  
   7033                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Mixed");
  
   7034                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7035                         }
  
   7036                     #endif
  
   7037                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   7038                 }
  
   7039                 *parentMatch0 = match;
  
   7040             }
  
   7041             #if (DEBUG)
  
   7042             if (parser_debug_write_to_log)
  
   7043             {
  
   7044                 if (match.hit)
  
   7045                 {
  
   7046                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Mixed");
  
   7047                     if (result.Error())
  
   7048                     {
  
   7049                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7050                     }
  
   7051                 }
  
   7052                 else
  
   7053                 {
  
   7054                     auto result = System.Lex.WriteFailureToLog(lexer, u"Mixed");
  
   7055                     if (result.Error())
  
   7056                     {
  
   7057                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7058                     }
  
   7059                 }
  
   7060             }
  
   7061             #endif
  
   7062             if (!match.hit)
  
   7063             {
  
   7064                 match.value = null;
  
   7065             }
  
   7066             return System.Result<System.Parsing.Match>(match);
  
   7067         }
  
   7068         public static System.Result<System.Parsing.Match> AttlistDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   7069         {
  
   7070             #if (DEBUG)
  
   7071             long parser_debug_match_pos = 0;
  
   7072             bool parser_debug_write_to_log = lexer.Log() != null;
  
   7073             if (parser_debug_write_to_log)
  
   7074             {
  
   7075                 parser_debug_match_pos = lexer.GetPos();
  
   7076                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"AttlistDecl");
  
   7077                 if (result.Error())
  
   7078                 {
  
   7079                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7080                 }
  
   7081             }
  
   7082             #endif
  
   7083             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475942);
  
   7084             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   7085             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
   7086             System.UniquePtr<System.Parsing.Value<bool>> attdef;
  
   7087             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   7088             System.Parsing.Match match(false);
  
   7089             System.Parsing.Match* parentMatch0 = &match;
  
   7090             {
  
   7091                 long pos = lexer.GetPos();
  
   7092                 System.Parsing.Match match(false);
  
   7093                 System.Parsing.Match* parentMatch1 = &match;
  
   7094                 {
  
   7095                     System.Parsing.Match match(false);
  
   7096                     System.Parsing.Match* parentMatch2 = &match;
  
   7097                     {
  
   7098                         System.Parsing.Match match(false);
  
   7099                         System.Parsing.Match* parentMatch3 = &match;
  
   7100                         {
  
   7101                             System.Parsing.Match match(false);
  
   7102                             System.Parsing.Match* parentMatch4 = &match;
  
   7103                             {
  
   7104                                 System.Parsing.Match match(false);
  
   7105                                 System.Parsing.Match* parentMatch5 = &match;
  
   7106                                 {
  
   7107                                     System.Parsing.Match match(false);
  
   7108                                     System.Parsing.Match* parentMatch6 = &match;
  
   7109                                     {
  
   7110                                         System.Parsing.Match match(true);
  
   7111                                         for (int i : s26)
  
   7112                                         {
  
   7113                                             if (*lexer == i)
  
   7114                                             {
  
   7115                                                 auto incResult0 = ++lexer;
  
   7116                                                 if (incResult0.Error())
  
   7117                                                 {
  
   7118                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   7119                                                 }
  
   7120                                             }
  
   7121                                             else
  
   7122                                             {
  
   7123                                                 match.hit = false;
  
   7124                                                 break;
  
   7125                                             }
  
   7126                                         }
  
   7127                                         *parentMatch6 = match;
  
   7128                                     }
  
   7129                                     if (match.hit)
  
   7130                                     {
  
   7131                                         System.Parsing.Match match(false);
  
   7132                                         System.Parsing.Match* parentMatch7 = &match;
  
   7133                                         {
  
   7134                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   7135                                             if (matchResult.Error())
  
   7136                                             {
  
   7137                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7138                                             }
  
   7139                                             System.Parsing.Match match = matchResult.Value();
  
   7140                                             s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7141                                             *parentMatch7 = match;
  
   7142                                         }
  
   7143                                         *parentMatch6 = match;
  
   7144                                     }
  
   7145                                     *parentMatch5 = match;
  
   7146                                 }
  
   7147                                 if (match.hit)
  
   7148                                 {
  
   7149                                     System.Parsing.Match match(false);
  
   7150                                     System.Parsing.Match* parentMatch8 = &match;
  
   7151                                     {
  
   7152                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   7153                                         if (matchResult.Error())
  
   7154                                         {
  
   7155                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7156                                         }
  
   7157                                         System.Parsing.Match match = matchResult.Value();
  
   7158                                         name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   7159                                         *parentMatch8 = match;
  
   7160                                     }
  
   7161                                     *parentMatch5 = match;
  
   7162                                 }
  
   7163                                 *parentMatch4 = match;
  
   7164                             }
  
   7165                             if (match.hit)
  
   7166                             {
  
   7167                                 System.Parsing.Match match(false);
  
   7168                                 System.Parsing.Match* parentMatch9 = &match;
  
   7169                                 {
  
   7170                                     System.Parsing.Match match(true);
  
   7171                                     System.Parsing.Match* parentMatch10 = &match;
  
   7172                                     {
  
   7173                                         while (true)
  
   7174                                         {
  
   7175                                             long save = lexer.GetPos();
  
   7176                                             {
  
   7177                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.AttDef(lexer, processor);
  
   7178                                                 if (matchResult.Error())
  
   7179                                                 {
  
   7180                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7181                                                 }
  
   7182                                                 System.Parsing.Match match = matchResult.Value();
  
   7183                                                 attdef.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7184                                                 if (match.hit)
  
   7185                                                 {
  
   7186                                                     *parentMatch10 = match;
  
   7187                                                 }
  
   7188                                                 else
  
   7189                                                 {
  
   7190                                                     lexer.SetPos(save);
  
   7191                                                     break;
  
   7192                                                 }
  
   7193                                             }
  
   7194                                         }
  
   7195                                     }
  
   7196                                     *parentMatch9 = match;
  
   7197                                 }
  
   7198                                 *parentMatch4 = match;
  
   7199                             }
  
   7200                             *parentMatch3 = match;
  
   7201                         }
  
   7202                         if (match.hit)
  
   7203                         {
  
   7204                             System.Parsing.Match match(false);
  
   7205                             System.Parsing.Match* parentMatch11 = &match;
  
   7206                             {
  
   7207                                 System.Parsing.Match match(true);
  
   7208                                 long save = lexer.GetPos();
  
   7209                                 System.Parsing.Match* parentMatch12 = &match;
  
   7210                                 {
  
   7211                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   7212                                     if (matchResult.Error())
  
   7213                                     {
  
   7214                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7215                                     }
  
   7216                                     System.Parsing.Match match = matchResult.Value();
  
   7217                                     s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7218                                     if (match.hit)
  
   7219                                     {
  
   7220                                         *parentMatch12 = match;
  
   7221                                     }
  
   7222                                     else
  
   7223                                     {
  
   7224                                         lexer.SetPos(save);
  
   7225                                     }
  
   7226                                 }
  
   7227                                 *parentMatch11 = match;
  
   7228                             }
  
   7229                             *parentMatch3 = match;
  
   7230                         }
  
   7231                         *parentMatch2 = match;
  
   7232                     }
  
   7233                     if (match.hit)
  
   7234                     {
  
   7235                         System.Parsing.Match match(false);
  
   7236                         System.Parsing.Match* parentMatch13 = &match;
  
   7237                         {
  
   7238                             System.Parsing.Match match(false);
  
   7239                             if (*lexer == 62)
  
   7240                             {
  
   7241                                 auto incResult1 = ++lexer;
  
   7242                                 if (incResult1.Error())
  
   7243                                 {
  
   7244                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   7245                                 }
  
   7246                                 match.hit = true;
  
   7247                             }
  
   7248                             *parentMatch13 = match;
  
   7249                         }
  
   7250                         *parentMatch2 = match;
  
   7251                     }
  
   7252                     *parentMatch1 = match;
  
   7253                 }
  
   7254                 if (match.hit)
  
   7255                 {
  
   7256                     #if (DEBUG)
  
   7257                         if (parser_debug_write_to_log)
  
   7258                         {
  
   7259                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttlistDecl");
  
   7260                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7261                         }
  
   7262                     #endif
  
   7263                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   7264                 }
  
   7265                 *parentMatch0 = match;
  
   7266             }
  
   7267             #if (DEBUG)
  
   7268             if (parser_debug_write_to_log)
  
   7269             {
  
   7270                 if (match.hit)
  
   7271                 {
  
   7272                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttlistDecl");
  
   7273                     if (result.Error())
  
   7274                     {
  
   7275                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7276                     }
  
   7277                 }
  
   7278                 else
  
   7279                 {
  
   7280                     auto result = System.Lex.WriteFailureToLog(lexer, u"AttlistDecl");
  
   7281                     if (result.Error())
  
   7282                     {
  
   7283                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7284                     }
  
   7285                 }
  
   7286             }
  
   7287             #endif
  
   7288             if (!match.hit)
  
   7289             {
  
   7290                 match.value = null;
  
   7291             }
  
   7292             return System.Result<System.Parsing.Match>(match);
  
   7293         }
  
   7294         public static System.Result<System.Parsing.Match> AttDef(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   7295         {
  
   7296             #if (DEBUG)
  
   7297             long parser_debug_match_pos = 0;
  
   7298             bool parser_debug_write_to_log = lexer.Log() != null;
  
   7299             if (parser_debug_write_to_log)
  
   7300             {
  
   7301                 parser_debug_match_pos = lexer.GetPos();
  
   7302                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"AttDef");
  
   7303                 if (result.Error())
  
   7304                 {
  
   7305                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7306                 }
  
   7307             }
  
   7308             #endif
  
   7309             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475943);
  
   7310             System.UniquePtr<System.Parsing.Value<bool>> s;
  
   7311             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
   7312             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   7313             System.UniquePtr<System.Parsing.Value<bool>> attType;
  
   7314             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   7315             System.UniquePtr<System.Parsing.Value<bool>> defaultDecl;
  
   7316             System.Parsing.Match match(false);
  
   7317             System.Parsing.Match* parentMatch0 = &match;
  
   7318             {
  
   7319                 long pos = lexer.GetPos();
  
   7320                 System.Parsing.Match match(false);
  
   7321                 System.Parsing.Match* parentMatch1 = &match;
  
   7322                 {
  
   7323                     System.Parsing.Match match(false);
  
   7324                     System.Parsing.Match* parentMatch2 = &match;
  
   7325                     {
  
   7326                         System.Parsing.Match match(false);
  
   7327                         System.Parsing.Match* parentMatch3 = &match;
  
   7328                         {
  
   7329                             System.Parsing.Match match(false);
  
   7330                             System.Parsing.Match* parentMatch4 = &match;
  
   7331                             {
  
   7332                                 System.Parsing.Match match(false);
  
   7333                                 System.Parsing.Match* parentMatch5 = &match;
  
   7334                                 {
  
   7335                                     System.Parsing.Match match(false);
  
   7336                                     System.Parsing.Match* parentMatch6 = &match;
  
   7337                                     {
  
   7338                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   7339                                         if (matchResult.Error())
  
   7340                                         {
  
   7341                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7342                                         }
  
   7343                                         System.Parsing.Match match = matchResult.Value();
  
   7344                                         s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7345                                         *parentMatch6 = match;
  
   7346                                     }
  
   7347                                     if (match.hit)
  
   7348                                     {
  
   7349                                         System.Parsing.Match match(false);
  
   7350                                         System.Parsing.Match* parentMatch7 = &match;
  
   7351                                         {
  
   7352                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   7353                                             if (matchResult.Error())
  
   7354                                             {
  
   7355                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7356                                             }
  
   7357                                             System.Parsing.Match match = matchResult.Value();
  
   7358                                             name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   7359                                             *parentMatch7 = match;
  
   7360                                         }
  
   7361                                         *parentMatch6 = match;
  
   7362                                     }
  
   7363                                     *parentMatch5 = match;
  
   7364                                 }
  
   7365                                 if (match.hit)
  
   7366                                 {
  
   7367                                     System.Parsing.Match match(false);
  
   7368                                     System.Parsing.Match* parentMatch8 = &match;
  
   7369                                     {
  
   7370                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   7371                                         if (matchResult.Error())
  
   7372                                         {
  
   7373                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7374                                         }
  
   7375                                         System.Parsing.Match match = matchResult.Value();
  
   7376                                         s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7377                                         *parentMatch8 = match;
  
   7378                                     }
  
   7379                                     *parentMatch5 = match;
  
   7380                                 }
  
   7381                                 *parentMatch4 = match;
  
   7382                             }
  
   7383                             if (match.hit)
  
   7384                             {
  
   7385                                 System.Parsing.Match match(false);
  
   7386                                 System.Parsing.Match* parentMatch9 = &match;
  
   7387                                 {
  
   7388                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.AttType(lexer);
  
   7389                                     if (matchResult.Error())
  
   7390                                     {
  
   7391                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7392                                     }
  
   7393                                     System.Parsing.Match match = matchResult.Value();
  
   7394                                     attType.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7395                                     *parentMatch9 = match;
  
   7396                                 }
  
   7397                                 *parentMatch4 = match;
  
   7398                             }
  
   7399                             *parentMatch3 = match;
  
   7400                         }
  
   7401                         if (match.hit)
  
   7402                         {
  
   7403                             System.Parsing.Match match(false);
  
   7404                             System.Parsing.Match* parentMatch10 = &match;
  
   7405                             {
  
   7406                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   7407                                 if (matchResult.Error())
  
   7408                                 {
  
   7409                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7410                                 }
  
   7411                                 System.Parsing.Match match = matchResult.Value();
  
   7412                                 s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7413                                 *parentMatch10 = match;
  
   7414                             }
  
   7415                             *parentMatch3 = match;
  
   7416                         }
  
   7417                         *parentMatch2 = match;
  
   7418                     }
  
   7419                     if (match.hit)
  
   7420                     {
  
   7421                         System.Parsing.Match match(false);
  
   7422                         System.Parsing.Match* parentMatch11 = &match;
  
   7423                         {
  
   7424                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.DefaultDecl(lexer, processor);
  
   7425                             if (matchResult.Error())
  
   7426                             {
  
   7427                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7428                             }
  
   7429                             System.Parsing.Match match = matchResult.Value();
  
   7430                             defaultDecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7431                             *parentMatch11 = match;
  
   7432                         }
  
   7433                         *parentMatch2 = match;
  
   7434                     }
  
   7435                     *parentMatch1 = match;
  
   7436                 }
  
   7437                 if (match.hit)
  
   7438                 {
  
   7439                     #if (DEBUG)
  
   7440                         if (parser_debug_write_to_log)
  
   7441                         {
  
   7442                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttDef");
  
   7443                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7444                         }
  
   7445                     #endif
  
   7446                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   7447                 }
  
   7448                 *parentMatch0 = match;
  
   7449             }
  
   7450             #if (DEBUG)
  
   7451             if (parser_debug_write_to_log)
  
   7452             {
  
   7453                 if (match.hit)
  
   7454                 {
  
   7455                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttDef");
  
   7456                     if (result.Error())
  
   7457                     {
  
   7458                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7459                     }
  
   7460                 }
  
   7461                 else
  
   7462                 {
  
   7463                     auto result = System.Lex.WriteFailureToLog(lexer, u"AttDef");
  
   7464                     if (result.Error())
  
   7465                     {
  
   7466                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7467                     }
  
   7468                 }
  
   7469             }
  
   7470             #endif
  
   7471             if (!match.hit)
  
   7472             {
  
   7473                 match.value = null;
  
   7474             }
  
   7475             return System.Result<System.Parsing.Match>(match);
  
   7476         }
  
   7477         public static System.Result<System.Parsing.Match> AttType(LexerT& lexer)
  
   7478         {
  
   7479             #if (DEBUG)
  
   7480             long parser_debug_match_pos = 0;
  
   7481             bool parser_debug_write_to_log = lexer.Log() != null;
  
   7482             if (parser_debug_write_to_log)
  
   7483             {
  
   7484                 parser_debug_match_pos = lexer.GetPos();
  
   7485                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"AttType");
  
   7486                 if (result.Error())
  
   7487                 {
  
   7488                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7489                 }
  
   7490             }
  
   7491             #endif
  
   7492             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475944);
  
   7493             System.UniquePtr<System.Parsing.Value<bool>> stringType;
  
   7494             System.UniquePtr<System.Parsing.Value<bool>> tokenizedType;
  
   7495             System.UniquePtr<System.Parsing.Value<bool>> enumeratedType;
  
   7496             System.Parsing.Match match(false);
  
   7497             System.Parsing.Match* parentMatch0 = &match;
  
   7498             {
  
   7499                 long pos = lexer.GetPos();
  
   7500                 System.Parsing.Match match(false);
  
   7501                 System.Parsing.Match* parentMatch1 = &match;
  
   7502                 {
  
   7503                     System.Parsing.Match match(false);
  
   7504                     System.Parsing.Match* parentMatch2 = &match;
  
   7505                     {
  
   7506                         long save = lexer.GetPos();
  
   7507                         System.Parsing.Match match(false);
  
   7508                         System.Parsing.Match* parentMatch3 = &match;
  
   7509                         {
  
   7510                             long save = lexer.GetPos();
  
   7511                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.StringType(lexer);
  
   7512                             if (matchResult.Error())
  
   7513                             {
  
   7514                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7515                             }
  
   7516                             System.Parsing.Match match = matchResult.Value();
  
   7517                             stringType.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7518                             *parentMatch3 = match;
  
   7519                             if (!match.hit)
  
   7520                             {
  
   7521                                 System.Parsing.Match match(false);
  
   7522                                 System.Parsing.Match* parentMatch4 = &match;
  
   7523                                 lexer.SetPos(save);
  
   7524                                 {
  
   7525                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.TokenizedType(lexer);
  
   7526                                     if (matchResult.Error())
  
   7527                                     {
  
   7528                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7529                                     }
  
   7530                                     System.Parsing.Match match = matchResult.Value();
  
   7531                                     tokenizedType.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7532                                     *parentMatch4 = match;
  
   7533                                 }
  
   7534                                 *parentMatch3 = match;
  
   7535                             }
  
   7536                         }
  
   7537                         *parentMatch2 = match;
  
   7538                         if (!match.hit)
  
   7539                         {
  
   7540                             System.Parsing.Match match(false);
  
   7541                             System.Parsing.Match* parentMatch5 = &match;
  
   7542                             lexer.SetPos(save);
  
   7543                             {
  
   7544                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EnumeratedType(lexer);
  
   7545                                 if (matchResult.Error())
  
   7546                                 {
  
   7547                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7548                                 }
  
   7549                                 System.Parsing.Match match = matchResult.Value();
  
   7550                                 enumeratedType.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7551                                 *parentMatch5 = match;
  
   7552                             }
  
   7553                             *parentMatch2 = match;
  
   7554                         }
  
   7555                     }
  
   7556                     *parentMatch1 = match;
  
   7557                 }
  
   7558                 if (match.hit)
  
   7559                 {
  
   7560                     #if (DEBUG)
  
   7561                         if (parser_debug_write_to_log)
  
   7562                         {
  
   7563                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttType");
  
   7564                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7565                         }
  
   7566                     #endif
  
   7567                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   7568                 }
  
   7569                 *parentMatch0 = match;
  
   7570             }
  
   7571             #if (DEBUG)
  
   7572             if (parser_debug_write_to_log)
  
   7573             {
  
   7574                 if (match.hit)
  
   7575                 {
  
   7576                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttType");
  
   7577                     if (result.Error())
  
   7578                     {
  
   7579                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7580                     }
  
   7581                 }
  
   7582                 else
  
   7583                 {
  
   7584                     auto result = System.Lex.WriteFailureToLog(lexer, u"AttType");
  
   7585                     if (result.Error())
  
   7586                     {
  
   7587                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7588                     }
  
   7589                 }
  
   7590             }
  
   7591             #endif
  
   7592             if (!match.hit)
  
   7593             {
  
   7594                 match.value = null;
  
   7595             }
  
   7596             return System.Result<System.Parsing.Match>(match);
  
   7597         }
  
   7598         public static System.Result<System.Parsing.Match> StringType(LexerT& lexer)
  
   7599         {
  
   7600             #if (DEBUG)
  
   7601             long parser_debug_match_pos = 0;
  
   7602             bool parser_debug_write_to_log = lexer.Log() != null;
  
   7603             if (parser_debug_write_to_log)
  
   7604             {
  
   7605                 parser_debug_match_pos = lexer.GetPos();
  
   7606                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"StringType");
  
   7607                 if (result.Error())
  
   7608                 {
  
   7609                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7610                 }
  
   7611             }
  
   7612             #endif
  
   7613             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475945);
  
   7614             System.Parsing.Match match(false);
  
   7615             System.Parsing.Match* parentMatch0 = &match;
  
   7616             {
  
   7617                 long pos = lexer.GetPos();
  
   7618                 System.Parsing.Match match(false);
  
   7619                 System.Parsing.Match* parentMatch1 = &match;
  
   7620                 {
  
   7621                     System.Parsing.Match match(true);
  
   7622                     for (int i : s27)
  
   7623                     {
  
   7624                         if (*lexer == i)
  
   7625                         {
  
   7626                             auto incResult0 = ++lexer;
  
   7627                             if (incResult0.Error())
  
   7628                             {
  
   7629                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   7630                             }
  
   7631                         }
  
   7632                         else
  
   7633                         {
  
   7634                             match.hit = false;
  
   7635                             break;
  
   7636                         }
  
   7637                     }
  
   7638                     *parentMatch1 = match;
  
   7639                 }
  
   7640                 if (match.hit)
  
   7641                 {
  
   7642                     #if (DEBUG)
  
   7643                         if (parser_debug_write_to_log)
  
   7644                         {
  
   7645                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"StringType");
  
   7646                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7647                         }
  
   7648                     #endif
  
   7649                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   7650                 }
  
   7651                 *parentMatch0 = match;
  
   7652             }
  
   7653             #if (DEBUG)
  
   7654             if (parser_debug_write_to_log)
  
   7655             {
  
   7656                 if (match.hit)
  
   7657                 {
  
   7658                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"StringType");
  
   7659                     if (result.Error())
  
   7660                     {
  
   7661                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7662                     }
  
   7663                 }
  
   7664                 else
  
   7665                 {
  
   7666                     auto result = System.Lex.WriteFailureToLog(lexer, u"StringType");
  
   7667                     if (result.Error())
  
   7668                     {
  
   7669                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7670                     }
  
   7671                 }
  
   7672             }
  
   7673             #endif
  
   7674             if (!match.hit)
  
   7675             {
  
   7676                 match.value = null;
  
   7677             }
  
   7678             return System.Result<System.Parsing.Match>(match);
  
   7679         }
  
   7680         public static System.Result<System.Parsing.Match> TokenizedType(LexerT& lexer)
  
   7681         {
  
   7682             #if (DEBUG)
  
   7683             long parser_debug_match_pos = 0;
  
   7684             bool parser_debug_write_to_log = lexer.Log() != null;
  
   7685             if (parser_debug_write_to_log)
  
   7686             {
  
   7687                 parser_debug_match_pos = lexer.GetPos();
  
   7688                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"TokenizedType");
  
   7689                 if (result.Error())
  
   7690                 {
  
   7691                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7692                 }
  
   7693             }
  
   7694             #endif
  
   7695             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475946);
  
   7696             System.Parsing.Match match(false);
  
   7697             System.Parsing.Match* parentMatch0 = &match;
  
   7698             {
  
   7699                 long pos = lexer.GetPos();
  
   7700                 System.Parsing.Match match(false);
  
   7701                 System.Parsing.Match* parentMatch1 = &match;
  
   7702                 {
  
   7703                     System.Parsing.Match match(false);
  
   7704                     System.Parsing.Match* parentMatch2 = &match;
  
   7705                     {
  
   7706                         long save = lexer.GetPos();
  
   7707                         System.Parsing.Match match(false);
  
   7708                         System.Parsing.Match* parentMatch3 = &match;
  
   7709                         {
  
   7710                             long save = lexer.GetPos();
  
   7711                             System.Parsing.Match match(false);
  
   7712                             System.Parsing.Match* parentMatch4 = &match;
  
   7713                             {
  
   7714                                 long save = lexer.GetPos();
  
   7715                                 System.Parsing.Match match(false);
  
   7716                                 System.Parsing.Match* parentMatch5 = &match;
  
   7717                                 {
  
   7718                                     long save = lexer.GetPos();
  
   7719                                     System.Parsing.Match match(false);
  
   7720                                     System.Parsing.Match* parentMatch6 = &match;
  
   7721                                     {
  
   7722                                         long save = lexer.GetPos();
  
   7723                                         System.Parsing.Match match(false);
  
   7724                                         System.Parsing.Match* parentMatch7 = &match;
  
   7725                                         {
  
   7726                                             long save = lexer.GetPos();
  
   7727                                             System.Parsing.Match match(true);
  
   7728                                             for (int i : s28)
  
   7729                                             {
  
   7730                                                 if (*lexer == i)
  
   7731                                                 {
  
   7732                                                     auto incResult0 = ++lexer;
  
   7733                                                     if (incResult0.Error())
  
   7734                                                     {
  
   7735                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   7736                                                     }
  
   7737                                                 }
  
   7738                                                 else
  
   7739                                                 {
  
   7740                                                     match.hit = false;
  
   7741                                                     break;
  
   7742                                                 }
  
   7743                                             }
  
   7744                                             *parentMatch7 = match;
  
   7745                                             if (!match.hit)
  
   7746                                             {
  
   7747                                                 System.Parsing.Match match(false);
  
   7748                                                 System.Parsing.Match* parentMatch8 = &match;
  
   7749                                                 lexer.SetPos(save);
  
   7750                                                 {
  
   7751                                                     System.Parsing.Match match(true);
  
   7752                                                     for (int i : s29)
  
   7753                                                     {
  
   7754                                                         if (*lexer == i)
  
   7755                                                         {
  
   7756                                                             auto incResult1 = ++lexer;
  
   7757                                                             if (incResult1.Error())
  
   7758                                                             {
  
   7759                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   7760                                                             }
  
   7761                                                         }
  
   7762                                                         else
  
   7763                                                         {
  
   7764                                                             match.hit = false;
  
   7765                                                             break;
  
   7766                                                         }
  
   7767                                                     }
  
   7768                                                     *parentMatch8 = match;
  
   7769                                                 }
  
   7770                                                 *parentMatch7 = match;
  
   7771                                             }
  
   7772                                         }
  
   7773                                         *parentMatch6 = match;
  
   7774                                         if (!match.hit)
  
   7775                                         {
  
   7776                                             System.Parsing.Match match(false);
  
   7777                                             System.Parsing.Match* parentMatch9 = &match;
  
   7778                                             lexer.SetPos(save);
  
   7779                                             {
  
   7780                                                 System.Parsing.Match match(true);
  
   7781                                                 for (int i : s30)
  
   7782                                                 {
  
   7783                                                     if (*lexer == i)
  
   7784                                                     {
  
   7785                                                         auto incResult2 = ++lexer;
  
   7786                                                         if (incResult2.Error())
  
   7787                                                         {
  
   7788                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   7789                                                         }
  
   7790                                                     }
  
   7791                                                     else
  
   7792                                                     {
  
   7793                                                         match.hit = false;
  
   7794                                                         break;
  
   7795                                                     }
  
   7796                                                 }
  
   7797                                                 *parentMatch9 = match;
  
   7798                                             }
  
   7799                                             *parentMatch6 = match;
  
   7800                                         }
  
   7801                                     }
  
   7802                                     *parentMatch5 = match;
  
   7803                                     if (!match.hit)
  
   7804                                     {
  
   7805                                         System.Parsing.Match match(false);
  
   7806                                         System.Parsing.Match* parentMatch10 = &match;
  
   7807                                         lexer.SetPos(save);
  
   7808                                         {
  
   7809                                             System.Parsing.Match match(true);
  
   7810                                             for (int i : s31)
  
   7811                                             {
  
   7812                                                 if (*lexer == i)
  
   7813                                                 {
  
   7814                                                     auto incResult3 = ++lexer;
  
   7815                                                     if (incResult3.Error())
  
   7816                                                     {
  
   7817                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   7818                                                     }
  
   7819                                                 }
  
   7820                                                 else
  
   7821                                                 {
  
   7822                                                     match.hit = false;
  
   7823                                                     break;
  
   7824                                                 }
  
   7825                                             }
  
   7826                                             *parentMatch10 = match;
  
   7827                                         }
  
   7828                                         *parentMatch5 = match;
  
   7829                                     }
  
   7830                                 }
  
   7831                                 *parentMatch4 = match;
  
   7832                                 if (!match.hit)
  
   7833                                 {
  
   7834                                     System.Parsing.Match match(false);
  
   7835                                     System.Parsing.Match* parentMatch11 = &match;
  
   7836                                     lexer.SetPos(save);
  
   7837                                     {
  
   7838                                         System.Parsing.Match match(true);
  
   7839                                         for (int i : s32)
  
   7840                                         {
  
   7841                                             if (*lexer == i)
  
   7842                                             {
  
   7843                                                 auto incResult4 = ++lexer;
  
   7844                                                 if (incResult4.Error())
  
   7845                                                 {
  
   7846                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult4.GetErrorId()));
  
   7847                                                 }
  
   7848                                             }
  
   7849                                             else
  
   7850                                             {
  
   7851                                                 match.hit = false;
  
   7852                                                 break;
  
   7853                                             }
  
   7854                                         }
  
   7855                                         *parentMatch11 = match;
  
   7856                                     }
  
   7857                                     *parentMatch4 = match;
  
   7858                                 }
  
   7859                             }
  
   7860                             *parentMatch3 = match;
  
   7861                             if (!match.hit)
  
   7862                             {
  
   7863                                 System.Parsing.Match match(false);
  
   7864                                 System.Parsing.Match* parentMatch12 = &match;
  
   7865                                 lexer.SetPos(save);
  
   7866                                 {
  
   7867                                     System.Parsing.Match match(true);
  
   7868                                     for (int i : s33)
  
   7869                                     {
  
   7870                                         if (*lexer == i)
  
   7871                                         {
  
   7872                                             auto incResult5 = ++lexer;
  
   7873                                             if (incResult5.Error())
  
   7874                                             {
  
   7875                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult5.GetErrorId()));
  
   7876                                             }
  
   7877                                         }
  
   7878                                         else
  
   7879                                         {
  
   7880                                             match.hit = false;
  
   7881                                             break;
  
   7882                                         }
  
   7883                                     }
  
   7884                                     *parentMatch12 = match;
  
   7885                                 }
  
   7886                                 *parentMatch3 = match;
  
   7887                             }
  
   7888                         }
  
   7889                         *parentMatch2 = match;
  
   7890                         if (!match.hit)
  
   7891                         {
  
   7892                             System.Parsing.Match match(false);
  
   7893                             System.Parsing.Match* parentMatch13 = &match;
  
   7894                             lexer.SetPos(save);
  
   7895                             {
  
   7896                                 System.Parsing.Match match(true);
  
   7897                                 for (int i : s34)
  
   7898                                 {
  
   7899                                     if (*lexer == i)
  
   7900                                     {
  
   7901                                         auto incResult6 = ++lexer;
  
   7902                                         if (incResult6.Error())
  
   7903                                         {
  
   7904                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult6.GetErrorId()));
  
   7905                                         }
  
   7906                                     }
  
   7907                                     else
  
   7908                                     {
  
   7909                                         match.hit = false;
  
   7910                                         break;
  
   7911                                     }
  
   7912                                 }
  
   7913                                 *parentMatch13 = match;
  
   7914                             }
  
   7915                             *parentMatch2 = match;
  
   7916                         }
  
   7917                     }
  
   7918                     *parentMatch1 = match;
  
   7919                 }
  
   7920                 if (match.hit)
  
   7921                 {
  
   7922                     #if (DEBUG)
  
   7923                         if (parser_debug_write_to_log)
  
   7924                         {
  
   7925                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"TokenizedType");
  
   7926                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7927                         }
  
   7928                     #endif
  
   7929                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   7930                 }
  
   7931                 *parentMatch0 = match;
  
   7932             }
  
   7933             #if (DEBUG)
  
   7934             if (parser_debug_write_to_log)
  
   7935             {
  
   7936                 if (match.hit)
  
   7937                 {
  
   7938                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"TokenizedType");
  
   7939                     if (result.Error())
  
   7940                     {
  
   7941                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7942                     }
  
   7943                 }
  
   7944                 else
  
   7945                 {
  
   7946                     auto result = System.Lex.WriteFailureToLog(lexer, u"TokenizedType");
  
   7947                     if (result.Error())
  
   7948                     {
  
   7949                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7950                     }
  
   7951                 }
  
   7952             }
  
   7953             #endif
  
   7954             if (!match.hit)
  
   7955             {
  
   7956                 match.value = null;
  
   7957             }
  
   7958             return System.Result<System.Parsing.Match>(match);
  
   7959         }
  
   7960         public static System.Result<System.Parsing.Match> EnumeratedType(LexerT& lexer)
  
   7961         {
  
   7962             #if (DEBUG)
  
   7963             long parser_debug_match_pos = 0;
  
   7964             bool parser_debug_write_to_log = lexer.Log() != null;
  
   7965             if (parser_debug_write_to_log)
  
   7966             {
  
   7967                 parser_debug_match_pos = lexer.GetPos();
  
   7968                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EnumeratedType");
  
   7969                 if (result.Error())
  
   7970                 {
  
   7971                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   7972                 }
  
   7973             }
  
   7974             #endif
  
   7975             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475947);
  
   7976             System.UniquePtr<System.Parsing.Value<bool>> notationType;
  
   7977             System.UniquePtr<System.Parsing.Value<bool>> enumeration;
  
   7978             System.Parsing.Match match(false);
  
   7979             System.Parsing.Match* parentMatch0 = &match;
  
   7980             {
  
   7981                 long pos = lexer.GetPos();
  
   7982                 System.Parsing.Match match(false);
  
   7983                 System.Parsing.Match* parentMatch1 = &match;
  
   7984                 {
  
   7985                     System.Parsing.Match match(false);
  
   7986                     System.Parsing.Match* parentMatch2 = &match;
  
   7987                     {
  
   7988                         long save = lexer.GetPos();
  
   7989                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NotationType(lexer);
  
   7990                         if (matchResult.Error())
  
   7991                         {
  
   7992                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   7993                         }
  
   7994                         System.Parsing.Match match = matchResult.Value();
  
   7995                         notationType.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   7996                         *parentMatch2 = match;
  
   7997                         if (!match.hit)
  
   7998                         {
  
   7999                             System.Parsing.Match match(false);
  
   8000                             System.Parsing.Match* parentMatch3 = &match;
  
   8001                             lexer.SetPos(save);
  
   8002                             {
  
   8003                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Enumeration(lexer);
  
   8004                                 if (matchResult.Error())
  
   8005                                 {
  
   8006                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8007                                 }
  
   8008                                 System.Parsing.Match match = matchResult.Value();
  
   8009                                 enumeration.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8010                                 *parentMatch3 = match;
  
   8011                             }
  
   8012                             *parentMatch2 = match;
  
   8013                         }
  
   8014                     }
  
   8015                     *parentMatch1 = match;
  
   8016                 }
  
   8017                 if (match.hit)
  
   8018                 {
  
   8019                     #if (DEBUG)
  
   8020                         if (parser_debug_write_to_log)
  
   8021                         {
  
   8022                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EnumeratedType");
  
   8023                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8024                         }
  
   8025                     #endif
  
   8026                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   8027                 }
  
   8028                 *parentMatch0 = match;
  
   8029             }
  
   8030             #if (DEBUG)
  
   8031             if (parser_debug_write_to_log)
  
   8032             {
  
   8033                 if (match.hit)
  
   8034                 {
  
   8035                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EnumeratedType");
  
   8036                     if (result.Error())
  
   8037                     {
  
   8038                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8039                     }
  
   8040                 }
  
   8041                 else
  
   8042                 {
  
   8043                     auto result = System.Lex.WriteFailureToLog(lexer, u"EnumeratedType");
  
   8044                     if (result.Error())
  
   8045                     {
  
   8046                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8047                     }
  
   8048                 }
  
   8049             }
  
   8050             #endif
  
   8051             if (!match.hit)
  
   8052             {
  
   8053                 match.value = null;
  
   8054             }
  
   8055             return System.Result<System.Parsing.Match>(match);
  
   8056         }
  
   8057         public static System.Result<System.Parsing.Match> NotationType(LexerT& lexer)
  
   8058         {
  
   8059             #if (DEBUG)
  
   8060             long parser_debug_match_pos = 0;
  
   8061             bool parser_debug_write_to_log = lexer.Log() != null;
  
   8062             if (parser_debug_write_to_log)
  
   8063             {
  
   8064                 parser_debug_match_pos = lexer.GetPos();
  
   8065                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"NotationType");
  
   8066                 if (result.Error())
  
   8067                 {
  
   8068                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8069                 }
  
   8070             }
  
   8071             #endif
  
   8072             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475948);
  
   8073             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   8074             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   8075             System.UniquePtr<System.Parsing.Value<ustring>> f;
  
   8076             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   8077             System.UniquePtr<System.Parsing.Value<bool>> s4;
  
   8078             System.UniquePtr<System.Parsing.Value<ustring>> n;
  
   8079             System.UniquePtr<System.Parsing.Value<bool>> s5;
  
   8080             System.Parsing.Match match(false);
  
   8081             System.Parsing.Match* parentMatch0 = &match;
  
   8082             {
  
   8083                 long pos = lexer.GetPos();
  
   8084                 System.Parsing.Match match(false);
  
   8085                 System.Parsing.Match* parentMatch1 = &match;
  
   8086                 {
  
   8087                     System.Parsing.Match match(false);
  
   8088                     System.Parsing.Match* parentMatch2 = &match;
  
   8089                     {
  
   8090                         System.Parsing.Match match(false);
  
   8091                         System.Parsing.Match* parentMatch3 = &match;
  
   8092                         {
  
   8093                             System.Parsing.Match match(false);
  
   8094                             System.Parsing.Match* parentMatch4 = &match;
  
   8095                             {
  
   8096                                 System.Parsing.Match match(false);
  
   8097                                 System.Parsing.Match* parentMatch5 = &match;
  
   8098                                 {
  
   8099                                     System.Parsing.Match match(false);
  
   8100                                     System.Parsing.Match* parentMatch6 = &match;
  
   8101                                     {
  
   8102                                         System.Parsing.Match match(false);
  
   8103                                         System.Parsing.Match* parentMatch7 = &match;
  
   8104                                         {
  
   8105                                             System.Parsing.Match match(false);
  
   8106                                             System.Parsing.Match* parentMatch8 = &match;
  
   8107                                             {
  
   8108                                                 System.Parsing.Match match(true);
  
   8109                                                 for (int i : s35)
  
   8110                                                 {
  
   8111                                                     if (*lexer == i)
  
   8112                                                     {
  
   8113                                                         auto incResult0 = ++lexer;
  
   8114                                                         if (incResult0.Error())
  
   8115                                                         {
  
   8116                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   8117                                                         }
  
   8118                                                     }
  
   8119                                                     else
  
   8120                                                     {
  
   8121                                                         match.hit = false;
  
   8122                                                         break;
  
   8123                                                     }
  
   8124                                                 }
  
   8125                                                 *parentMatch8 = match;
  
   8126                                             }
  
   8127                                             if (match.hit)
  
   8128                                             {
  
   8129                                                 System.Parsing.Match match(false);
  
   8130                                                 System.Parsing.Match* parentMatch9 = &match;
  
   8131                                                 {
  
   8132                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8133                                                     if (matchResult.Error())
  
   8134                                                     {
  
   8135                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8136                                                     }
  
   8137                                                     System.Parsing.Match match = matchResult.Value();
  
   8138                                                     s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8139                                                     *parentMatch9 = match;
  
   8140                                                 }
  
   8141                                                 *parentMatch8 = match;
  
   8142                                             }
  
   8143                                             *parentMatch7 = match;
  
   8144                                         }
  
   8145                                         if (match.hit)
  
   8146                                         {
  
   8147                                             System.Parsing.Match match(false);
  
   8148                                             System.Parsing.Match* parentMatch10 = &match;
  
   8149                                             {
  
   8150                                                 System.Parsing.Match match(false);
  
   8151                                                 if (*lexer == 40)
  
   8152                                                 {
  
   8153                                                     auto incResult1 = ++lexer;
  
   8154                                                     if (incResult1.Error())
  
   8155                                                     {
  
   8156                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   8157                                                     }
  
   8158                                                     match.hit = true;
  
   8159                                                 }
  
   8160                                                 *parentMatch10 = match;
  
   8161                                             }
  
   8162                                             *parentMatch7 = match;
  
   8163                                         }
  
   8164                                         *parentMatch6 = match;
  
   8165                                     }
  
   8166                                     if (match.hit)
  
   8167                                     {
  
   8168                                         System.Parsing.Match match(false);
  
   8169                                         System.Parsing.Match* parentMatch11 = &match;
  
   8170                                         {
  
   8171                                             System.Parsing.Match match(true);
  
   8172                                             long save = lexer.GetPos();
  
   8173                                             System.Parsing.Match* parentMatch12 = &match;
  
   8174                                             {
  
   8175                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8176                                                 if (matchResult.Error())
  
   8177                                                 {
  
   8178                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8179                                                 }
  
   8180                                                 System.Parsing.Match match = matchResult.Value();
  
   8181                                                 s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8182                                                 if (match.hit)
  
   8183                                                 {
  
   8184                                                     *parentMatch12 = match;
  
   8185                                                 }
  
   8186                                                 else
  
   8187                                                 {
  
   8188                                                     lexer.SetPos(save);
  
   8189                                                 }
  
   8190                                             }
  
   8191                                             *parentMatch11 = match;
  
   8192                                         }
  
   8193                                         *parentMatch6 = match;
  
   8194                                     }
  
   8195                                     *parentMatch5 = match;
  
   8196                                 }
  
   8197                                 if (match.hit)
  
   8198                                 {
  
   8199                                     System.Parsing.Match match(false);
  
   8200                                     System.Parsing.Match* parentMatch13 = &match;
  
   8201                                     {
  
   8202                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   8203                                         if (matchResult.Error())
  
   8204                                         {
  
   8205                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8206                                         }
  
   8207                                         System.Parsing.Match match = matchResult.Value();
  
   8208                                         f.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   8209                                         *parentMatch13 = match;
  
   8210                                     }
  
   8211                                     *parentMatch5 = match;
  
   8212                                 }
  
   8213                                 *parentMatch4 = match;
  
   8214                             }
  
   8215                             if (match.hit)
  
   8216                             {
  
   8217                                 System.Parsing.Match match(false);
  
   8218                                 System.Parsing.Match* parentMatch14 = &match;
  
   8219                                 {
  
   8220                                     System.Parsing.Match match(true);
  
   8221                                     System.Parsing.Match* parentMatch15 = &match;
  
   8222                                     {
  
   8223                                         while (true)
  
   8224                                         {
  
   8225                                             long save = lexer.GetPos();
  
   8226                                             {
  
   8227                                                 System.Parsing.Match match(false);
  
   8228                                                 System.Parsing.Match* parentMatch16 = &match;
  
   8229                                                 {
  
   8230                                                     System.Parsing.Match match(false);
  
   8231                                                     System.Parsing.Match* parentMatch17 = &match;
  
   8232                                                     {
  
   8233                                                         System.Parsing.Match match(false);
  
   8234                                                         System.Parsing.Match* parentMatch18 = &match;
  
   8235                                                         {
  
   8236                                                             System.Parsing.Match match(false);
  
   8237                                                             System.Parsing.Match* parentMatch19 = &match;
  
   8238                                                             {
  
   8239                                                                 System.Parsing.Match match(true);
  
   8240                                                                 long save = lexer.GetPos();
  
   8241                                                                 System.Parsing.Match* parentMatch20 = &match;
  
   8242                                                                 {
  
   8243                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8244                                                                     if (matchResult.Error())
  
   8245                                                                     {
  
   8246                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8247                                                                     }
  
   8248                                                                     System.Parsing.Match match = matchResult.Value();
  
   8249                                                                     s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8250                                                                     if (match.hit)
  
   8251                                                                     {
  
   8252                                                                         *parentMatch20 = match;
  
   8253                                                                     }
  
   8254                                                                     else
  
   8255                                                                     {
  
   8256                                                                         lexer.SetPos(save);
  
   8257                                                                     }
  
   8258                                                                 }
  
   8259                                                                 *parentMatch19 = match;
  
   8260                                                             }
  
   8261                                                             if (match.hit)
  
   8262                                                             {
  
   8263                                                                 System.Parsing.Match match(false);
  
   8264                                                                 System.Parsing.Match* parentMatch21 = &match;
  
   8265                                                                 {
  
   8266                                                                     System.Parsing.Match match(false);
  
   8267                                                                     if (*lexer == 124)
  
   8268                                                                     {
  
   8269                                                                         auto incResult2 = ++lexer;
  
   8270                                                                         if (incResult2.Error())
  
   8271                                                                         {
  
   8272                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   8273                                                                         }
  
   8274                                                                         match.hit = true;
  
   8275                                                                     }
  
   8276                                                                     *parentMatch21 = match;
  
   8277                                                                 }
  
   8278                                                                 *parentMatch19 = match;
  
   8279                                                             }
  
   8280                                                             *parentMatch18 = match;
  
   8281                                                         }
  
   8282                                                         if (match.hit)
  
   8283                                                         {
  
   8284                                                             System.Parsing.Match match(false);
  
   8285                                                             System.Parsing.Match* parentMatch22 = &match;
  
   8286                                                             {
  
   8287                                                                 System.Parsing.Match match(true);
  
   8288                                                                 long save = lexer.GetPos();
  
   8289                                                                 System.Parsing.Match* parentMatch23 = &match;
  
   8290                                                                 {
  
   8291                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8292                                                                     if (matchResult.Error())
  
   8293                                                                     {
  
   8294                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8295                                                                     }
  
   8296                                                                     System.Parsing.Match match = matchResult.Value();
  
   8297                                                                     s4.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8298                                                                     if (match.hit)
  
   8299                                                                     {
  
   8300                                                                         *parentMatch23 = match;
  
   8301                                                                     }
  
   8302                                                                     else
  
   8303                                                                     {
  
   8304                                                                         lexer.SetPos(save);
  
   8305                                                                     }
  
   8306                                                                 }
  
   8307                                                                 *parentMatch22 = match;
  
   8308                                                             }
  
   8309                                                             *parentMatch18 = match;
  
   8310                                                         }
  
   8311                                                         *parentMatch17 = match;
  
   8312                                                     }
  
   8313                                                     if (match.hit)
  
   8314                                                     {
  
   8315                                                         System.Parsing.Match match(false);
  
   8316                                                         System.Parsing.Match* parentMatch24 = &match;
  
   8317                                                         {
  
   8318                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   8319                                                             if (matchResult.Error())
  
   8320                                                             {
  
   8321                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8322                                                             }
  
   8323                                                             System.Parsing.Match match = matchResult.Value();
  
   8324                                                             n.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   8325                                                             *parentMatch24 = match;
  
   8326                                                         }
  
   8327                                                         *parentMatch17 = match;
  
   8328                                                     }
  
   8329                                                     *parentMatch16 = match;
  
   8330                                                 }
  
   8331                                                 if (match.hit)
  
   8332                                                 {
  
   8333                                                     *parentMatch15 = match;
  
   8334                                                 }
  
   8335                                                 else
  
   8336                                                 {
  
   8337                                                     lexer.SetPos(save);
  
   8338                                                     break;
  
   8339                                                 }
  
   8340                                             }
  
   8341                                         }
  
   8342                                     }
  
   8343                                     *parentMatch14 = match;
  
   8344                                 }
  
   8345                                 *parentMatch4 = match;
  
   8346                             }
  
   8347                             *parentMatch3 = match;
  
   8348                         }
  
   8349                         if (match.hit)
  
   8350                         {
  
   8351                             System.Parsing.Match match(false);
  
   8352                             System.Parsing.Match* parentMatch25 = &match;
  
   8353                             {
  
   8354                                 System.Parsing.Match match(true);
  
   8355                                 long save = lexer.GetPos();
  
   8356                                 System.Parsing.Match* parentMatch26 = &match;
  
   8357                                 {
  
   8358                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8359                                     if (matchResult.Error())
  
   8360                                     {
  
   8361                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8362                                     }
  
   8363                                     System.Parsing.Match match = matchResult.Value();
  
   8364                                     s5.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8365                                     if (match.hit)
  
   8366                                     {
  
   8367                                         *parentMatch26 = match;
  
   8368                                     }
  
   8369                                     else
  
   8370                                     {
  
   8371                                         lexer.SetPos(save);
  
   8372                                     }
  
   8373                                 }
  
   8374                                 *parentMatch25 = match;
  
   8375                             }
  
   8376                             *parentMatch3 = match;
  
   8377                         }
  
   8378                         *parentMatch2 = match;
  
   8379                     }
  
   8380                     if (match.hit)
  
   8381                     {
  
   8382                         System.Parsing.Match match(false);
  
   8383                         System.Parsing.Match* parentMatch27 = &match;
  
   8384                         {
  
   8385                             System.Parsing.Match match(false);
  
   8386                             if (*lexer == 41)
  
   8387                             {
  
   8388                                 auto incResult3 = ++lexer;
  
   8389                                 if (incResult3.Error())
  
   8390                                 {
  
   8391                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
   8392                                 }
  
   8393                                 match.hit = true;
  
   8394                             }
  
   8395                             *parentMatch27 = match;
  
   8396                         }
  
   8397                         *parentMatch2 = match;
  
   8398                     }
  
   8399                     *parentMatch1 = match;
  
   8400                 }
  
   8401                 if (match.hit)
  
   8402                 {
  
   8403                     #if (DEBUG)
  
   8404                         if (parser_debug_write_to_log)
  
   8405                         {
  
   8406                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NotationType");
  
   8407                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8408                         }
  
   8409                     #endif
  
   8410                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   8411                 }
  
   8412                 *parentMatch0 = match;
  
   8413             }
  
   8414             #if (DEBUG)
  
   8415             if (parser_debug_write_to_log)
  
   8416             {
  
   8417                 if (match.hit)
  
   8418                 {
  
   8419                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NotationType");
  
   8420                     if (result.Error())
  
   8421                     {
  
   8422                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8423                     }
  
   8424                 }
  
   8425                 else
  
   8426                 {
  
   8427                     auto result = System.Lex.WriteFailureToLog(lexer, u"NotationType");
  
   8428                     if (result.Error())
  
   8429                     {
  
   8430                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8431                     }
  
   8432                 }
  
   8433             }
  
   8434             #endif
  
   8435             if (!match.hit)
  
   8436             {
  
   8437                 match.value = null;
  
   8438             }
  
   8439             return System.Result<System.Parsing.Match>(match);
  
   8440         }
  
   8441         public static System.Result<System.Parsing.Match> Enumeration(LexerT& lexer)
  
   8442         {
  
   8443             #if (DEBUG)
  
   8444             long parser_debug_match_pos = 0;
  
   8445             bool parser_debug_write_to_log = lexer.Log() != null;
  
   8446             if (parser_debug_write_to_log)
  
   8447             {
  
   8448                 parser_debug_match_pos = lexer.GetPos();
  
   8449                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Enumeration");
  
   8450                 if (result.Error())
  
   8451                 {
  
   8452                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8453                 }
  
   8454             }
  
   8455             #endif
  
   8456             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475949);
  
   8457             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   8458             System.UniquePtr<System.Parsing.Value<bool>> nmtoken;
  
   8459             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   8460             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   8461             System.UniquePtr<System.Parsing.Value<bool>> nmtoken2;
  
   8462             System.UniquePtr<System.Parsing.Value<bool>> s4;
  
   8463             System.Parsing.Match match(false);
  
   8464             System.Parsing.Match* parentMatch0 = &match;
  
   8465             {
  
   8466                 long pos = lexer.GetPos();
  
   8467                 System.Parsing.Match match(false);
  
   8468                 System.Parsing.Match* parentMatch1 = &match;
  
   8469                 {
  
   8470                     System.Parsing.Match match(false);
  
   8471                     System.Parsing.Match* parentMatch2 = &match;
  
   8472                     {
  
   8473                         System.Parsing.Match match(false);
  
   8474                         System.Parsing.Match* parentMatch3 = &match;
  
   8475                         {
  
   8476                             System.Parsing.Match match(false);
  
   8477                             System.Parsing.Match* parentMatch4 = &match;
  
   8478                             {
  
   8479                                 System.Parsing.Match match(false);
  
   8480                                 System.Parsing.Match* parentMatch5 = &match;
  
   8481                                 {
  
   8482                                     System.Parsing.Match match(false);
  
   8483                                     System.Parsing.Match* parentMatch6 = &match;
  
   8484                                     {
  
   8485                                         System.Parsing.Match match(false);
  
   8486                                         if (*lexer == 40)
  
   8487                                         {
  
   8488                                             auto incResult0 = ++lexer;
  
   8489                                             if (incResult0.Error())
  
   8490                                             {
  
   8491                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   8492                                             }
  
   8493                                             match.hit = true;
  
   8494                                         }
  
   8495                                         *parentMatch6 = match;
  
   8496                                     }
  
   8497                                     if (match.hit)
  
   8498                                     {
  
   8499                                         System.Parsing.Match match(false);
  
   8500                                         System.Parsing.Match* parentMatch7 = &match;
  
   8501                                         {
  
   8502                                             System.Parsing.Match match(true);
  
   8503                                             long save = lexer.GetPos();
  
   8504                                             System.Parsing.Match* parentMatch8 = &match;
  
   8505                                             {
  
   8506                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8507                                                 if (matchResult.Error())
  
   8508                                                 {
  
   8509                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8510                                                 }
  
   8511                                                 System.Parsing.Match match = matchResult.Value();
  
   8512                                                 s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8513                                                 if (match.hit)
  
   8514                                                 {
  
   8515                                                     *parentMatch8 = match;
  
   8516                                                 }
  
   8517                                                 else
  
   8518                                                 {
  
   8519                                                     lexer.SetPos(save);
  
   8520                                                 }
  
   8521                                             }
  
   8522                                             *parentMatch7 = match;
  
   8523                                         }
  
   8524                                         *parentMatch6 = match;
  
   8525                                     }
  
   8526                                     *parentMatch5 = match;
  
   8527                                 }
  
   8528                                 if (match.hit)
  
   8529                                 {
  
   8530                                     System.Parsing.Match match(false);
  
   8531                                     System.Parsing.Match* parentMatch9 = &match;
  
   8532                                     {
  
   8533                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Nmtoken(lexer);
  
   8534                                         if (matchResult.Error())
  
   8535                                         {
  
   8536                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8537                                         }
  
   8538                                         System.Parsing.Match match = matchResult.Value();
  
   8539                                         nmtoken.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8540                                         *parentMatch9 = match;
  
   8541                                     }
  
   8542                                     *parentMatch5 = match;
  
   8543                                 }
  
   8544                                 *parentMatch4 = match;
  
   8545                             }
  
   8546                             if (match.hit)
  
   8547                             {
  
   8548                                 System.Parsing.Match match(false);
  
   8549                                 System.Parsing.Match* parentMatch10 = &match;
  
   8550                                 {
  
   8551                                     System.Parsing.Match match(true);
  
   8552                                     System.Parsing.Match* parentMatch11 = &match;
  
   8553                                     {
  
   8554                                         while (true)
  
   8555                                         {
  
   8556                                             long save = lexer.GetPos();
  
   8557                                             {
  
   8558                                                 System.Parsing.Match match(false);
  
   8559                                                 System.Parsing.Match* parentMatch12 = &match;
  
   8560                                                 {
  
   8561                                                     System.Parsing.Match match(false);
  
   8562                                                     System.Parsing.Match* parentMatch13 = &match;
  
   8563                                                     {
  
   8564                                                         System.Parsing.Match match(false);
  
   8565                                                         System.Parsing.Match* parentMatch14 = &match;
  
   8566                                                         {
  
   8567                                                             System.Parsing.Match match(false);
  
   8568                                                             System.Parsing.Match* parentMatch15 = &match;
  
   8569                                                             {
  
   8570                                                                 System.Parsing.Match match(true);
  
   8571                                                                 long save = lexer.GetPos();
  
   8572                                                                 System.Parsing.Match* parentMatch16 = &match;
  
   8573                                                                 {
  
   8574                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8575                                                                     if (matchResult.Error())
  
   8576                                                                     {
  
   8577                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8578                                                                     }
  
   8579                                                                     System.Parsing.Match match = matchResult.Value();
  
   8580                                                                     s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8581                                                                     if (match.hit)
  
   8582                                                                     {
  
   8583                                                                         *parentMatch16 = match;
  
   8584                                                                     }
  
   8585                                                                     else
  
   8586                                                                     {
  
   8587                                                                         lexer.SetPos(save);
  
   8588                                                                     }
  
   8589                                                                 }
  
   8590                                                                 *parentMatch15 = match;
  
   8591                                                             }
  
   8592                                                             if (match.hit)
  
   8593                                                             {
  
   8594                                                                 System.Parsing.Match match(false);
  
   8595                                                                 System.Parsing.Match* parentMatch17 = &match;
  
   8596                                                                 {
  
   8597                                                                     System.Parsing.Match match(false);
  
   8598                                                                     if (*lexer == 124)
  
   8599                                                                     {
  
   8600                                                                         auto incResult1 = ++lexer;
  
   8601                                                                         if (incResult1.Error())
  
   8602                                                                         {
  
   8603                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   8604                                                                         }
  
   8605                                                                         match.hit = true;
  
   8606                                                                     }
  
   8607                                                                     *parentMatch17 = match;
  
   8608                                                                 }
  
   8609                                                                 *parentMatch15 = match;
  
   8610                                                             }
  
   8611                                                             *parentMatch14 = match;
  
   8612                                                         }
  
   8613                                                         if (match.hit)
  
   8614                                                         {
  
   8615                                                             System.Parsing.Match match(false);
  
   8616                                                             System.Parsing.Match* parentMatch18 = &match;
  
   8617                                                             {
  
   8618                                                                 System.Parsing.Match match(true);
  
   8619                                                                 long save = lexer.GetPos();
  
   8620                                                                 System.Parsing.Match* parentMatch19 = &match;
  
   8621                                                                 {
  
   8622                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8623                                                                     if (matchResult.Error())
  
   8624                                                                     {
  
   8625                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8626                                                                     }
  
   8627                                                                     System.Parsing.Match match = matchResult.Value();
  
   8628                                                                     s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8629                                                                     if (match.hit)
  
   8630                                                                     {
  
   8631                                                                         *parentMatch19 = match;
  
   8632                                                                     }
  
   8633                                                                     else
  
   8634                                                                     {
  
   8635                                                                         lexer.SetPos(save);
  
   8636                                                                     }
  
   8637                                                                 }
  
   8638                                                                 *parentMatch18 = match;
  
   8639                                                             }
  
   8640                                                             *parentMatch14 = match;
  
   8641                                                         }
  
   8642                                                         *parentMatch13 = match;
  
   8643                                                     }
  
   8644                                                     if (match.hit)
  
   8645                                                     {
  
   8646                                                         System.Parsing.Match match(false);
  
   8647                                                         System.Parsing.Match* parentMatch20 = &match;
  
   8648                                                         {
  
   8649                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Nmtoken(lexer);
  
   8650                                                             if (matchResult.Error())
  
   8651                                                             {
  
   8652                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8653                                                             }
  
   8654                                                             System.Parsing.Match match = matchResult.Value();
  
   8655                                                             nmtoken2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8656                                                             *parentMatch20 = match;
  
   8657                                                         }
  
   8658                                                         *parentMatch13 = match;
  
   8659                                                     }
  
   8660                                                     *parentMatch12 = match;
  
   8661                                                 }
  
   8662                                                 if (match.hit)
  
   8663                                                 {
  
   8664                                                     *parentMatch11 = match;
  
   8665                                                 }
  
   8666                                                 else
  
   8667                                                 {
  
   8668                                                     lexer.SetPos(save);
  
   8669                                                     break;
  
   8670                                                 }
  
   8671                                             }
  
   8672                                         }
  
   8673                                     }
  
   8674                                     *parentMatch10 = match;
  
   8675                                 }
  
   8676                                 *parentMatch4 = match;
  
   8677                             }
  
   8678                             *parentMatch3 = match;
  
   8679                         }
  
   8680                         if (match.hit)
  
   8681                         {
  
   8682                             System.Parsing.Match match(false);
  
   8683                             System.Parsing.Match* parentMatch21 = &match;
  
   8684                             {
  
   8685                                 System.Parsing.Match match(true);
  
   8686                                 long save = lexer.GetPos();
  
   8687                                 System.Parsing.Match* parentMatch22 = &match;
  
   8688                                 {
  
   8689                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8690                                     if (matchResult.Error())
  
   8691                                     {
  
   8692                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8693                                     }
  
   8694                                     System.Parsing.Match match = matchResult.Value();
  
   8695                                     s4.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8696                                     if (match.hit)
  
   8697                                     {
  
   8698                                         *parentMatch22 = match;
  
   8699                                     }
  
   8700                                     else
  
   8701                                     {
  
   8702                                         lexer.SetPos(save);
  
   8703                                     }
  
   8704                                 }
  
   8705                                 *parentMatch21 = match;
  
   8706                             }
  
   8707                             *parentMatch3 = match;
  
   8708                         }
  
   8709                         *parentMatch2 = match;
  
   8710                     }
  
   8711                     if (match.hit)
  
   8712                     {
  
   8713                         System.Parsing.Match match(false);
  
   8714                         System.Parsing.Match* parentMatch23 = &match;
  
   8715                         {
  
   8716                             System.Parsing.Match match(false);
  
   8717                             if (*lexer == 41)
  
   8718                             {
  
   8719                                 auto incResult2 = ++lexer;
  
   8720                                 if (incResult2.Error())
  
   8721                                 {
  
   8722                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   8723                                 }
  
   8724                                 match.hit = true;
  
   8725                             }
  
   8726                             *parentMatch23 = match;
  
   8727                         }
  
   8728                         *parentMatch2 = match;
  
   8729                     }
  
   8730                     *parentMatch1 = match;
  
   8731                 }
  
   8732                 if (match.hit)
  
   8733                 {
  
   8734                     #if (DEBUG)
  
   8735                         if (parser_debug_write_to_log)
  
   8736                         {
  
   8737                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Enumeration");
  
   8738                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8739                         }
  
   8740                     #endif
  
   8741                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   8742                 }
  
   8743                 *parentMatch0 = match;
  
   8744             }
  
   8745             #if (DEBUG)
  
   8746             if (parser_debug_write_to_log)
  
   8747             {
  
   8748                 if (match.hit)
  
   8749                 {
  
   8750                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Enumeration");
  
   8751                     if (result.Error())
  
   8752                     {
  
   8753                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8754                     }
  
   8755                 }
  
   8756                 else
  
   8757                 {
  
   8758                     auto result = System.Lex.WriteFailureToLog(lexer, u"Enumeration");
  
   8759                     if (result.Error())
  
   8760                     {
  
   8761                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8762                     }
  
   8763                 }
  
   8764             }
  
   8765             #endif
  
   8766             if (!match.hit)
  
   8767             {
  
   8768                 match.value = null;
  
   8769             }
  
   8770             return System.Result<System.Parsing.Match>(match);
  
   8771         }
  
   8772         public static System.Result<System.Parsing.Match> DefaultDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   8773         {
  
   8774             #if (DEBUG)
  
   8775             long parser_debug_match_pos = 0;
  
   8776             bool parser_debug_write_to_log = lexer.Log() != null;
  
   8777             if (parser_debug_write_to_log)
  
   8778             {
  
   8779                 parser_debug_match_pos = lexer.GetPos();
  
   8780                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"DefaultDecl");
  
   8781                 if (result.Error())
  
   8782                 {
  
   8783                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8784                 }
  
   8785             }
  
   8786             #endif
  
   8787             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475950);
  
   8788             System.UniquePtr<System.Parsing.Value<bool>> s;
  
   8789             System.UniquePtr<System.Parsing.Value<ustring>> attVAlue;
  
   8790             System.Parsing.Match match(false);
  
   8791             System.Parsing.Match* parentMatch0 = &match;
  
   8792             {
  
   8793                 long pos = lexer.GetPos();
  
   8794                 System.Parsing.Match match(false);
  
   8795                 System.Parsing.Match* parentMatch1 = &match;
  
   8796                 {
  
   8797                     System.Parsing.Match match(false);
  
   8798                     System.Parsing.Match* parentMatch2 = &match;
  
   8799                     {
  
   8800                         long save = lexer.GetPos();
  
   8801                         System.Parsing.Match match(false);
  
   8802                         System.Parsing.Match* parentMatch3 = &match;
  
   8803                         {
  
   8804                             long save = lexer.GetPos();
  
   8805                             System.Parsing.Match match(true);
  
   8806                             for (int i : s36)
  
   8807                             {
  
   8808                                 if (*lexer == i)
  
   8809                                 {
  
   8810                                     auto incResult0 = ++lexer;
  
   8811                                     if (incResult0.Error())
  
   8812                                     {
  
   8813                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   8814                                     }
  
   8815                                 }
  
   8816                                 else
  
   8817                                 {
  
   8818                                     match.hit = false;
  
   8819                                     break;
  
   8820                                 }
  
   8821                             }
  
   8822                             *parentMatch3 = match;
  
   8823                             if (!match.hit)
  
   8824                             {
  
   8825                                 System.Parsing.Match match(false);
  
   8826                                 System.Parsing.Match* parentMatch4 = &match;
  
   8827                                 lexer.SetPos(save);
  
   8828                                 {
  
   8829                                     System.Parsing.Match match(true);
  
   8830                                     for (int i : s37)
  
   8831                                     {
  
   8832                                         if (*lexer == i)
  
   8833                                         {
  
   8834                                             auto incResult1 = ++lexer;
  
   8835                                             if (incResult1.Error())
  
   8836                                             {
  
   8837                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   8838                                             }
  
   8839                                         }
  
   8840                                         else
  
   8841                                         {
  
   8842                                             match.hit = false;
  
   8843                                             break;
  
   8844                                         }
  
   8845                                     }
  
   8846                                     *parentMatch4 = match;
  
   8847                                 }
  
   8848                                 *parentMatch3 = match;
  
   8849                             }
  
   8850                         }
  
   8851                         *parentMatch2 = match;
  
   8852                         if (!match.hit)
  
   8853                         {
  
   8854                             System.Parsing.Match match(false);
  
   8855                             System.Parsing.Match* parentMatch5 = &match;
  
   8856                             lexer.SetPos(save);
  
   8857                             {
  
   8858                                 System.Parsing.Match match(false);
  
   8859                                 System.Parsing.Match* parentMatch6 = &match;
  
   8860                                 {
  
   8861                                     System.Parsing.Match match(false);
  
   8862                                     System.Parsing.Match* parentMatch7 = &match;
  
   8863                                     {
  
   8864                                         System.Parsing.Match match(true);
  
   8865                                         long save = lexer.GetPos();
  
   8866                                         System.Parsing.Match* parentMatch8 = &match;
  
   8867                                         {
  
   8868                                             System.Parsing.Match match(false);
  
   8869                                             System.Parsing.Match* parentMatch9 = &match;
  
   8870                                             {
  
   8871                                                 System.Parsing.Match match(false);
  
   8872                                                 System.Parsing.Match* parentMatch10 = &match;
  
   8873                                                 {
  
   8874                                                     System.Parsing.Match match(true);
  
   8875                                                     for (int i : s38)
  
   8876                                                     {
  
   8877                                                         if (*lexer == i)
  
   8878                                                         {
  
   8879                                                             auto incResult2 = ++lexer;
  
   8880                                                             if (incResult2.Error())
  
   8881                                                             {
  
   8882                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   8883                                                             }
  
   8884                                                         }
  
   8885                                                         else
  
   8886                                                         {
  
   8887                                                             match.hit = false;
  
   8888                                                             break;
  
   8889                                                         }
  
   8890                                                     }
  
   8891                                                     *parentMatch10 = match;
  
   8892                                                 }
  
   8893                                                 if (match.hit)
  
   8894                                                 {
  
   8895                                                     System.Parsing.Match match(false);
  
   8896                                                     System.Parsing.Match* parentMatch11 = &match;
  
   8897                                                     {
  
   8898                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   8899                                                         if (matchResult.Error())
  
   8900                                                         {
  
   8901                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8902                                                         }
  
   8903                                                         System.Parsing.Match match = matchResult.Value();
  
   8904                                                         s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   8905                                                         *parentMatch11 = match;
  
   8906                                                     }
  
   8907                                                     *parentMatch10 = match;
  
   8908                                                 }
  
   8909                                                 *parentMatch9 = match;
  
   8910                                             }
  
   8911                                             if (match.hit)
  
   8912                                             {
  
   8913                                                 *parentMatch8 = match;
  
   8914                                             }
  
   8915                                             else
  
   8916                                             {
  
   8917                                                 lexer.SetPos(save);
  
   8918                                             }
  
   8919                                         }
  
   8920                                         *parentMatch7 = match;
  
   8921                                     }
  
   8922                                     if (match.hit)
  
   8923                                     {
  
   8924                                         System.Parsing.Match match(false);
  
   8925                                         System.Parsing.Match* parentMatch12 = &match;
  
   8926                                         {
  
   8927                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.AttValue(lexer, processor);
  
   8928                                             if (matchResult.Error())
  
   8929                                             {
  
   8930                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   8931                                             }
  
   8932                                             System.Parsing.Match match = matchResult.Value();
  
   8933                                             attVAlue.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   8934                                             *parentMatch12 = match;
  
   8935                                         }
  
   8936                                         *parentMatch7 = match;
  
   8937                                     }
  
   8938                                     *parentMatch6 = match;
  
   8939                                 }
  
   8940                                 *parentMatch5 = match;
  
   8941                             }
  
   8942                             *parentMatch2 = match;
  
   8943                         }
  
   8944                     }
  
   8945                     *parentMatch1 = match;
  
   8946                 }
  
   8947                 if (match.hit)
  
   8948                 {
  
   8949                     #if (DEBUG)
  
   8950                         if (parser_debug_write_to_log)
  
   8951                         {
  
   8952                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DefaultDecl");
  
   8953                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8954                         }
  
   8955                     #endif
  
   8956                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   8957                 }
  
   8958                 *parentMatch0 = match;
  
   8959             }
  
   8960             #if (DEBUG)
  
   8961             if (parser_debug_write_to_log)
  
   8962             {
  
   8963                 if (match.hit)
  
   8964                 {
  
   8965                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DefaultDecl");
  
   8966                     if (result.Error())
  
   8967                     {
  
   8968                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8969                     }
  
   8970                 }
  
   8971                 else
  
   8972                 {
  
   8973                     auto result = System.Lex.WriteFailureToLog(lexer, u"DefaultDecl");
  
   8974                     if (result.Error())
  
   8975                     {
  
   8976                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8977                     }
  
   8978                 }
  
   8979             }
  
   8980             #endif
  
   8981             if (!match.hit)
  
   8982             {
  
   8983                 match.value = null;
  
   8984             }
  
   8985             return System.Result<System.Parsing.Match>(match);
  
   8986         }
  
   8987         public static System.Result<System.Parsing.Match> EntityDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   8988         {
  
   8989             #if (DEBUG)
  
   8990             long parser_debug_match_pos = 0;
  
   8991             bool parser_debug_write_to_log = lexer.Log() != null;
  
   8992             if (parser_debug_write_to_log)
  
   8993             {
  
   8994                 parser_debug_match_pos = lexer.GetPos();
  
   8995                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EntityDecl");
  
   8996                 if (result.Error())
  
   8997                 {
  
   8998                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   8999                 }
  
   9000             }
  
   9001             #endif
  
   9002             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475951);
  
   9003             System.UniquePtr<System.Parsing.Value<bool>> gedecl;
  
   9004             System.UniquePtr<System.Parsing.Value<bool>> pedecl;
  
   9005             System.Parsing.Match match(false);
  
   9006             System.Parsing.Match* parentMatch0 = &match;
  
   9007             {
  
   9008                 long pos = lexer.GetPos();
  
   9009                 System.Parsing.Match match(false);
  
   9010                 System.Parsing.Match* parentMatch1 = &match;
  
   9011                 {
  
   9012                     System.Parsing.Match match(false);
  
   9013                     System.Parsing.Match* parentMatch2 = &match;
  
   9014                     {
  
   9015                         long save = lexer.GetPos();
  
   9016                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.GEDecl(lexer, processor);
  
   9017                         if (matchResult.Error())
  
   9018                         {
  
   9019                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9020                         }
  
   9021                         System.Parsing.Match match = matchResult.Value();
  
   9022                         gedecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9023                         *parentMatch2 = match;
  
   9024                         if (!match.hit)
  
   9025                         {
  
   9026                             System.Parsing.Match match(false);
  
   9027                             System.Parsing.Match* parentMatch3 = &match;
  
   9028                             lexer.SetPos(save);
  
   9029                             {
  
   9030                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PEDecl(lexer, processor);
  
   9031                                 if (matchResult.Error())
  
   9032                                 {
  
   9033                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9034                                 }
  
   9035                                 System.Parsing.Match match = matchResult.Value();
  
   9036                                 pedecl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9037                                 *parentMatch3 = match;
  
   9038                             }
  
   9039                             *parentMatch2 = match;
  
   9040                         }
  
   9041                     }
  
   9042                     *parentMatch1 = match;
  
   9043                 }
  
   9044                 if (match.hit)
  
   9045                 {
  
   9046                     #if (DEBUG)
  
   9047                         if (parser_debug_write_to_log)
  
   9048                         {
  
   9049                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityDecl");
  
   9050                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9051                         }
  
   9052                     #endif
  
   9053                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   9054                 }
  
   9055                 *parentMatch0 = match;
  
   9056             }
  
   9057             #if (DEBUG)
  
   9058             if (parser_debug_write_to_log)
  
   9059             {
  
   9060                 if (match.hit)
  
   9061                 {
  
   9062                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityDecl");
  
   9063                     if (result.Error())
  
   9064                     {
  
   9065                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9066                     }
  
   9067                 }
  
   9068                 else
  
   9069                 {
  
   9070                     auto result = System.Lex.WriteFailureToLog(lexer, u"EntityDecl");
  
   9071                     if (result.Error())
  
   9072                     {
  
   9073                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9074                     }
  
   9075                 }
  
   9076             }
  
   9077             #endif
  
   9078             if (!match.hit)
  
   9079             {
  
   9080                 match.value = null;
  
   9081             }
  
   9082             return System.Result<System.Parsing.Match>(match);
  
   9083         }
  
   9084         public static System.Result<System.Parsing.Match> GEDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   9085         {
  
   9086             #if (DEBUG)
  
   9087             long parser_debug_match_pos = 0;
  
   9088             bool parser_debug_write_to_log = lexer.Log() != null;
  
   9089             if (parser_debug_write_to_log)
  
   9090             {
  
   9091                 parser_debug_match_pos = lexer.GetPos();
  
   9092                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"GEDecl");
  
   9093                 if (result.Error())
  
   9094                 {
  
   9095                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9096                 }
  
   9097             }
  
   9098             #endif
  
   9099             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475952);
  
   9100             System.UniquePtr<System.Parsing.Value<bool>> s0;
  
   9101             System.UniquePtr<System.Parsing.Value<ustring>> entityName;
  
   9102             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   9103             System.UniquePtr<System.Parsing.Value<bool>> entityValue;
  
   9104             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   9105             System.Parsing.Match match(false);
  
   9106             System.Parsing.Match* parentMatch0 = &match;
  
   9107             {
  
   9108                 long pos = lexer.GetPos();
  
   9109                 System.Parsing.Match match(false);
  
   9110                 System.Parsing.Match* parentMatch1 = &match;
  
   9111                 {
  
   9112                     System.Parsing.Match match(false);
  
   9113                     System.Parsing.Match* parentMatch2 = &match;
  
   9114                     {
  
   9115                         System.Parsing.Match match(false);
  
   9116                         System.Parsing.Match* parentMatch3 = &match;
  
   9117                         {
  
   9118                             System.Parsing.Match match(false);
  
   9119                             System.Parsing.Match* parentMatch4 = &match;
  
   9120                             {
  
   9121                                 System.Parsing.Match match(false);
  
   9122                                 System.Parsing.Match* parentMatch5 = &match;
  
   9123                                 {
  
   9124                                     System.Parsing.Match match(false);
  
   9125                                     System.Parsing.Match* parentMatch6 = &match;
  
   9126                                     {
  
   9127                                         System.Parsing.Match match(false);
  
   9128                                         System.Parsing.Match* parentMatch7 = &match;
  
   9129                                         {
  
   9130                                             System.Parsing.Match match(true);
  
   9131                                             for (int i : s39)
  
   9132                                             {
  
   9133                                                 if (*lexer == i)
  
   9134                                                 {
  
   9135                                                     auto incResult0 = ++lexer;
  
   9136                                                     if (incResult0.Error())
  
   9137                                                     {
  
   9138                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   9139                                                     }
  
   9140                                                 }
  
   9141                                                 else
  
   9142                                                 {
  
   9143                                                     match.hit = false;
  
   9144                                                     break;
  
   9145                                                 }
  
   9146                                             }
  
   9147                                             *parentMatch7 = match;
  
   9148                                         }
  
   9149                                         if (match.hit)
  
   9150                                         {
  
   9151                                             System.Parsing.Match match(false);
  
   9152                                             System.Parsing.Match* parentMatch8 = &match;
  
   9153                                             {
  
   9154                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   9155                                                 if (matchResult.Error())
  
   9156                                                 {
  
   9157                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9158                                                 }
  
   9159                                                 System.Parsing.Match match = matchResult.Value();
  
   9160                                                 s0.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9161                                                 *parentMatch8 = match;
  
   9162                                             }
  
   9163                                             *parentMatch7 = match;
  
   9164                                         }
  
   9165                                         *parentMatch6 = match;
  
   9166                                     }
  
   9167                                     if (match.hit)
  
   9168                                     {
  
   9169                                         System.Parsing.Match match(false);
  
   9170                                         System.Parsing.Match* parentMatch9 = &match;
  
   9171                                         {
  
   9172                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   9173                                             if (matchResult.Error())
  
   9174                                             {
  
   9175                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9176                                             }
  
   9177                                             System.Parsing.Match match = matchResult.Value();
  
   9178                                             entityName.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   9179                                             *parentMatch9 = match;
  
   9180                                         }
  
   9181                                         *parentMatch6 = match;
  
   9182                                     }
  
   9183                                     *parentMatch5 = match;
  
   9184                                 }
  
   9185                                 if (match.hit)
  
   9186                                 {
  
   9187                                     System.Parsing.Match match(false);
  
   9188                                     System.Parsing.Match* parentMatch10 = &match;
  
   9189                                     {
  
   9190                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   9191                                         if (matchResult.Error())
  
   9192                                         {
  
   9193                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9194                                         }
  
   9195                                         System.Parsing.Match match = matchResult.Value();
  
   9196                                         s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9197                                         *parentMatch10 = match;
  
   9198                                     }
  
   9199                                     *parentMatch5 = match;
  
   9200                                 }
  
   9201                                 *parentMatch4 = match;
  
   9202                             }
  
   9203                             if (match.hit)
  
   9204                             {
  
   9205                                 System.Parsing.Match match(false);
  
   9206                                 System.Parsing.Match* parentMatch11 = &match;
  
   9207                                 {
  
   9208                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EntityDef(lexer, processor);
  
   9209                                     if (matchResult.Error())
  
   9210                                     {
  
   9211                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9212                                     }
  
   9213                                     System.Parsing.Match match = matchResult.Value();
  
   9214                                     entityValue.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9215                                     *parentMatch11 = match;
  
   9216                                 }
  
   9217                                 *parentMatch4 = match;
  
   9218                             }
  
   9219                             *parentMatch3 = match;
  
   9220                         }
  
   9221                         if (match.hit)
  
   9222                         {
  
   9223                             System.Parsing.Match match(false);
  
   9224                             System.Parsing.Match* parentMatch12 = &match;
  
   9225                             {
  
   9226                                 System.Parsing.Match match(true);
  
   9227                                 long save = lexer.GetPos();
  
   9228                                 System.Parsing.Match* parentMatch13 = &match;
  
   9229                                 {
  
   9230                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   9231                                     if (matchResult.Error())
  
   9232                                     {
  
   9233                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9234                                     }
  
   9235                                     System.Parsing.Match match = matchResult.Value();
  
   9236                                     s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9237                                     if (match.hit)
  
   9238                                     {
  
   9239                                         *parentMatch13 = match;
  
   9240                                     }
  
   9241                                     else
  
   9242                                     {
  
   9243                                         lexer.SetPos(save);
  
   9244                                     }
  
   9245                                 }
  
   9246                                 *parentMatch12 = match;
  
   9247                             }
  
   9248                             *parentMatch3 = match;
  
   9249                         }
  
   9250                         *parentMatch2 = match;
  
   9251                     }
  
   9252                     if (match.hit)
  
   9253                     {
  
   9254                         System.Parsing.Match match(false);
  
   9255                         System.Parsing.Match* parentMatch14 = &match;
  
   9256                         {
  
   9257                             System.Parsing.Match match(false);
  
   9258                             if (*lexer == 62)
  
   9259                             {
  
   9260                                 auto incResult1 = ++lexer;
  
   9261                                 if (incResult1.Error())
  
   9262                                 {
  
   9263                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   9264                                 }
  
   9265                                 match.hit = true;
  
   9266                             }
  
   9267                             *parentMatch14 = match;
  
   9268                         }
  
   9269                         *parentMatch2 = match;
  
   9270                     }
  
   9271                     *parentMatch1 = match;
  
   9272                 }
  
   9273                 if (match.hit)
  
   9274                 {
  
   9275                     #if (DEBUG)
  
   9276                         if (parser_debug_write_to_log)
  
   9277                         {
  
   9278                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"GEDecl");
  
   9279                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9280                         }
  
   9281                     #endif
  
   9282                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   9283                 }
  
   9284                 *parentMatch0 = match;
  
   9285             }
  
   9286             #if (DEBUG)
  
   9287             if (parser_debug_write_to_log)
  
   9288             {
  
   9289                 if (match.hit)
  
   9290                 {
  
   9291                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"GEDecl");
  
   9292                     if (result.Error())
  
   9293                     {
  
   9294                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9295                     }
  
   9296                 }
  
   9297                 else
  
   9298                 {
  
   9299                     auto result = System.Lex.WriteFailureToLog(lexer, u"GEDecl");
  
   9300                     if (result.Error())
  
   9301                     {
  
   9302                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9303                     }
  
   9304                 }
  
   9305             }
  
   9306             #endif
  
   9307             if (!match.hit)
  
   9308             {
  
   9309                 match.value = null;
  
   9310             }
  
   9311             return System.Result<System.Parsing.Match>(match);
  
   9312         }
  
   9313         public static System.Result<System.Parsing.Match> PEDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   9314         {
  
   9315             #if (DEBUG)
  
   9316             long parser_debug_match_pos = 0;
  
   9317             bool parser_debug_write_to_log = lexer.Log() != null;
  
   9318             if (parser_debug_write_to_log)
  
   9319             {
  
   9320                 parser_debug_match_pos = lexer.GetPos();
  
   9321                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PEDecl");
  
   9322                 if (result.Error())
  
   9323                 {
  
   9324                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9325                 }
  
   9326             }
  
   9327             #endif
  
   9328             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475953);
  
   9329             System.UniquePtr<System.Parsing.Value<bool>> s0;
  
   9330             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
   9331             System.UniquePtr<System.Parsing.Value<ustring>> peName;
  
   9332             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
   9333             System.UniquePtr<System.Parsing.Value<bool>> peValue;
  
   9334             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
   9335             System.Parsing.Match match(false);
  
   9336             System.Parsing.Match* parentMatch0 = &match;
  
   9337             {
  
   9338                 long pos = lexer.GetPos();
  
   9339                 System.Parsing.Match match(false);
  
   9340                 System.Parsing.Match* parentMatch1 = &match;
  
   9341                 {
  
   9342                     System.Parsing.Match match(false);
  
   9343                     System.Parsing.Match* parentMatch2 = &match;
  
   9344                     {
  
   9345                         System.Parsing.Match match(false);
  
   9346                         System.Parsing.Match* parentMatch3 = &match;
  
   9347                         {
  
   9348                             System.Parsing.Match match(false);
  
   9349                             System.Parsing.Match* parentMatch4 = &match;
  
   9350                             {
  
   9351                                 System.Parsing.Match match(false);
  
   9352                                 System.Parsing.Match* parentMatch5 = &match;
  
   9353                                 {
  
   9354                                     System.Parsing.Match match(false);
  
   9355                                     System.Parsing.Match* parentMatch6 = &match;
  
   9356                                     {
  
   9357                                         System.Parsing.Match match(false);
  
   9358                                         System.Parsing.Match* parentMatch7 = &match;
  
   9359                                         {
  
   9360                                             System.Parsing.Match match(false);
  
   9361                                             System.Parsing.Match* parentMatch8 = &match;
  
   9362                                             {
  
   9363                                                 System.Parsing.Match match(false);
  
   9364                                                 System.Parsing.Match* parentMatch9 = &match;
  
   9365                                                 {
  
   9366                                                     System.Parsing.Match match(true);
  
   9367                                                     for (int i : s40)
  
   9368                                                     {
  
   9369                                                         if (*lexer == i)
  
   9370                                                         {
  
   9371                                                             auto incResult0 = ++lexer;
  
   9372                                                             if (incResult0.Error())
  
   9373                                                             {
  
   9374                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   9375                                                             }
  
   9376                                                         }
  
   9377                                                         else
  
   9378                                                         {
  
   9379                                                             match.hit = false;
  
   9380                                                             break;
  
   9381                                                         }
  
   9382                                                     }
  
   9383                                                     *parentMatch9 = match;
  
   9384                                                 }
  
   9385                                                 if (match.hit)
  
   9386                                                 {
  
   9387                                                     System.Parsing.Match match(false);
  
   9388                                                     System.Parsing.Match* parentMatch10 = &match;
  
   9389                                                     {
  
   9390                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   9391                                                         if (matchResult.Error())
  
   9392                                                         {
  
   9393                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9394                                                         }
  
   9395                                                         System.Parsing.Match match = matchResult.Value();
  
   9396                                                         s0.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9397                                                         *parentMatch10 = match;
  
   9398                                                     }
  
   9399                                                     *parentMatch9 = match;
  
   9400                                                 }
  
   9401                                                 *parentMatch8 = match;
  
   9402                                             }
  
   9403                                             if (match.hit)
  
   9404                                             {
  
   9405                                                 System.Parsing.Match match(false);
  
   9406                                                 System.Parsing.Match* parentMatch11 = &match;
  
   9407                                                 {
  
   9408                                                     System.Parsing.Match match(false);
  
   9409                                                     if (*lexer == 37)
  
   9410                                                     {
  
   9411                                                         auto incResult1 = ++lexer;
  
   9412                                                         if (incResult1.Error())
  
   9413                                                         {
  
   9414                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   9415                                                         }
  
   9416                                                         match.hit = true;
  
   9417                                                     }
  
   9418                                                     *parentMatch11 = match;
  
   9419                                                 }
  
   9420                                                 *parentMatch8 = match;
  
   9421                                             }
  
   9422                                             *parentMatch7 = match;
  
   9423                                         }
  
   9424                                         if (match.hit)
  
   9425                                         {
  
   9426                                             System.Parsing.Match match(false);
  
   9427                                             System.Parsing.Match* parentMatch12 = &match;
  
   9428                                             {
  
   9429                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   9430                                                 if (matchResult.Error())
  
   9431                                                 {
  
   9432                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9433                                                 }
  
   9434                                                 System.Parsing.Match match = matchResult.Value();
  
   9435                                                 s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9436                                                 *parentMatch12 = match;
  
   9437                                             }
  
   9438                                             *parentMatch7 = match;
  
   9439                                         }
  
   9440                                         *parentMatch6 = match;
  
   9441                                     }
  
   9442                                     if (match.hit)
  
   9443                                     {
  
   9444                                         System.Parsing.Match match(false);
  
   9445                                         System.Parsing.Match* parentMatch13 = &match;
  
   9446                                         {
  
   9447                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
   9448                                             if (matchResult.Error())
  
   9449                                             {
  
   9450                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9451                                             }
  
   9452                                             System.Parsing.Match match = matchResult.Value();
  
   9453                                             peName.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
   9454                                             *parentMatch13 = match;
  
   9455                                         }
  
   9456                                         *parentMatch6 = match;
  
   9457                                     }
  
   9458                                     *parentMatch5 = match;
  
   9459                                 }
  
   9460                                 if (match.hit)
  
   9461                                 {
  
   9462                                     System.Parsing.Match match(false);
  
   9463                                     System.Parsing.Match* parentMatch14 = &match;
  
   9464                                     {
  
   9465                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   9466                                         if (matchResult.Error())
  
   9467                                         {
  
   9468                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9469                                         }
  
   9470                                         System.Parsing.Match match = matchResult.Value();
  
   9471                                         s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9472                                         *parentMatch14 = match;
  
   9473                                     }
  
   9474                                     *parentMatch5 = match;
  
   9475                                 }
  
   9476                                 *parentMatch4 = match;
  
   9477                             }
  
   9478                             if (match.hit)
  
   9479                             {
  
   9480                                 System.Parsing.Match match(false);
  
   9481                                 System.Parsing.Match* parentMatch15 = &match;
  
   9482                                 {
  
   9483                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PEDef(lexer, processor);
  
   9484                                     if (matchResult.Error())
  
   9485                                     {
  
   9486                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9487                                     }
  
   9488                                     System.Parsing.Match match = matchResult.Value();
  
   9489                                     peValue.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9490                                     *parentMatch15 = match;
  
   9491                                 }
  
   9492                                 *parentMatch4 = match;
  
   9493                             }
  
   9494                             *parentMatch3 = match;
  
   9495                         }
  
   9496                         if (match.hit)
  
   9497                         {
  
   9498                             System.Parsing.Match match(false);
  
   9499                             System.Parsing.Match* parentMatch16 = &match;
  
   9500                             {
  
   9501                                 System.Parsing.Match match(true);
  
   9502                                 long save = lexer.GetPos();
  
   9503                                 System.Parsing.Match* parentMatch17 = &match;
  
   9504                                 {
  
   9505                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
   9506                                     if (matchResult.Error())
  
   9507                                     {
  
   9508                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9509                                     }
  
   9510                                     System.Parsing.Match match = matchResult.Value();
  
   9511                                     s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9512                                     if (match.hit)
  
   9513                                     {
  
   9514                                         *parentMatch17 = match;
  
   9515                                     }
  
   9516                                     else
  
   9517                                     {
  
   9518                                         lexer.SetPos(save);
  
   9519                                     }
  
   9520                                 }
  
   9521                                 *parentMatch16 = match;
  
   9522                             }
  
   9523                             *parentMatch3 = match;
  
   9524                         }
  
   9525                         *parentMatch2 = match;
  
   9526                     }
  
   9527                     if (match.hit)
  
   9528                     {
  
   9529                         System.Parsing.Match match(false);
  
   9530                         System.Parsing.Match* parentMatch18 = &match;
  
   9531                         {
  
   9532                             System.Parsing.Match match(false);
  
   9533                             if (*lexer == 62)
  
   9534                             {
  
   9535                                 auto incResult2 = ++lexer;
  
   9536                                 if (incResult2.Error())
  
   9537                                 {
  
   9538                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   9539                                 }
  
   9540                                 match.hit = true;
  
   9541                             }
  
   9542                             *parentMatch18 = match;
  
   9543                         }
  
   9544                         *parentMatch2 = match;
  
   9545                     }
  
   9546                     *parentMatch1 = match;
  
   9547                 }
  
   9548                 if (match.hit)
  
   9549                 {
  
   9550                     #if (DEBUG)
  
   9551                         if (parser_debug_write_to_log)
  
   9552                         {
  
   9553                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PEDecl");
  
   9554                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9555                         }
  
   9556                     #endif
  
   9557                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   9558                 }
  
   9559                 *parentMatch0 = match;
  
   9560             }
  
   9561             #if (DEBUG)
  
   9562             if (parser_debug_write_to_log)
  
   9563             {
  
   9564                 if (match.hit)
  
   9565                 {
  
   9566                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PEDecl");
  
   9567                     if (result.Error())
  
   9568                     {
  
   9569                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9570                     }
  
   9571                 }
  
   9572                 else
  
   9573                 {
  
   9574                     auto result = System.Lex.WriteFailureToLog(lexer, u"PEDecl");
  
   9575                     if (result.Error())
  
   9576                     {
  
   9577                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9578                     }
  
   9579                 }
  
   9580             }
  
   9581             #endif
  
   9582             if (!match.hit)
  
   9583             {
  
   9584                 match.value = null;
  
   9585             }
  
   9586             return System.Result<System.Parsing.Match>(match);
  
   9587         }
  
   9588         public static System.Result<System.Parsing.Match> EntityDef(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   9589         {
  
   9590             #if (DEBUG)
  
   9591             long parser_debug_match_pos = 0;
  
   9592             bool parser_debug_write_to_log = lexer.Log() != null;
  
   9593             if (parser_debug_write_to_log)
  
   9594             {
  
   9595                 parser_debug_match_pos = lexer.GetPos();
  
   9596                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EntityDef");
  
   9597                 if (result.Error())
  
   9598                 {
  
   9599                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9600                 }
  
   9601             }
  
   9602             #endif
  
   9603             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475954);
  
   9604             System.UniquePtr<System.Parsing.Value<bool>> entityValue;
  
   9605             System.UniquePtr<System.Parsing.Value<bool>> extID;
  
   9606             System.UniquePtr<System.Parsing.Value<bool>> notation;
  
   9607             System.Parsing.Match match(false);
  
   9608             System.Parsing.Match* parentMatch0 = &match;
  
   9609             {
  
   9610                 long pos = lexer.GetPos();
  
   9611                 System.Parsing.Match match(false);
  
   9612                 System.Parsing.Match* parentMatch1 = &match;
  
   9613                 {
  
   9614                     System.Parsing.Match match(false);
  
   9615                     System.Parsing.Match* parentMatch2 = &match;
  
   9616                     {
  
   9617                         long save = lexer.GetPos();
  
   9618                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EntityValue(lexer, processor);
  
   9619                         if (matchResult.Error())
  
   9620                         {
  
   9621                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9622                         }
  
   9623                         System.Parsing.Match match = matchResult.Value();
  
   9624                         entityValue.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9625                         *parentMatch2 = match;
  
   9626                         if (!match.hit)
  
   9627                         {
  
   9628                             System.Parsing.Match match(false);
  
   9629                             System.Parsing.Match* parentMatch3 = &match;
  
   9630                             lexer.SetPos(save);
  
   9631                             {
  
   9632                                 System.Parsing.Match match(false);
  
   9633                                 System.Parsing.Match* parentMatch4 = &match;
  
   9634                                 {
  
   9635                                     System.Parsing.Match match(false);
  
   9636                                     System.Parsing.Match* parentMatch5 = &match;
  
   9637                                     {
  
   9638                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.ExternalID(lexer);
  
   9639                                         if (matchResult.Error())
  
   9640                                         {
  
   9641                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9642                                         }
  
   9643                                         System.Parsing.Match match = matchResult.Value();
  
   9644                                         extID.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9645                                         *parentMatch5 = match;
  
   9646                                     }
  
   9647                                     if (match.hit)
  
   9648                                     {
  
   9649                                         System.Parsing.Match match(false);
  
   9650                                         System.Parsing.Match* parentMatch6 = &match;
  
   9651                                         {
  
   9652                                             System.Parsing.Match match(true);
  
   9653                                             long save = lexer.GetPos();
  
   9654                                             System.Parsing.Match* parentMatch7 = &match;
  
   9655                                             {
  
   9656                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.NDataDecl(lexer);
  
   9657                                                 if (matchResult.Error())
  
   9658                                                 {
  
   9659                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9660                                                 }
  
   9661                                                 System.Parsing.Match match = matchResult.Value();
  
   9662                                                 notation.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9663                                                 if (match.hit)
  
   9664                                                 {
  
   9665                                                     *parentMatch7 = match;
  
   9666                                                 }
  
   9667                                                 else
  
   9668                                                 {
  
   9669                                                     lexer.SetPos(save);
  
   9670                                                 }
  
   9671                                             }
  
   9672                                             *parentMatch6 = match;
  
   9673                                         }
  
   9674                                         *parentMatch5 = match;
  
   9675                                     }
  
   9676                                     *parentMatch4 = match;
  
   9677                                 }
  
   9678                                 *parentMatch3 = match;
  
   9679                             }
  
   9680                             *parentMatch2 = match;
  
   9681                         }
  
   9682                     }
  
   9683                     *parentMatch1 = match;
  
   9684                 }
  
   9685                 if (match.hit)
  
   9686                 {
  
   9687                     #if (DEBUG)
  
   9688                         if (parser_debug_write_to_log)
  
   9689                         {
  
   9690                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityDef");
  
   9691                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9692                         }
  
   9693                     #endif
  
   9694                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   9695                 }
  
   9696                 *parentMatch0 = match;
  
   9697             }
  
   9698             #if (DEBUG)
  
   9699             if (parser_debug_write_to_log)
  
   9700             {
  
   9701                 if (match.hit)
  
   9702                 {
  
   9703                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityDef");
  
   9704                     if (result.Error())
  
   9705                     {
  
   9706                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9707                     }
  
   9708                 }
  
   9709                 else
  
   9710                 {
  
   9711                     auto result = System.Lex.WriteFailureToLog(lexer, u"EntityDef");
  
   9712                     if (result.Error())
  
   9713                     {
  
   9714                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9715                     }
  
   9716                 }
  
   9717             }
  
   9718             #endif
  
   9719             if (!match.hit)
  
   9720             {
  
   9721                 match.value = null;
  
   9722             }
  
   9723             return System.Result<System.Parsing.Match>(match);
  
   9724         }
  
   9725         public static System.Result<System.Parsing.Match> PEDef(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   9726         {
  
   9727             #if (DEBUG)
  
   9728             long parser_debug_match_pos = 0;
  
   9729             bool parser_debug_write_to_log = lexer.Log() != null;
  
   9730             if (parser_debug_write_to_log)
  
   9731             {
  
   9732                 parser_debug_match_pos = lexer.GetPos();
  
   9733                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PEDef");
  
   9734                 if (result.Error())
  
   9735                 {
  
   9736                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9737                 }
  
   9738             }
  
   9739             #endif
  
   9740             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475955);
  
   9741             System.UniquePtr<System.Parsing.Value<bool>> entityValue;
  
   9742             System.UniquePtr<System.Parsing.Value<bool>> extID;
  
   9743             System.Parsing.Match match(false);
  
   9744             System.Parsing.Match* parentMatch0 = &match;
  
   9745             {
  
   9746                 long pos = lexer.GetPos();
  
   9747                 System.Parsing.Match match(false);
  
   9748                 System.Parsing.Match* parentMatch1 = &match;
  
   9749                 {
  
   9750                     System.Parsing.Match match(false);
  
   9751                     System.Parsing.Match* parentMatch2 = &match;
  
   9752                     {
  
   9753                         long save = lexer.GetPos();
  
   9754                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EntityValue(lexer, processor);
  
   9755                         if (matchResult.Error())
  
   9756                         {
  
   9757                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9758                         }
  
   9759                         System.Parsing.Match match = matchResult.Value();
  
   9760                         entityValue.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9761                         *parentMatch2 = match;
  
   9762                         if (!match.hit)
  
   9763                         {
  
   9764                             System.Parsing.Match match(false);
  
   9765                             System.Parsing.Match* parentMatch3 = &match;
  
   9766                             lexer.SetPos(save);
  
   9767                             {
  
   9768                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.ExternalID(lexer);
  
   9769                                 if (matchResult.Error())
  
   9770                                 {
  
   9771                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9772                                 }
  
   9773                                 System.Parsing.Match match = matchResult.Value();
  
   9774                                 extID.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9775                                 *parentMatch3 = match;
  
   9776                             }
  
   9777                             *parentMatch2 = match;
  
   9778                         }
  
   9779                     }
  
   9780                     *parentMatch1 = match;
  
   9781                 }
  
   9782                 if (match.hit)
  
   9783                 {
  
   9784                     #if (DEBUG)
  
   9785                         if (parser_debug_write_to_log)
  
   9786                         {
  
   9787                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PEDef");
  
   9788                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9789                         }
  
   9790                     #endif
  
   9791                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
   9792                 }
  
   9793                 *parentMatch0 = match;
  
   9794             }
  
   9795             #if (DEBUG)
  
   9796             if (parser_debug_write_to_log)
  
   9797             {
  
   9798                 if (match.hit)
  
   9799                 {
  
   9800                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PEDef");
  
   9801                     if (result.Error())
  
   9802                     {
  
   9803                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9804                     }
  
   9805                 }
  
   9806                 else
  
   9807                 {
  
   9808                     auto result = System.Lex.WriteFailureToLog(lexer, u"PEDef");
  
   9809                     if (result.Error())
  
   9810                     {
  
   9811                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9812                     }
  
   9813                 }
  
   9814             }
  
   9815             #endif
  
   9816             if (!match.hit)
  
   9817             {
  
   9818                 match.value = null;
  
   9819             }
  
   9820             return System.Result<System.Parsing.Match>(match);
  
   9821         }
  
   9822         public static System.Result<System.Parsing.Match> EntityValue(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
   9823         {
  
   9824             #if (DEBUG)
  
   9825             long parser_debug_match_pos = 0;
  
   9826             bool parser_debug_write_to_log = lexer.Log() != null;
  
   9827             if (parser_debug_write_to_log)
  
   9828             {
  
   9829                 parser_debug_match_pos = lexer.GetPos();
  
   9830                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EntityValue");
  
   9831                 if (result.Error())
  
   9832                 {
  
   9833                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
   9834                 }
  
   9835             }
  
   9836             #endif
  
   9837             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475956);
  
   9838             System.UniquePtr<System.Parsing.Value<bool>> pr1;
  
   9839             System.UniquePtr<System.Parsing.Value<bool>> ref1;
  
   9840             System.UniquePtr<System.Parsing.Value<bool>> pr2;
  
   9841             System.UniquePtr<System.Parsing.Value<bool>> ref2;
  
   9842             System.Parsing.Match match(false);
  
   9843             System.Parsing.Match* parentMatch0 = &match;
  
   9844             {
  
   9845                 long pos = lexer.GetPos();
  
   9846                 System.Parsing.Match match(false);
  
   9847                 System.Parsing.Match* parentMatch1 = &match;
  
   9848                 {
  
   9849                     System.Parsing.Match match(false);
  
   9850                     System.Parsing.Match* parentMatch2 = &match;
  
   9851                     {
  
   9852                         long save = lexer.GetPos();
  
   9853                         System.Parsing.Match match(false);
  
   9854                         System.Parsing.Match* parentMatch3 = &match;
  
   9855                         {
  
   9856                             System.Parsing.Match match(false);
  
   9857                             System.Parsing.Match* parentMatch4 = &match;
  
   9858                             {
  
   9859                                 System.Parsing.Match match(false);
  
   9860                                 if (*lexer == 34)
  
   9861                                 {
  
   9862                                     auto incResult0 = ++lexer;
  
   9863                                     if (incResult0.Error())
  
   9864                                     {
  
   9865                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
   9866                                     }
  
   9867                                     match.hit = true;
  
   9868                                 }
  
   9869                                 *parentMatch4 = match;
  
   9870                             }
  
   9871                             if (match.hit)
  
   9872                             {
  
   9873                                 System.Parsing.Match match(false);
  
   9874                                 System.Parsing.Match* parentMatch5 = &match;
  
   9875                                 {
  
   9876                                     System.Parsing.Match match(true);
  
   9877                                     System.Parsing.Match* parentMatch6 = &match;
  
   9878                                     {
  
   9879                                         while (true)
  
   9880                                         {
  
   9881                                             long save = lexer.GetPos();
  
   9882                                             {
  
   9883                                                 System.Parsing.Match match(false);
  
   9884                                                 System.Parsing.Match* parentMatch7 = &match;
  
   9885                                                 {
  
   9886                                                     System.Parsing.Match match(false);
  
   9887                                                     System.Parsing.Match* parentMatch8 = &match;
  
   9888                                                     {
  
   9889                                                         long save = lexer.GetPos();
  
   9890                                                         System.Parsing.Match match(false);
  
   9891                                                         System.Parsing.Match* parentMatch9 = &match;
  
   9892                                                         {
  
   9893                                                             long save = lexer.GetPos();
  
   9894                                                             System.Parsing.Match match(lexer.Pos() != lexer.End());
  
   9895                                                             for (const System.Parsing.Range& range : s41)
  
   9896                                                             {
  
   9897                                                                 if (*lexer >= range.first && *lexer <= range.last)
  
   9898                                                                 {
  
   9899                                                                     match.hit = false;
  
   9900                                                                     break;
  
   9901                                                                 }
  
   9902                                                             }
  
   9903                                                             if (match.hit)
  
   9904                                                             {
  
   9905                                                                 auto incResult1 = ++lexer;
  
   9906                                                                 if (incResult1.Error())
  
   9907                                                                 {
  
   9908                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
   9909                                                                 }
  
   9910                                                             }
  
   9911                                                             *parentMatch9 = match;
  
   9912                                                             if (!match.hit)
  
   9913                                                             {
  
   9914                                                                 System.Parsing.Match match(false);
  
   9915                                                                 System.Parsing.Match* parentMatch10 = &match;
  
   9916                                                                 lexer.SetPos(save);
  
   9917                                                                 {
  
   9918                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PEReference(lexer, processor);
  
   9919                                                                     if (matchResult.Error())
  
   9920                                                                     {
  
   9921                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9922                                                                     }
  
   9923                                                                     System.Parsing.Match match = matchResult.Value();
  
   9924                                                                     pr1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9925                                                                     *parentMatch10 = match;
  
   9926                                                                 }
  
   9927                                                                 *parentMatch9 = match;
  
   9928                                                             }
  
   9929                                                         }
  
   9930                                                         *parentMatch8 = match;
  
   9931                                                         if (!match.hit)
  
   9932                                                         {
  
   9933                                                             System.Parsing.Match match(false);
  
   9934                                                             System.Parsing.Match* parentMatch11 = &match;
  
   9935                                                             lexer.SetPos(save);
  
   9936                                                             {
  
   9937                                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Reference(lexer, processor);
  
   9938                                                                 if (matchResult.Error())
  
   9939                                                                 {
  
   9940                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
   9941                                                                 }
  
   9942                                                                 System.Parsing.Match match = matchResult.Value();
  
   9943                                                                 ref1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
   9944                                                                 *parentMatch11 = match;
  
   9945                                                             }
  
   9946                                                             *parentMatch8 = match;
  
   9947                                                         }
  
   9948                                                     }
  
   9949                                                     *parentMatch7 = match;
  
   9950                                                 }
  
   9951                                                 if (match.hit)
  
   9952                                                 {
  
   9953                                                     *parentMatch6 = match;
  
   9954                                                 }
  
   9955                                                 else
  
   9956                                                 {
  
   9957                                                     lexer.SetPos(save);
  
   9958                                                     break;
  
   9959                                                 }
  
   9960                                             }
  
   9961                                         }
  
   9962                                     }
  
   9963                                     *parentMatch5 = match;
  
   9964                                 }
  
   9965                                 *parentMatch4 = match;
  
   9966                             }
  
   9967                             *parentMatch3 = match;
  
   9968                         }
  
   9969                         if (match.hit)
  
   9970                         {
  
   9971                             System.Parsing.Match match(false);
  
   9972                             System.Parsing.Match* parentMatch12 = &match;
  
   9973                             {
  
   9974                                 System.Parsing.Match match(false);
  
   9975                                 if (*lexer == 34)
  
   9976                                 {
  
   9977                                     auto incResult2 = ++lexer;
  
   9978                                     if (incResult2.Error())
  
   9979                                     {
  
   9980                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
   9981                                     }
  
   9982                                     match.hit = true;
  
   9983                                 }
  
   9984                                 *parentMatch12 = match;
  
   9985                             }
  
   9986                             *parentMatch3 = match;
  
   9987                         }
  
   9988                         *parentMatch2 = match;
  
   9989                         if (!match.hit)
  
   9990                         {
  
   9991                             System.Parsing.Match match(false);
  
   9992                             System.Parsing.Match* parentMatch13 = &match;
  
   9993                             lexer.SetPos(save);
  
   9994                             {
  
   9995                                 System.Parsing.Match match(false);
  
   9996                                 System.Parsing.Match* parentMatch14 = &match;
  
   9997                                 {
  
   9998                                     System.Parsing.Match match(false);
  
   9999                                     System.Parsing.Match* parentMatch15 = &match;
  
  10000                                     {
  
  10001                                         System.Parsing.Match match(false);
  
  10002                                         if (*lexer == 39)
  
  10003                                         {
  
  10004                                             auto incResult3 = ++lexer;
  
  10005                                             if (incResult3.Error())
  
  10006                                             {
  
  10007                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
  10008                                             }
  
  10009                                             match.hit = true;
  
  10010                                         }
  
  10011                                         *parentMatch15 = match;
  
  10012                                     }
  
  10013                                     if (match.hit)
  
  10014                                     {
  
  10015                                         System.Parsing.Match match(false);
  
  10016                                         System.Parsing.Match* parentMatch16 = &match;
  
  10017                                         {
  
  10018                                             System.Parsing.Match match(true);
  
  10019                                             System.Parsing.Match* parentMatch17 = &match;
  
  10020                                             {
  
  10021                                                 while (true)
  
  10022                                                 {
  
  10023                                                     long save = lexer.GetPos();
  
  10024                                                     {
  
  10025                                                         System.Parsing.Match match(false);
  
  10026                                                         System.Parsing.Match* parentMatch18 = &match;
  
  10027                                                         {
  
  10028                                                             System.Parsing.Match match(false);
  
  10029                                                             System.Parsing.Match* parentMatch19 = &match;
  
  10030                                                             {
  
  10031                                                                 long save = lexer.GetPos();
  
  10032                                                                 System.Parsing.Match match(false);
  
  10033                                                                 System.Parsing.Match* parentMatch20 = &match;
  
  10034                                                                 {
  
  10035                                                                     long save = lexer.GetPos();
  
  10036                                                                     System.Parsing.Match match(lexer.Pos() != lexer.End());
  
  10037                                                                     for (const System.Parsing.Range& range : s42)
  
  10038                                                                     {
  
  10039                                                                         if (*lexer >= range.first && *lexer <= range.last)
  
  10040                                                                         {
  
  10041                                                                             match.hit = false;
  
  10042                                                                             break;
  
  10043                                                                         }
  
  10044                                                                     }
  
  10045                                                                     if (match.hit)
  
  10046                                                                     {
  
  10047                                                                         auto incResult4 = ++lexer;
  
  10048                                                                         if (incResult4.Error())
  
  10049                                                                         {
  
  10050                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult4.GetErrorId()));
  
  10051                                                                         }
  
  10052                                                                     }
  
  10053                                                                     *parentMatch20 = match;
  
  10054                                                                     if (!match.hit)
  
  10055                                                                     {
  
  10056                                                                         System.Parsing.Match match(false);
  
  10057                                                                         System.Parsing.Match* parentMatch21 = &match;
  
  10058                                                                         lexer.SetPos(save);
  
  10059                                                                         {
  
  10060                                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PEReference(lexer, processor);
  
  10061                                                                             if (matchResult.Error())
  
  10062                                                                             {
  
  10063                                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10064                                                                             }
  
  10065                                                                             System.Parsing.Match match = matchResult.Value();
  
  10066                                                                             pr2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10067                                                                             *parentMatch21 = match;
  
  10068                                                                         }
  
  10069                                                                         *parentMatch20 = match;
  
  10070                                                                     }
  
  10071                                                                 }
  
  10072                                                                 *parentMatch19 = match;
  
  10073                                                                 if (!match.hit)
  
  10074                                                                 {
  
  10075                                                                     System.Parsing.Match match(false);
  
  10076                                                                     System.Parsing.Match* parentMatch22 = &match;
  
  10077                                                                     lexer.SetPos(save);
  
  10078                                                                     {
  
  10079                                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Reference(lexer, processor);
  
  10080                                                                         if (matchResult.Error())
  
  10081                                                                         {
  
  10082                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10083                                                                         }
  
  10084                                                                         System.Parsing.Match match = matchResult.Value();
  
  10085                                                                         ref2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10086                                                                         *parentMatch22 = match;
  
  10087                                                                     }
  
  10088                                                                     *parentMatch19 = match;
  
  10089                                                                 }
  
  10090                                                             }
  
  10091                                                             *parentMatch18 = match;
  
  10092                                                         }
  
  10093                                                         if (match.hit)
  
  10094                                                         {
  
  10095                                                             *parentMatch17 = match;
  
  10096                                                         }
  
  10097                                                         else
  
  10098                                                         {
  
  10099                                                             lexer.SetPos(save);
  
  10100                                                             break;
  
  10101                                                         }
  
  10102                                                     }
  
  10103                                                 }
  
  10104                                             }
  
  10105                                             *parentMatch16 = match;
  
  10106                                         }
  
  10107                                         *parentMatch15 = match;
  
  10108                                     }
  
  10109                                     *parentMatch14 = match;
  
  10110                                 }
  
  10111                                 if (match.hit)
  
  10112                                 {
  
  10113                                     System.Parsing.Match match(false);
  
  10114                                     System.Parsing.Match* parentMatch23 = &match;
  
  10115                                     {
  
  10116                                         System.Parsing.Match match(false);
  
  10117                                         if (*lexer == 39)
  
  10118                                         {
  
  10119                                             auto incResult5 = ++lexer;
  
  10120                                             if (incResult5.Error())
  
  10121                                             {
  
  10122                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult5.GetErrorId()));
  
  10123                                             }
  
  10124                                             match.hit = true;
  
  10125                                         }
  
  10126                                         *parentMatch23 = match;
  
  10127                                     }
  
  10128                                     *parentMatch14 = match;
  
  10129                                 }
  
  10130                                 *parentMatch13 = match;
  
  10131                             }
  
  10132                             *parentMatch2 = match;
  
  10133                         }
  
  10134                     }
  
  10135                     *parentMatch1 = match;
  
  10136                 }
  
  10137                 if (match.hit)
  
  10138                 {
  
  10139                     #if (DEBUG)
  
  10140                         if (parser_debug_write_to_log)
  
  10141                         {
  
  10142                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityValue");
  
  10143                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10144                         }
  
  10145                     #endif
  
  10146                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  10147                 }
  
  10148                 *parentMatch0 = match;
  
  10149             }
  
  10150             #if (DEBUG)
  
  10151             if (parser_debug_write_to_log)
  
  10152             {
  
  10153                 if (match.hit)
  
  10154                 {
  
  10155                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityValue");
  
  10156                     if (result.Error())
  
  10157                     {
  
  10158                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10159                     }
  
  10160                 }
  
  10161                 else
  
  10162                 {
  
  10163                     auto result = System.Lex.WriteFailureToLog(lexer, u"EntityValue");
  
  10164                     if (result.Error())
  
  10165                     {
  
  10166                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10167                     }
  
  10168                 }
  
  10169             }
  
  10170             #endif
  
  10171             if (!match.hit)
  
  10172             {
  
  10173                 match.value = null;
  
  10174             }
  
  10175             return System.Result<System.Parsing.Match>(match);
  
  10176         }
  
  10177         public static System.Result<System.Parsing.Match> NDataDecl(LexerT& lexer)
  
  10178         {
  
  10179             #if (DEBUG)
  
  10180             long parser_debug_match_pos = 0;
  
  10181             bool parser_debug_write_to_log = lexer.Log() != null;
  
  10182             if (parser_debug_write_to_log)
  
  10183             {
  
  10184                 parser_debug_match_pos = lexer.GetPos();
  
  10185                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"NDataDecl");
  
  10186                 if (result.Error())
  
  10187                 {
  
  10188                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10189                 }
  
  10190             }
  
  10191             #endif
  
  10192             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475957);
  
  10193             System.UniquePtr<System.Parsing.Value<bool>> s1;
  
  10194             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
  10195             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
  10196             System.Parsing.Match match(false);
  
  10197             System.Parsing.Match* parentMatch0 = &match;
  
  10198             {
  
  10199                 long pos = lexer.GetPos();
  
  10200                 System.Parsing.Match match(false);
  
  10201                 System.Parsing.Match* parentMatch1 = &match;
  
  10202                 {
  
  10203                     System.Parsing.Match match(false);
  
  10204                     System.Parsing.Match* parentMatch2 = &match;
  
  10205                     {
  
  10206                         System.Parsing.Match match(false);
  
  10207                         System.Parsing.Match* parentMatch3 = &match;
  
  10208                         {
  
  10209                             System.Parsing.Match match(false);
  
  10210                             System.Parsing.Match* parentMatch4 = &match;
  
  10211                             {
  
  10212                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10213                                 if (matchResult.Error())
  
  10214                                 {
  
  10215                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10216                                 }
  
  10217                                 System.Parsing.Match match = matchResult.Value();
  
  10218                                 s1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10219                                 *parentMatch4 = match;
  
  10220                             }
  
  10221                             if (match.hit)
  
  10222                             {
  
  10223                                 System.Parsing.Match match(false);
  
  10224                                 System.Parsing.Match* parentMatch5 = &match;
  
  10225                                 {
  
  10226                                     System.Parsing.Match match(true);
  
  10227                                     for (int i : s43)
  
  10228                                     {
  
  10229                                         if (*lexer == i)
  
  10230                                         {
  
  10231                                             auto incResult0 = ++lexer;
  
  10232                                             if (incResult0.Error())
  
  10233                                             {
  
  10234                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  10235                                             }
  
  10236                                         }
  
  10237                                         else
  
  10238                                         {
  
  10239                                             match.hit = false;
  
  10240                                             break;
  
  10241                                         }
  
  10242                                     }
  
  10243                                     *parentMatch5 = match;
  
  10244                                 }
  
  10245                                 *parentMatch4 = match;
  
  10246                             }
  
  10247                             *parentMatch3 = match;
  
  10248                         }
  
  10249                         if (match.hit)
  
  10250                         {
  
  10251                             System.Parsing.Match match(false);
  
  10252                             System.Parsing.Match* parentMatch6 = &match;
  
  10253                             {
  
  10254                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10255                                 if (matchResult.Error())
  
  10256                                 {
  
  10257                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10258                                 }
  
  10259                                 System.Parsing.Match match = matchResult.Value();
  
  10260                                 s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10261                                 *parentMatch6 = match;
  
  10262                             }
  
  10263                             *parentMatch3 = match;
  
  10264                         }
  
  10265                         *parentMatch2 = match;
  
  10266                     }
  
  10267                     if (match.hit)
  
  10268                     {
  
  10269                         System.Parsing.Match match(false);
  
  10270                         System.Parsing.Match* parentMatch7 = &match;
  
  10271                         {
  
  10272                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  10273                             if (matchResult.Error())
  
  10274                             {
  
  10275                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10276                             }
  
  10277                             System.Parsing.Match match = matchResult.Value();
  
  10278                             name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  10279                             *parentMatch7 = match;
  
  10280                         }
  
  10281                         *parentMatch2 = match;
  
  10282                     }
  
  10283                     *parentMatch1 = match;
  
  10284                 }
  
  10285                 if (match.hit)
  
  10286                 {
  
  10287                     #if (DEBUG)
  
  10288                         if (parser_debug_write_to_log)
  
  10289                         {
  
  10290                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NDataDecl");
  
  10291                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10292                         }
  
  10293                     #endif
  
  10294                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  10295                 }
  
  10296                 *parentMatch0 = match;
  
  10297             }
  
  10298             #if (DEBUG)
  
  10299             if (parser_debug_write_to_log)
  
  10300             {
  
  10301                 if (match.hit)
  
  10302                 {
  
  10303                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NDataDecl");
  
  10304                     if (result.Error())
  
  10305                     {
  
  10306                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10307                     }
  
  10308                 }
  
  10309                 else
  
  10310                 {
  
  10311                     auto result = System.Lex.WriteFailureToLog(lexer, u"NDataDecl");
  
  10312                     if (result.Error())
  
  10313                     {
  
  10314                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10315                     }
  
  10316                 }
  
  10317             }
  
  10318             #endif
  
  10319             if (!match.hit)
  
  10320             {
  
  10321                 match.value = null;
  
  10322             }
  
  10323             return System.Result<System.Parsing.Match>(match);
  
  10324         }
  
  10325         public static System.Result<System.Parsing.Match> PEReference(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  10326         {
  
  10327             #if (DEBUG)
  
  10328             long parser_debug_match_pos = 0;
  
  10329             bool parser_debug_write_to_log = lexer.Log() != null;
  
  10330             if (parser_debug_write_to_log)
  
  10331             {
  
  10332                 parser_debug_match_pos = lexer.GetPos();
  
  10333                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PEReference");
  
  10334                 if (result.Error())
  
  10335                 {
  
  10336                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10337                 }
  
  10338             }
  
  10339             #endif
  
  10340             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475958);
  
  10341             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
  10342             System.Parsing.Match match(false);
  
  10343             System.Parsing.Match* parentMatch0 = &match;
  
  10344             {
  
  10345                 long pos = lexer.GetPos();
  
  10346                 System.Parsing.Match match(false);
  
  10347                 System.Parsing.Match* parentMatch1 = &match;
  
  10348                 {
  
  10349                     System.Parsing.Match match(false);
  
  10350                     System.Parsing.Match* parentMatch2 = &match;
  
  10351                     {
  
  10352                         System.Parsing.Match match(false);
  
  10353                         System.Parsing.Match* parentMatch3 = &match;
  
  10354                         {
  
  10355                             System.Parsing.Match match(false);
  
  10356                             if (*lexer == 37)
  
  10357                             {
  
  10358                                 auto incResult0 = ++lexer;
  
  10359                                 if (incResult0.Error())
  
  10360                                 {
  
  10361                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  10362                                 }
  
  10363                                 match.hit = true;
  
  10364                             }
  
  10365                             *parentMatch3 = match;
  
  10366                         }
  
  10367                         if (match.hit)
  
  10368                         {
  
  10369                             System.Parsing.Match match(false);
  
  10370                             System.Parsing.Match* parentMatch4 = &match;
  
  10371                             {
  
  10372                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  10373                                 if (matchResult.Error())
  
  10374                                 {
  
  10375                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10376                                 }
  
  10377                                 System.Parsing.Match match = matchResult.Value();
  
  10378                                 name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  10379                                 *parentMatch4 = match;
  
  10380                             }
  
  10381                             *parentMatch3 = match;
  
  10382                         }
  
  10383                         *parentMatch2 = match;
  
  10384                     }
  
  10385                     if (match.hit)
  
  10386                     {
  
  10387                         System.Parsing.Match match(false);
  
  10388                         System.Parsing.Match* parentMatch5 = &match;
  
  10389                         {
  
  10390                             System.Parsing.Match match(false);
  
  10391                             if (*lexer == 59)
  
  10392                             {
  
  10393                                 auto incResult1 = ++lexer;
  
  10394                                 if (incResult1.Error())
  
  10395                                 {
  
  10396                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  10397                                 }
  
  10398                                 match.hit = true;
  
  10399                             }
  
  10400                             *parentMatch5 = match;
  
  10401                         }
  
  10402                         *parentMatch2 = match;
  
  10403                     }
  
  10404                     *parentMatch1 = match;
  
  10405                 }
  
  10406                 if (match.hit)
  
  10407                 {
  
  10408                     #if (DEBUG)
  
  10409                         if (parser_debug_write_to_log)
  
  10410                         {
  
  10411                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PEReference");
  
  10412                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10413                         }
  
  10414                     #endif
  
  10415                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  10416                 }
  
  10417                 *parentMatch0 = match;
  
  10418             }
  
  10419             #if (DEBUG)
  
  10420             if (parser_debug_write_to_log)
  
  10421             {
  
  10422                 if (match.hit)
  
  10423                 {
  
  10424                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PEReference");
  
  10425                     if (result.Error())
  
  10426                     {
  
  10427                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10428                     }
  
  10429                 }
  
  10430                 else
  
  10431                 {
  
  10432                     auto result = System.Lex.WriteFailureToLog(lexer, u"PEReference");
  
  10433                     if (result.Error())
  
  10434                     {
  
  10435                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10436                     }
  
  10437                 }
  
  10438             }
  
  10439             #endif
  
  10440             if (!match.hit)
  
  10441             {
  
  10442                 match.value = null;
  
  10443             }
  
  10444             return System.Result<System.Parsing.Match>(match);
  
  10445         }
  
  10446         public static System.Result<System.Parsing.Match> NotationDecl(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  10447         {
  
  10448             #if (DEBUG)
  
  10449             long parser_debug_match_pos = 0;
  
  10450             bool parser_debug_write_to_log = lexer.Log() != null;
  
  10451             if (parser_debug_write_to_log)
  
  10452             {
  
  10453                 parser_debug_match_pos = lexer.GetPos();
  
  10454                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"NotationDecl");
  
  10455                 if (result.Error())
  
  10456                 {
  
  10457                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10458                 }
  
  10459             }
  
  10460             #endif
  
  10461             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475959);
  
  10462             System.UniquePtr<System.Parsing.Value<bool>> s;
  
  10463             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
  10464             System.UniquePtr<System.Parsing.Value<bool>> s2;
  
  10465             System.UniquePtr<System.Parsing.Value<bool>> extID;
  
  10466             System.UniquePtr<System.Parsing.Value<bool>> pubID;
  
  10467             System.UniquePtr<System.Parsing.Value<bool>> s3;
  
  10468             System.Parsing.Match match(false);
  
  10469             System.Parsing.Match* parentMatch0 = &match;
  
  10470             {
  
  10471                 long pos = lexer.GetPos();
  
  10472                 System.Parsing.Match match(false);
  
  10473                 System.Parsing.Match* parentMatch1 = &match;
  
  10474                 {
  
  10475                     System.Parsing.Match match(false);
  
  10476                     System.Parsing.Match* parentMatch2 = &match;
  
  10477                     {
  
  10478                         System.Parsing.Match match(false);
  
  10479                         System.Parsing.Match* parentMatch3 = &match;
  
  10480                         {
  
  10481                             System.Parsing.Match match(false);
  
  10482                             System.Parsing.Match* parentMatch4 = &match;
  
  10483                             {
  
  10484                                 System.Parsing.Match match(false);
  
  10485                                 System.Parsing.Match* parentMatch5 = &match;
  
  10486                                 {
  
  10487                                     System.Parsing.Match match(false);
  
  10488                                     System.Parsing.Match* parentMatch6 = &match;
  
  10489                                     {
  
  10490                                         System.Parsing.Match match(false);
  
  10491                                         System.Parsing.Match* parentMatch7 = &match;
  
  10492                                         {
  
  10493                                             System.Parsing.Match match(true);
  
  10494                                             for (int i : s44)
  
  10495                                             {
  
  10496                                                 if (*lexer == i)
  
  10497                                                 {
  
  10498                                                     auto incResult0 = ++lexer;
  
  10499                                                     if (incResult0.Error())
  
  10500                                                     {
  
  10501                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  10502                                                     }
  
  10503                                                 }
  
  10504                                                 else
  
  10505                                                 {
  
  10506                                                     match.hit = false;
  
  10507                                                     break;
  
  10508                                                 }
  
  10509                                             }
  
  10510                                             *parentMatch7 = match;
  
  10511                                         }
  
  10512                                         if (match.hit)
  
  10513                                         {
  
  10514                                             System.Parsing.Match match(false);
  
  10515                                             System.Parsing.Match* parentMatch8 = &match;
  
  10516                                             {
  
  10517                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10518                                                 if (matchResult.Error())
  
  10519                                                 {
  
  10520                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10521                                                 }
  
  10522                                                 System.Parsing.Match match = matchResult.Value();
  
  10523                                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10524                                                 *parentMatch8 = match;
  
  10525                                             }
  
  10526                                             *parentMatch7 = match;
  
  10527                                         }
  
  10528                                         *parentMatch6 = match;
  
  10529                                     }
  
  10530                                     if (match.hit)
  
  10531                                     {
  
  10532                                         System.Parsing.Match match(false);
  
  10533                                         System.Parsing.Match* parentMatch9 = &match;
  
  10534                                         {
  
  10535                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  10536                                             if (matchResult.Error())
  
  10537                                             {
  
  10538                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10539                                             }
  
  10540                                             System.Parsing.Match match = matchResult.Value();
  
  10541                                             name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  10542                                             *parentMatch9 = match;
  
  10543                                         }
  
  10544                                         *parentMatch6 = match;
  
  10545                                     }
  
  10546                                     *parentMatch5 = match;
  
  10547                                 }
  
  10548                                 if (match.hit)
  
  10549                                 {
  
  10550                                     System.Parsing.Match match(false);
  
  10551                                     System.Parsing.Match* parentMatch10 = &match;
  
  10552                                     {
  
  10553                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10554                                         if (matchResult.Error())
  
  10555                                         {
  
  10556                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10557                                         }
  
  10558                                         System.Parsing.Match match = matchResult.Value();
  
  10559                                         s2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10560                                         *parentMatch10 = match;
  
  10561                                     }
  
  10562                                     *parentMatch5 = match;
  
  10563                                 }
  
  10564                                 *parentMatch4 = match;
  
  10565                             }
  
  10566                             if (match.hit)
  
  10567                             {
  
  10568                                 System.Parsing.Match match(false);
  
  10569                                 System.Parsing.Match* parentMatch11 = &match;
  
  10570                                 {
  
  10571                                     System.Parsing.Match match(false);
  
  10572                                     System.Parsing.Match* parentMatch12 = &match;
  
  10573                                     {
  
  10574                                         System.Parsing.Match match(false);
  
  10575                                         System.Parsing.Match* parentMatch13 = &match;
  
  10576                                         {
  
  10577                                             long save = lexer.GetPos();
  
  10578                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.ExternalID(lexer);
  
  10579                                             if (matchResult.Error())
  
  10580                                             {
  
  10581                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10582                                             }
  
  10583                                             System.Parsing.Match match = matchResult.Value();
  
  10584                                             extID.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10585                                             *parentMatch13 = match;
  
  10586                                             if (!match.hit)
  
  10587                                             {
  
  10588                                                 System.Parsing.Match match(false);
  
  10589                                                 System.Parsing.Match* parentMatch14 = &match;
  
  10590                                                 lexer.SetPos(save);
  
  10591                                                 {
  
  10592                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PublicID(lexer);
  
  10593                                                     if (matchResult.Error())
  
  10594                                                     {
  
  10595                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10596                                                     }
  
  10597                                                     System.Parsing.Match match = matchResult.Value();
  
  10598                                                     pubID.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10599                                                     *parentMatch14 = match;
  
  10600                                                 }
  
  10601                                                 *parentMatch13 = match;
  
  10602                                             }
  
  10603                                         }
  
  10604                                         *parentMatch12 = match;
  
  10605                                     }
  
  10606                                     *parentMatch11 = match;
  
  10607                                 }
  
  10608                                 *parentMatch4 = match;
  
  10609                             }
  
  10610                             *parentMatch3 = match;
  
  10611                         }
  
  10612                         if (match.hit)
  
  10613                         {
  
  10614                             System.Parsing.Match match(false);
  
  10615                             System.Parsing.Match* parentMatch15 = &match;
  
  10616                             {
  
  10617                                 System.Parsing.Match match(true);
  
  10618                                 long save = lexer.GetPos();
  
  10619                                 System.Parsing.Match* parentMatch16 = &match;
  
  10620                                 {
  
  10621                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10622                                     if (matchResult.Error())
  
  10623                                     {
  
  10624                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10625                                     }
  
  10626                                     System.Parsing.Match match = matchResult.Value();
  
  10627                                     s3.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10628                                     if (match.hit)
  
  10629                                     {
  
  10630                                         *parentMatch16 = match;
  
  10631                                     }
  
  10632                                     else
  
  10633                                     {
  
  10634                                         lexer.SetPos(save);
  
  10635                                     }
  
  10636                                 }
  
  10637                                 *parentMatch15 = match;
  
  10638                             }
  
  10639                             *parentMatch3 = match;
  
  10640                         }
  
  10641                         *parentMatch2 = match;
  
  10642                     }
  
  10643                     if (match.hit)
  
  10644                     {
  
  10645                         System.Parsing.Match match(false);
  
  10646                         System.Parsing.Match* parentMatch17 = &match;
  
  10647                         {
  
  10648                             System.Parsing.Match match(false);
  
  10649                             if (*lexer == 62)
  
  10650                             {
  
  10651                                 auto incResult1 = ++lexer;
  
  10652                                 if (incResult1.Error())
  
  10653                                 {
  
  10654                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  10655                                 }
  
  10656                                 match.hit = true;
  
  10657                             }
  
  10658                             *parentMatch17 = match;
  
  10659                         }
  
  10660                         *parentMatch2 = match;
  
  10661                     }
  
  10662                     *parentMatch1 = match;
  
  10663                 }
  
  10664                 if (match.hit)
  
  10665                 {
  
  10666                     #if (DEBUG)
  
  10667                         if (parser_debug_write_to_log)
  
  10668                         {
  
  10669                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NotationDecl");
  
  10670                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10671                         }
  
  10672                     #endif
  
  10673                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  10674                 }
  
  10675                 *parentMatch0 = match;
  
  10676             }
  
  10677             #if (DEBUG)
  
  10678             if (parser_debug_write_to_log)
  
  10679             {
  
  10680                 if (match.hit)
  
  10681                 {
  
  10682                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"NotationDecl");
  
  10683                     if (result.Error())
  
  10684                     {
  
  10685                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10686                     }
  
  10687                 }
  
  10688                 else
  
  10689                 {
  
  10690                     auto result = System.Lex.WriteFailureToLog(lexer, u"NotationDecl");
  
  10691                     if (result.Error())
  
  10692                     {
  
  10693                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10694                     }
  
  10695                 }
  
  10696             }
  
  10697             #endif
  
  10698             if (!match.hit)
  
  10699             {
  
  10700                 match.value = null;
  
  10701             }
  
  10702             return System.Result<System.Parsing.Match>(match);
  
  10703         }
  
  10704         public static System.Result<System.Parsing.Match> PublicID(LexerT& lexer)
  
  10705         {
  
  10706             #if (DEBUG)
  
  10707             long parser_debug_match_pos = 0;
  
  10708             bool parser_debug_write_to_log = lexer.Log() != null;
  
  10709             if (parser_debug_write_to_log)
  
  10710             {
  
  10711                 parser_debug_match_pos = lexer.GetPos();
  
  10712                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PublicID");
  
  10713                 if (result.Error())
  
  10714                 {
  
  10715                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10716                 }
  
  10717             }
  
  10718             #endif
  
  10719             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475960);
  
  10720             System.UniquePtr<System.Parsing.Value<bool>> s;
  
  10721             System.UniquePtr<System.Parsing.Value<bool>> pl;
  
  10722             System.Parsing.Match match(false);
  
  10723             System.Parsing.Match* parentMatch0 = &match;
  
  10724             {
  
  10725                 long pos = lexer.GetPos();
  
  10726                 System.Parsing.Match match(false);
  
  10727                 System.Parsing.Match* parentMatch1 = &match;
  
  10728                 {
  
  10729                     System.Parsing.Match match(false);
  
  10730                     System.Parsing.Match* parentMatch2 = &match;
  
  10731                     {
  
  10732                         System.Parsing.Match match(false);
  
  10733                         System.Parsing.Match* parentMatch3 = &match;
  
  10734                         {
  
  10735                             System.Parsing.Match match(true);
  
  10736                             for (int i : s45)
  
  10737                             {
  
  10738                                 if (*lexer == i)
  
  10739                                 {
  
  10740                                     auto incResult0 = ++lexer;
  
  10741                                     if (incResult0.Error())
  
  10742                                     {
  
  10743                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  10744                                     }
  
  10745                                 }
  
  10746                                 else
  
  10747                                 {
  
  10748                                     match.hit = false;
  
  10749                                     break;
  
  10750                                 }
  
  10751                             }
  
  10752                             *parentMatch3 = match;
  
  10753                         }
  
  10754                         if (match.hit)
  
  10755                         {
  
  10756                             System.Parsing.Match match(false);
  
  10757                             System.Parsing.Match* parentMatch4 = &match;
  
  10758                             {
  
  10759                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10760                                 if (matchResult.Error())
  
  10761                                 {
  
  10762                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10763                                 }
  
  10764                                 System.Parsing.Match match = matchResult.Value();
  
  10765                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10766                                 *parentMatch4 = match;
  
  10767                             }
  
  10768                             *parentMatch3 = match;
  
  10769                         }
  
  10770                         *parentMatch2 = match;
  
  10771                     }
  
  10772                     if (match.hit)
  
  10773                     {
  
  10774                         System.Parsing.Match match(false);
  
  10775                         System.Parsing.Match* parentMatch5 = &match;
  
  10776                         {
  
  10777                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PubidLiteral(lexer);
  
  10778                             if (matchResult.Error())
  
  10779                             {
  
  10780                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10781                             }
  
  10782                             System.Parsing.Match match = matchResult.Value();
  
  10783                             pl.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10784                             *parentMatch5 = match;
  
  10785                         }
  
  10786                         *parentMatch2 = match;
  
  10787                     }
  
  10788                     *parentMatch1 = match;
  
  10789                 }
  
  10790                 if (match.hit)
  
  10791                 {
  
  10792                     #if (DEBUG)
  
  10793                         if (parser_debug_write_to_log)
  
  10794                         {
  
  10795                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PublicID");
  
  10796                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10797                         }
  
  10798                     #endif
  
  10799                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  10800                 }
  
  10801                 *parentMatch0 = match;
  
  10802             }
  
  10803             #if (DEBUG)
  
  10804             if (parser_debug_write_to_log)
  
  10805             {
  
  10806                 if (match.hit)
  
  10807                 {
  
  10808                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PublicID");
  
  10809                     if (result.Error())
  
  10810                     {
  
  10811                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10812                     }
  
  10813                 }
  
  10814                 else
  
  10815                 {
  
  10816                     auto result = System.Lex.WriteFailureToLog(lexer, u"PublicID");
  
  10817                     if (result.Error())
  
  10818                     {
  
  10819                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10820                     }
  
  10821                 }
  
  10822             }
  
  10823             #endif
  
  10824             if (!match.hit)
  
  10825             {
  
  10826                 match.value = null;
  
  10827             }
  
  10828             return System.Result<System.Parsing.Match>(match);
  
  10829         }
  
  10830         public static System.Result<System.Parsing.Match> Element(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  10831         {
  
  10832             #if (DEBUG)
  
  10833             long parser_debug_match_pos = 0;
  
  10834             bool parser_debug_write_to_log = lexer.Log() != null;
  
  10835             if (parser_debug_write_to_log)
  
  10836             {
  
  10837                 parser_debug_match_pos = lexer.GetPos();
  
  10838                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Element");
  
  10839                 if (result.Error())
  
  10840                 {
  
  10841                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  10842                 }
  
  10843             }
  
  10844             #endif
  
  10845             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475961);
  
  10846             ustring tagName = ustring();
  
  10847             System.Lex.Span span = System.Lex.Span();
  
  10848             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
  10849             System.UniquePtr<System.Parsing.Value<bool>> s;
  
  10850             System.UniquePtr<System.Parsing.Value<bool>> attribute;
  
  10851             System.UniquePtr<System.Parsing.Value<bool>> content;
  
  10852             System.UniquePtr<System.Parsing.Value<bool>> etag;
  
  10853             System.Parsing.Match match(false);
  
  10854             System.Parsing.Match* parentMatch0 = &match;
  
  10855             {
  
  10856                 long pos = lexer.GetPos();
  
  10857                 System.Parsing.Match match(false);
  
  10858                 System.Parsing.Match* parentMatch1 = &match;
  
  10859                 {
  
  10860                     System.Parsing.Match match(false);
  
  10861                     System.Parsing.Match* parentMatch2 = &match;
  
  10862                     {
  
  10863                         System.Parsing.Match match(false);
  
  10864                         System.Parsing.Match* parentMatch3 = &match;
  
  10865                         {
  
  10866                             System.Parsing.Match match(false);
  
  10867                             System.Parsing.Match* parentMatch4 = &match;
  
  10868                             {
  
  10869                                 System.Parsing.Match match(false);
  
  10870                                 System.Parsing.Match* parentMatch5 = &match;
  
  10871                                 {
  
  10872                                     System.Parsing.Match match(false);
  
  10873                                     if (*lexer == 60)
  
  10874                                     {
  
  10875                                         auto incResult0 = ++lexer;
  
  10876                                         if (incResult0.Error())
  
  10877                                         {
  
  10878                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  10879                                         }
  
  10880                                         match.hit = true;
  
  10881                                     }
  
  10882                                     *parentMatch5 = match;
  
  10883                                 }
  
  10884                                 if (match.hit)
  
  10885                                 {
  
  10886                                     System.Parsing.Match match(false);
  
  10887                                     System.Parsing.Match* parentMatch6 = &match;
  
  10888                                     {
  
  10889                                         System.Parsing.Match match(false);
  
  10890                                         System.Parsing.Match* parentMatch7 = &match;
  
  10891                                         {
  
  10892                                             long pos = lexer.GetPos();
  
  10893                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  10894                                             if (matchResult.Error())
  
  10895                                             {
  
  10896                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10897                                             }
  
  10898                                             System.Parsing.Match match = matchResult.Value();
  
  10899                                             name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  10900                                             if (match.hit)
  
  10901                                             {
  
  10902                                                 span = lexer.GetSpan(pos);
  
  10903                                                 tagName = name->value;
  
  10904                                                 auto result = processor->BeginStartTag(tagName);
  
  10905                                                 if (result.Error())
  
  10906                                                 {
  
  10907                                                     return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  10908                                                 }
  
  10909                                             }
  
  10910                                             *parentMatch7 = match;
  
  10911                                         }
  
  10912                                         *parentMatch6 = match;
  
  10913                                     }
  
  10914                                     *parentMatch5 = match;
  
  10915                                 }
  
  10916                                 *parentMatch4 = match;
  
  10917                             }
  
  10918                             if (match.hit)
  
  10919                             {
  
  10920                                 System.Parsing.Match match(false);
  
  10921                                 System.Parsing.Match* parentMatch8 = &match;
  
  10922                                 {
  
  10923                                     System.Parsing.Match match(true);
  
  10924                                     System.Parsing.Match* parentMatch9 = &match;
  
  10925                                     {
  
  10926                                         while (true)
  
  10927                                         {
  
  10928                                             long save = lexer.GetPos();
  
  10929                                             {
  
  10930                                                 System.Parsing.Match match(false);
  
  10931                                                 System.Parsing.Match* parentMatch10 = &match;
  
  10932                                                 {
  
  10933                                                     System.Parsing.Match match(false);
  
  10934                                                     System.Parsing.Match* parentMatch11 = &match;
  
  10935                                                     {
  
  10936                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10937                                                         if (matchResult.Error())
  
  10938                                                         {
  
  10939                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10940                                                         }
  
  10941                                                         System.Parsing.Match match = matchResult.Value();
  
  10942                                                         s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10943                                                         *parentMatch11 = match;
  
  10944                                                     }
  
  10945                                                     if (match.hit)
  
  10946                                                     {
  
  10947                                                         System.Parsing.Match match(false);
  
  10948                                                         System.Parsing.Match* parentMatch12 = &match;
  
  10949                                                         {
  
  10950                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Attribute(lexer, processor);
  
  10951                                                             if (matchResult.Error())
  
  10952                                                             {
  
  10953                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10954                                                             }
  
  10955                                                             System.Parsing.Match match = matchResult.Value();
  
  10956                                                             attribute.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10957                                                             *parentMatch12 = match;
  
  10958                                                         }
  
  10959                                                         *parentMatch11 = match;
  
  10960                                                     }
  
  10961                                                     *parentMatch10 = match;
  
  10962                                                 }
  
  10963                                                 if (match.hit)
  
  10964                                                 {
  
  10965                                                     *parentMatch9 = match;
  
  10966                                                 }
  
  10967                                                 else
  
  10968                                                 {
  
  10969                                                     lexer.SetPos(save);
  
  10970                                                     break;
  
  10971                                                 }
  
  10972                                             }
  
  10973                                         }
  
  10974                                     }
  
  10975                                     *parentMatch8 = match;
  
  10976                                 }
  
  10977                                 *parentMatch4 = match;
  
  10978                             }
  
  10979                             *parentMatch3 = match;
  
  10980                         }
  
  10981                         if (match.hit)
  
  10982                         {
  
  10983                             System.Parsing.Match match(false);
  
  10984                             System.Parsing.Match* parentMatch13 = &match;
  
  10985                             {
  
  10986                                 System.Parsing.Match match(true);
  
  10987                                 long save = lexer.GetPos();
  
  10988                                 System.Parsing.Match* parentMatch14 = &match;
  
  10989                                 {
  
  10990                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  10991                                     if (matchResult.Error())
  
  10992                                     {
  
  10993                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  10994                                     }
  
  10995                                     System.Parsing.Match match = matchResult.Value();
  
  10996                                     s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  10997                                     if (match.hit)
  
  10998                                     {
  
  10999                                         *parentMatch14 = match;
  
  11000                                     }
  
  11001                                     else
  
  11002                                     {
  
  11003                                         lexer.SetPos(save);
  
  11004                                     }
  
  11005                                 }
  
  11006                                 *parentMatch13 = match;
  
  11007                             }
  
  11008                             *parentMatch3 = match;
  
  11009                         }
  
  11010                         *parentMatch2 = match;
  
  11011                     }
  
  11012                     if (match.hit)
  
  11013                     {
  
  11014                         System.Parsing.Match match(false);
  
  11015                         System.Parsing.Match* parentMatch15 = &match;
  
  11016                         {
  
  11017                             System.Parsing.Match match(false);
  
  11018                             System.Parsing.Match* parentMatch16 = &match;
  
  11019                             {
  
  11020                                 System.Parsing.Match match(false);
  
  11021                                 System.Parsing.Match* parentMatch17 = &match;
  
  11022                                 {
  
  11023                                     long save = lexer.GetPos();
  
  11024                                     System.Parsing.Match match(false);
  
  11025                                     System.Parsing.Match* parentMatch18 = &match;
  
  11026                                     {
  
  11027                                         long pos = lexer.GetPos();
  
  11028                                         System.Parsing.Match match(true);
  
  11029                                         for (int i : s46)
  
  11030                                         {
  
  11031                                             if (*lexer == i)
  
  11032                                             {
  
  11033                                                 auto incResult1 = ++lexer;
  
  11034                                                 if (incResult1.Error())
  
  11035                                                 {
  
  11036                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  11037                                                 }
  
  11038                                             }
  
  11039                                             else
  
  11040                                             {
  
  11041                                                 match.hit = false;
  
  11042                                                 break;
  
  11043                                             }
  
  11044                                         }
  
  11045                                         if (match.hit)
  
  11046                                         {
  
  11047                                             auto result = processor->EndStartTag(span, lexer.FileIndex(), lexer.FileName(), pos);
  
  11048                                             if (result.Error())
  
  11049                                             {
  
  11050                                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  11051                                             }
  
  11052                                             result = processor->EndTag(tagName, span, lexer.FileName(), pos);
  
  11053                                             if (result.Error())
  
  11054                                             {
  
  11055                                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  11056                                             }
  
  11057                                         }
  
  11058                                         *parentMatch18 = match;
  
  11059                                     }
  
  11060                                     *parentMatch17 = match;
  
  11061                                     if (!match.hit)
  
  11062                                     {
  
  11063                                         System.Parsing.Match match(false);
  
  11064                                         System.Parsing.Match* parentMatch19 = &match;
  
  11065                                         lexer.SetPos(save);
  
  11066                                         {
  
  11067                                             System.Parsing.Match match(false);
  
  11068                                             System.Parsing.Match* parentMatch20 = &match;
  
  11069                                             {
  
  11070                                                 System.Parsing.Match match(false);
  
  11071                                                 System.Parsing.Match* parentMatch21 = &match;
  
  11072                                                 {
  
  11073                                                     System.Parsing.Match match(false);
  
  11074                                                     System.Parsing.Match* parentMatch22 = &match;
  
  11075                                                     {
  
  11076                                                         long pos = lexer.GetPos();
  
  11077                                                         System.Parsing.Match match(false);
  
  11078                                                         if (*lexer == 62)
  
  11079                                                         {
  
  11080                                                             auto incResult2 = ++lexer;
  
  11081                                                             if (incResult2.Error())
  
  11082                                                             {
  
  11083                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  11084                                                             }
  
  11085                                                             match.hit = true;
  
  11086                                                         }
  
  11087                                                         if (match.hit)
  
  11088                                                         {
  
  11089                                                             auto result = processor->EndStartTag(span, lexer.FileIndex(), lexer.FileName(), pos);
  
  11090                                                             if (result.Error())
  
  11091                                                             {
  
  11092                                                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  11093                                                             }
  
  11094                                                         }
  
  11095                                                         *parentMatch22 = match;
  
  11096                                                     }
  
  11097                                                     *parentMatch21 = match;
  
  11098                                                 }
  
  11099                                                 if (match.hit)
  
  11100                                                 {
  
  11101                                                     System.Parsing.Match match(false);
  
  11102                                                     System.Parsing.Match* parentMatch23 = &match;
  
  11103                                                     {
  
  11104                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Content(lexer, processor);
  
  11105                                                         if (matchResult.Error())
  
  11106                                                         {
  
  11107                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11108                                                         }
  
  11109                                                         System.Parsing.Match match = matchResult.Value();
  
  11110                                                         content.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11111                                                         *parentMatch23 = match;
  
  11112                                                     }
  
  11113                                                     *parentMatch21 = match;
  
  11114                                                 }
  
  11115                                                 *parentMatch20 = match;
  
  11116                                             }
  
  11117                                             if (match.hit)
  
  11118                                             {
  
  11119                                                 System.Parsing.Match match(false);
  
  11120                                                 System.Parsing.Match* parentMatch24 = &match;
  
  11121                                                 {
  
  11122                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.ETag(lexer, processor);
  
  11123                                                     if (matchResult.Error())
  
  11124                                                     {
  
  11125                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11126                                                     }
  
  11127                                                     System.Parsing.Match match = matchResult.Value();
  
  11128                                                     etag.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11129                                                     *parentMatch24 = match;
  
  11130                                                 }
  
  11131                                                 *parentMatch20 = match;
  
  11132                                             }
  
  11133                                             *parentMatch19 = match;
  
  11134                                         }
  
  11135                                         *parentMatch17 = match;
  
  11136                                     }
  
  11137                                 }
  
  11138                                 *parentMatch16 = match;
  
  11139                             }
  
  11140                             *parentMatch15 = match;
  
  11141                         }
  
  11142                         *parentMatch2 = match;
  
  11143                     }
  
  11144                     *parentMatch1 = match;
  
  11145                 }
  
  11146                 if (match.hit)
  
  11147                 {
  
  11148                     #if (DEBUG)
  
  11149                         if (parser_debug_write_to_log)
  
  11150                         {
  
  11151                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Element");
  
  11152                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11153                         }
  
  11154                     #endif
  
  11155                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  11156                 }
  
  11157                 *parentMatch0 = match;
  
  11158             }
  
  11159             #if (DEBUG)
  
  11160             if (parser_debug_write_to_log)
  
  11161             {
  
  11162                 if (match.hit)
  
  11163                 {
  
  11164                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Element");
  
  11165                     if (result.Error())
  
  11166                     {
  
  11167                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11168                     }
  
  11169                 }
  
  11170                 else
  
  11171                 {
  
  11172                     auto result = System.Lex.WriteFailureToLog(lexer, u"Element");
  
  11173                     if (result.Error())
  
  11174                     {
  
  11175                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11176                     }
  
  11177                 }
  
  11178             }
  
  11179             #endif
  
  11180             if (!match.hit)
  
  11181             {
  
  11182                 match.value = null;
  
  11183             }
  
  11184             return System.Result<System.Parsing.Match>(match);
  
  11185         }
  
  11186         public static System.Result<System.Parsing.Match> ETag(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  11187         {
  
  11188             #if (DEBUG)
  
  11189             long parser_debug_match_pos = 0;
  
  11190             bool parser_debug_write_to_log = lexer.Log() != null;
  
  11191             if (parser_debug_write_to_log)
  
  11192             {
  
  11193                 parser_debug_match_pos = lexer.GetPos();
  
  11194                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"ETag");
  
  11195                 if (result.Error())
  
  11196                 {
  
  11197                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11198                 }
  
  11199             }
  
  11200             #endif
  
  11201             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475962);
  
  11202             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
  11203             System.UniquePtr<System.Parsing.Value<bool>> s;
  
  11204             System.Parsing.Match match(false);
  
  11205             System.Parsing.Match* parentMatch0 = &match;
  
  11206             {
  
  11207                 long pos = lexer.GetPos();
  
  11208                 System.Parsing.Match match(false);
  
  11209                 System.Parsing.Match* parentMatch1 = &match;
  
  11210                 {
  
  11211                     System.Parsing.Match match(false);
  
  11212                     System.Parsing.Match* parentMatch2 = &match;
  
  11213                     {
  
  11214                         System.Parsing.Match match(false);
  
  11215                         System.Parsing.Match* parentMatch3 = &match;
  
  11216                         {
  
  11217                             System.Parsing.Match match(false);
  
  11218                             System.Parsing.Match* parentMatch4 = &match;
  
  11219                             {
  
  11220                                 System.Parsing.Match match(true);
  
  11221                                 for (int i : s47)
  
  11222                                 {
  
  11223                                     if (*lexer == i)
  
  11224                                     {
  
  11225                                         auto incResult0 = ++lexer;
  
  11226                                         if (incResult0.Error())
  
  11227                                         {
  
  11228                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  11229                                         }
  
  11230                                     }
  
  11231                                     else
  
  11232                                     {
  
  11233                                         match.hit = false;
  
  11234                                         break;
  
  11235                                     }
  
  11236                                 }
  
  11237                                 *parentMatch4 = match;
  
  11238                             }
  
  11239                             if (match.hit)
  
  11240                             {
  
  11241                                 System.Parsing.Match match(false);
  
  11242                                 System.Parsing.Match* parentMatch5 = &match;
  
  11243                                 {
  
  11244                                     System.Parsing.Match match(false);
  
  11245                                     System.Parsing.Match* parentMatch6 = &match;
  
  11246                                     {
  
  11247                                         long pos = lexer.GetPos();
  
  11248                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  11249                                         if (matchResult.Error())
  
  11250                                         {
  
  11251                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11252                                         }
  
  11253                                         System.Parsing.Match match = matchResult.Value();
  
  11254                                         name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  11255                                         if (match.hit)
  
  11256                                         {
  
  11257                                             auto result = processor->EndTag(name->value, lexer.GetSpan(pos), lexer.FileName(), pos);
  
  11258                                             if (result.Error())
  
  11259                                             {
  
  11260                                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  11261                                             }
  
  11262                                         }
  
  11263                                         *parentMatch6 = match;
  
  11264                                     }
  
  11265                                     *parentMatch5 = match;
  
  11266                                 }
  
  11267                                 *parentMatch4 = match;
  
  11268                             }
  
  11269                             *parentMatch3 = match;
  
  11270                         }
  
  11271                         if (match.hit)
  
  11272                         {
  
  11273                             System.Parsing.Match match(false);
  
  11274                             System.Parsing.Match* parentMatch7 = &match;
  
  11275                             {
  
  11276                                 System.Parsing.Match match(true);
  
  11277                                 long save = lexer.GetPos();
  
  11278                                 System.Parsing.Match* parentMatch8 = &match;
  
  11279                                 {
  
  11280                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  11281                                     if (matchResult.Error())
  
  11282                                     {
  
  11283                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11284                                     }
  
  11285                                     System.Parsing.Match match = matchResult.Value();
  
  11286                                     s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11287                                     if (match.hit)
  
  11288                                     {
  
  11289                                         *parentMatch8 = match;
  
  11290                                     }
  
  11291                                     else
  
  11292                                     {
  
  11293                                         lexer.SetPos(save);
  
  11294                                     }
  
  11295                                 }
  
  11296                                 *parentMatch7 = match;
  
  11297                             }
  
  11298                             *parentMatch3 = match;
  
  11299                         }
  
  11300                         *parentMatch2 = match;
  
  11301                     }
  
  11302                     if (match.hit)
  
  11303                     {
  
  11304                         System.Parsing.Match match(false);
  
  11305                         System.Parsing.Match* parentMatch9 = &match;
  
  11306                         {
  
  11307                             System.Parsing.Match match(false);
  
  11308                             if (*lexer == 62)
  
  11309                             {
  
  11310                                 auto incResult1 = ++lexer;
  
  11311                                 if (incResult1.Error())
  
  11312                                 {
  
  11313                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  11314                                 }
  
  11315                                 match.hit = true;
  
  11316                             }
  
  11317                             *parentMatch9 = match;
  
  11318                         }
  
  11319                         *parentMatch2 = match;
  
  11320                     }
  
  11321                     *parentMatch1 = match;
  
  11322                 }
  
  11323                 if (match.hit)
  
  11324                 {
  
  11325                     #if (DEBUG)
  
  11326                         if (parser_debug_write_to_log)
  
  11327                         {
  
  11328                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ETag");
  
  11329                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11330                         }
  
  11331                     #endif
  
  11332                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  11333                 }
  
  11334                 *parentMatch0 = match;
  
  11335             }
  
  11336             #if (DEBUG)
  
  11337             if (parser_debug_write_to_log)
  
  11338             {
  
  11339                 if (match.hit)
  
  11340                 {
  
  11341                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"ETag");
  
  11342                     if (result.Error())
  
  11343                     {
  
  11344                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11345                     }
  
  11346                 }
  
  11347                 else
  
  11348                 {
  
  11349                     auto result = System.Lex.WriteFailureToLog(lexer, u"ETag");
  
  11350                     if (result.Error())
  
  11351                     {
  
  11352                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11353                     }
  
  11354                 }
  
  11355             }
  
  11356             #endif
  
  11357             if (!match.hit)
  
  11358             {
  
  11359                 match.value = null;
  
  11360             }
  
  11361             return System.Result<System.Parsing.Match>(match);
  
  11362         }
  
  11363         public static System.Result<System.Parsing.Match> Content(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  11364         {
  
  11365             #if (DEBUG)
  
  11366             long parser_debug_match_pos = 0;
  
  11367             bool parser_debug_write_to_log = lexer.Log() != null;
  
  11368             if (parser_debug_write_to_log)
  
  11369             {
  
  11370                 parser_debug_match_pos = lexer.GetPos();
  
  11371                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Content");
  
  11372                 if (result.Error())
  
  11373                 {
  
  11374                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11375                 }
  
  11376             }
  
  11377             #endif
  
  11378             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475963);
  
  11379             System.UniquePtr<System.Parsing.Value<bool>> cd1;
  
  11380             System.UniquePtr<System.Parsing.Value<bool>> element;
  
  11381             System.UniquePtr<System.Parsing.Value<bool>> reference;
  
  11382             System.UniquePtr<System.Parsing.Value<bool>> cdsect;
  
  11383             System.UniquePtr<System.Parsing.Value<bool>> pi;
  
  11384             System.UniquePtr<System.Parsing.Value<bool>> comment;
  
  11385             System.UniquePtr<System.Parsing.Value<bool>> cd2;
  
  11386             System.Parsing.Match match(false);
  
  11387             System.Parsing.Match* parentMatch0 = &match;
  
  11388             {
  
  11389                 long pos = lexer.GetPos();
  
  11390                 System.Parsing.Match match(false);
  
  11391                 System.Parsing.Match* parentMatch1 = &match;
  
  11392                 {
  
  11393                     System.Parsing.Match match(false);
  
  11394                     System.Parsing.Match* parentMatch2 = &match;
  
  11395                     {
  
  11396                         System.Parsing.Match match(true);
  
  11397                         long save = lexer.GetPos();
  
  11398                         System.Parsing.Match* parentMatch3 = &match;
  
  11399                         {
  
  11400                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CharData(lexer, processor);
  
  11401                             if (matchResult.Error())
  
  11402                             {
  
  11403                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11404                             }
  
  11405                             System.Parsing.Match match = matchResult.Value();
  
  11406                             cd1.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11407                             if (match.hit)
  
  11408                             {
  
  11409                                 *parentMatch3 = match;
  
  11410                             }
  
  11411                             else
  
  11412                             {
  
  11413                                 lexer.SetPos(save);
  
  11414                             }
  
  11415                         }
  
  11416                         *parentMatch2 = match;
  
  11417                     }
  
  11418                     if (match.hit)
  
  11419                     {
  
  11420                         System.Parsing.Match match(false);
  
  11421                         System.Parsing.Match* parentMatch4 = &match;
  
  11422                         {
  
  11423                             System.Parsing.Match match(true);
  
  11424                             System.Parsing.Match* parentMatch5 = &match;
  
  11425                             {
  
  11426                                 while (true)
  
  11427                                 {
  
  11428                                     long save = lexer.GetPos();
  
  11429                                     {
  
  11430                                         System.Parsing.Match match(false);
  
  11431                                         System.Parsing.Match* parentMatch6 = &match;
  
  11432                                         {
  
  11433                                             System.Parsing.Match match(false);
  
  11434                                             System.Parsing.Match* parentMatch7 = &match;
  
  11435                                             {
  
  11436                                                 System.Parsing.Match match(false);
  
  11437                                                 System.Parsing.Match* parentMatch8 = &match;
  
  11438                                                 {
  
  11439                                                     System.Parsing.Match match(false);
  
  11440                                                     System.Parsing.Match* parentMatch9 = &match;
  
  11441                                                     {
  
  11442                                                         long save = lexer.GetPos();
  
  11443                                                         System.Parsing.Match match(false);
  
  11444                                                         System.Parsing.Match* parentMatch10 = &match;
  
  11445                                                         {
  
  11446                                                             long save = lexer.GetPos();
  
  11447                                                             System.Parsing.Match match(false);
  
  11448                                                             System.Parsing.Match* parentMatch11 = &match;
  
  11449                                                             {
  
  11450                                                                 long save = lexer.GetPos();
  
  11451                                                                 System.Parsing.Match match(false);
  
  11452                                                                 System.Parsing.Match* parentMatch12 = &match;
  
  11453                                                                 {
  
  11454                                                                     long save = lexer.GetPos();
  
  11455                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Element(lexer, processor);
  
  11456                                                                     if (matchResult.Error())
  
  11457                                                                     {
  
  11458                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11459                                                                     }
  
  11460                                                                     System.Parsing.Match match = matchResult.Value();
  
  11461                                                                     element.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11462                                                                     *parentMatch12 = match;
  
  11463                                                                     if (!match.hit)
  
  11464                                                                     {
  
  11465                                                                         System.Parsing.Match match(false);
  
  11466                                                                         System.Parsing.Match* parentMatch13 = &match;
  
  11467                                                                         lexer.SetPos(save);
  
  11468                                                                         {
  
  11469                                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Reference(lexer, processor);
  
  11470                                                                             if (matchResult.Error())
  
  11471                                                                             {
  
  11472                                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11473                                                                             }
  
  11474                                                                             System.Parsing.Match match = matchResult.Value();
  
  11475                                                                             reference.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11476                                                                             *parentMatch13 = match;
  
  11477                                                                         }
  
  11478                                                                         *parentMatch12 = match;
  
  11479                                                                     }
  
  11480                                                                 }
  
  11481                                                                 *parentMatch11 = match;
  
  11482                                                                 if (!match.hit)
  
  11483                                                                 {
  
  11484                                                                     System.Parsing.Match match(false);
  
  11485                                                                     System.Parsing.Match* parentMatch14 = &match;
  
  11486                                                                     lexer.SetPos(save);
  
  11487                                                                     {
  
  11488                                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CDSect(lexer, processor);
  
  11489                                                                         if (matchResult.Error())
  
  11490                                                                         {
  
  11491                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11492                                                                         }
  
  11493                                                                         System.Parsing.Match match = matchResult.Value();
  
  11494                                                                         cdsect.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11495                                                                         *parentMatch14 = match;
  
  11496                                                                     }
  
  11497                                                                     *parentMatch11 = match;
  
  11498                                                                 }
  
  11499                                                             }
  
  11500                                                             *parentMatch10 = match;
  
  11501                                                             if (!match.hit)
  
  11502                                                             {
  
  11503                                                                 System.Parsing.Match match(false);
  
  11504                                                                 System.Parsing.Match* parentMatch15 = &match;
  
  11505                                                                 lexer.SetPos(save);
  
  11506                                                                 {
  
  11507                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PI(lexer, processor);
  
  11508                                                                     if (matchResult.Error())
  
  11509                                                                     {
  
  11510                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11511                                                                     }
  
  11512                                                                     System.Parsing.Match match = matchResult.Value();
  
  11513                                                                     pi.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11514                                                                     *parentMatch15 = match;
  
  11515                                                                 }
  
  11516                                                                 *parentMatch10 = match;
  
  11517                                                             }
  
  11518                                                         }
  
  11519                                                         *parentMatch9 = match;
  
  11520                                                         if (!match.hit)
  
  11521                                                         {
  
  11522                                                             System.Parsing.Match match(false);
  
  11523                                                             System.Parsing.Match* parentMatch16 = &match;
  
  11524                                                             lexer.SetPos(save);
  
  11525                                                             {
  
  11526                                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Comment(lexer, processor);
  
  11527                                                                 if (matchResult.Error())
  
  11528                                                                 {
  
  11529                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11530                                                                 }
  
  11531                                                                 System.Parsing.Match match = matchResult.Value();
  
  11532                                                                 comment.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11533                                                                 *parentMatch16 = match;
  
  11534                                                             }
  
  11535                                                             *parentMatch9 = match;
  
  11536                                                         }
  
  11537                                                     }
  
  11538                                                     *parentMatch8 = match;
  
  11539                                                 }
  
  11540                                                 *parentMatch7 = match;
  
  11541                                             }
  
  11542                                             if (match.hit)
  
  11543                                             {
  
  11544                                                 System.Parsing.Match match(false);
  
  11545                                                 System.Parsing.Match* parentMatch17 = &match;
  
  11546                                                 {
  
  11547                                                     System.Parsing.Match match(true);
  
  11548                                                     long save = lexer.GetPos();
  
  11549                                                     System.Parsing.Match* parentMatch18 = &match;
  
  11550                                                     {
  
  11551                                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CharData(lexer, processor);
  
  11552                                                         if (matchResult.Error())
  
  11553                                                         {
  
  11554                                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11555                                                         }
  
  11556                                                         System.Parsing.Match match = matchResult.Value();
  
  11557                                                         cd2.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  11558                                                         if (match.hit)
  
  11559                                                         {
  
  11560                                                             *parentMatch18 = match;
  
  11561                                                         }
  
  11562                                                         else
  
  11563                                                         {
  
  11564                                                             lexer.SetPos(save);
  
  11565                                                         }
  
  11566                                                     }
  
  11567                                                     *parentMatch17 = match;
  
  11568                                                 }
  
  11569                                                 *parentMatch7 = match;
  
  11570                                             }
  
  11571                                             *parentMatch6 = match;
  
  11572                                         }
  
  11573                                         if (match.hit)
  
  11574                                         {
  
  11575                                             *parentMatch5 = match;
  
  11576                                         }
  
  11577                                         else
  
  11578                                         {
  
  11579                                             lexer.SetPos(save);
  
  11580                                             break;
  
  11581                                         }
  
  11582                                     }
  
  11583                                 }
  
  11584                             }
  
  11585                             *parentMatch4 = match;
  
  11586                         }
  
  11587                         *parentMatch2 = match;
  
  11588                     }
  
  11589                     *parentMatch1 = match;
  
  11590                 }
  
  11591                 if (match.hit)
  
  11592                 {
  
  11593                     #if (DEBUG)
  
  11594                         if (parser_debug_write_to_log)
  
  11595                         {
  
  11596                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Content");
  
  11597                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11598                         }
  
  11599                     #endif
  
  11600                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  11601                 }
  
  11602                 *parentMatch0 = match;
  
  11603             }
  
  11604             #if (DEBUG)
  
  11605             if (parser_debug_write_to_log)
  
  11606             {
  
  11607                 if (match.hit)
  
  11608                 {
  
  11609                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Content");
  
  11610                     if (result.Error())
  
  11611                     {
  
  11612                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11613                     }
  
  11614                 }
  
  11615                 else
  
  11616                 {
  
  11617                     auto result = System.Lex.WriteFailureToLog(lexer, u"Content");
  
  11618                     if (result.Error())
  
  11619                     {
  
  11620                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11621                     }
  
  11622                 }
  
  11623             }
  
  11624             #endif
  
  11625             if (!match.hit)
  
  11626             {
  
  11627                 match.value = null;
  
  11628             }
  
  11629             return System.Result<System.Parsing.Match>(match);
  
  11630         }
  
  11631         public static System.Result<System.Parsing.Match> CharDataChar(LexerT& lexer)
  
  11632         {
  
  11633             #if (DEBUG)
  
  11634             long parser_debug_match_pos = 0;
  
  11635             bool parser_debug_write_to_log = lexer.Log() != null;
  
  11636             if (parser_debug_write_to_log)
  
  11637             {
  
  11638                 parser_debug_match_pos = lexer.GetPos();
  
  11639                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"CharDataChar");
  
  11640                 if (result.Error())
  
  11641                 {
  
  11642                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11643                 }
  
  11644             }
  
  11645             #endif
  
  11646             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475964);
  
  11647             System.Parsing.Match match(false);
  
  11648             System.Parsing.Match* parentMatch0 = &match;
  
  11649             {
  
  11650                 long pos = lexer.GetPos();
  
  11651                 System.Parsing.Match match(lexer.Pos() != lexer.End());
  
  11652                 for (const System.Parsing.Range& range : s48)
  
  11653                 {
  
  11654                     if (*lexer >= range.first && *lexer <= range.last)
  
  11655                     {
  
  11656                         match.hit = false;
  
  11657                         break;
  
  11658                     }
  
  11659                 }
  
  11660                 if (match.hit)
  
  11661                 {
  
  11662                     auto incResult0 = ++lexer;
  
  11663                     if (incResult0.Error())
  
  11664                     {
  
  11665                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  11666                     }
  
  11667                 }
  
  11668                 if (match.hit)
  
  11669                 {
  
  11670                     #if (DEBUG)
  
  11671                         if (parser_debug_write_to_log)
  
  11672                         {
  
  11673                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CharDataChar");
  
  11674                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11675                         }
  
  11676                     #endif
  
  11677                     Token token = lexer.GetToken(pos);
  
  11678                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<uchar>(cast<uchar>(token.id))));
  
  11679                 }
  
  11680                 *parentMatch0 = match;
  
  11681             }
  
  11682             #if (DEBUG)
  
  11683             if (parser_debug_write_to_log)
  
  11684             {
  
  11685                 if (match.hit)
  
  11686                 {
  
  11687                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CharDataChar");
  
  11688                     if (result.Error())
  
  11689                     {
  
  11690                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11691                     }
  
  11692                 }
  
  11693                 else
  
  11694                 {
  
  11695                     auto result = System.Lex.WriteFailureToLog(lexer, u"CharDataChar");
  
  11696                     if (result.Error())
  
  11697                     {
  
  11698                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11699                     }
  
  11700                 }
  
  11701             }
  
  11702             #endif
  
  11703             if (!match.hit)
  
  11704             {
  
  11705                 match.value = null;
  
  11706             }
  
  11707             return System.Result<System.Parsing.Match>(match);
  
  11708         }
  
  11709         public static System.Result<System.Parsing.Match> CharData(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  11710         {
  
  11711             #if (DEBUG)
  
  11712             long parser_debug_match_pos = 0;
  
  11713             bool parser_debug_write_to_log = lexer.Log() != null;
  
  11714             if (parser_debug_write_to_log)
  
  11715             {
  
  11716                 parser_debug_match_pos = lexer.GetPos();
  
  11717                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"CharData");
  
  11718                 if (result.Error())
  
  11719                 {
  
  11720                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11721                 }
  
  11722             }
  
  11723             #endif
  
  11724             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475965);
  
  11725             ustring s = ustring();
  
  11726             System.Lex.Span span = System.Lex.Span();
  
  11727             System.UniquePtr<System.Parsing.Value<uchar>> chr;
  
  11728             System.Parsing.Match match(false);
  
  11729             System.Parsing.Match* parentMatch0 = &match;
  
  11730             {
  
  11731                 long pos = lexer.GetPos();
  
  11732                 System.Parsing.Match match(false);
  
  11733                 System.Parsing.Match* parentMatch1 = &match;
  
  11734                 {
  
  11735                     System.Parsing.Match match(false);
  
  11736                     System.Parsing.Match* parentMatch2 = &match;
  
  11737                     {
  
  11738                         long pos = lexer.GetPos();
  
  11739                         System.Parsing.Match match(false);
  
  11740                         System.Parsing.Match* parentMatch3 = &match;
  
  11741                         {
  
  11742                             System.Parsing.Match match(false);
  
  11743                             System.Parsing.Match* parentMatch4 = &match;
  
  11744                             long save = lexer.GetPos();
  
  11745                             {
  
  11746                                 System.Parsing.Match match(true);
  
  11747                                 System.Parsing.Match* parentMatch5 = &match;
  
  11748                                 {
  
  11749                                     while (true)
  
  11750                                     {
  
  11751                                         long save = lexer.GetPos();
  
  11752                                         {
  
  11753                                             System.Parsing.Match match(false);
  
  11754                                             System.Parsing.Match* parentMatch6 = &match;
  
  11755                                             {
  
  11756                                                 System.Parsing.Match match(false);
  
  11757                                                 System.Parsing.Match* parentMatch7 = &match;
  
  11758                                                 {
  
  11759                                                     long pos = lexer.GetPos();
  
  11760                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CharDataChar(lexer);
  
  11761                                                     if (matchResult.Error())
  
  11762                                                     {
  
  11763                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  11764                                                     }
  
  11765                                                     System.Parsing.Match match = matchResult.Value();
  
  11766                                                     chr.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
  11767                                                     if (match.hit)
  
  11768                                                     {
  
  11769                                                         span = lexer.GetSpan(pos);
  
  11770                                                         s.Append(chr->value);
  
  11771                                                     }
  
  11772                                                     *parentMatch7 = match;
  
  11773                                                 }
  
  11774                                                 *parentMatch6 = match;
  
  11775                                             }
  
  11776                                             if (match.hit)
  
  11777                                             {
  
  11778                                                 *parentMatch5 = match;
  
  11779                                             }
  
  11780                                             else
  
  11781                                             {
  
  11782                                                 lexer.SetPos(save);
  
  11783                                                 break;
  
  11784                                             }
  
  11785                                         }
  
  11786                                     }
  
  11787                                 }
  
  11788                                 *parentMatch4 = match;
  
  11789                             }
  
  11790                             if (match.hit)
  
  11791                             {
  
  11792                                 System.Parsing.Match match(false);
  
  11793                                 System.Parsing.Match* parentMatch8 = &match;
  
  11794                                 {
  
  11795                                     long tmp = lexer.GetPos();
  
  11796                                     lexer.SetPos(save);
  
  11797                                     save = tmp;
  
  11798                                     System.Parsing.Match match(false);
  
  11799                                     System.Parsing.Match* parentMatch9 = &match;
  
  11800                                     {
  
  11801                                         System.Parsing.Match match(false);
  
  11802                                         System.Parsing.Match* parentMatch10 = &match;
  
  11803                                         {
  
  11804                                             System.Parsing.Match match(false);
  
  11805                                             System.Parsing.Match* parentMatch11 = &match;
  
  11806                                             {
  
  11807                                                 System.Parsing.Match match(true);
  
  11808                                                 System.Parsing.Match* parentMatch12 = &match;
  
  11809                                                 {
  
  11810                                                     while (true)
  
  11811                                                     {
  
  11812                                                         long save = lexer.GetPos();
  
  11813                                                         {
  
  11814                                                             System.Parsing.Match match(lexer.Pos() != lexer.End());
  
  11815                                                             for (const System.Parsing.Range& range : s49)
  
  11816                                                             {
  
  11817                                                                 if (*lexer >= range.first && *lexer <= range.last)
  
  11818                                                                 {
  
  11819                                                                     match.hit = false;
  
  11820                                                                     break;
  
  11821                                                                 }
  
  11822                                                             }
  
  11823                                                             if (match.hit)
  
  11824                                                             {
  
  11825                                                                 auto incResult0 = ++lexer;
  
  11826                                                                 if (incResult0.Error())
  
  11827                                                                 {
  
  11828                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  11829                                                                 }
  
  11830                                                             }
  
  11831                                                             if (match.hit)
  
  11832                                                             {
  
  11833                                                                 *parentMatch12 = match;
  
  11834                                                             }
  
  11835                                                             else
  
  11836                                                             {
  
  11837                                                                 lexer.SetPos(save);
  
  11838                                                                 break;
  
  11839                                                             }
  
  11840                                                         }
  
  11841                                                     }
  
  11842                                                 }
  
  11843                                                 *parentMatch11 = match;
  
  11844                                             }
  
  11845                                             if (match.hit)
  
  11846                                             {
  
  11847                                                 System.Parsing.Match match(false);
  
  11848                                                 System.Parsing.Match* parentMatch13 = &match;
  
  11849                                                 {
  
  11850                                                     System.Parsing.Match match(true);
  
  11851                                                     for (int i : s50)
  
  11852                                                     {
  
  11853                                                         if (*lexer == i)
  
  11854                                                         {
  
  11855                                                             auto incResult1 = ++lexer;
  
  11856                                                             if (incResult1.Error())
  
  11857                                                             {
  
  11858                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  11859                                                             }
  
  11860                                                         }
  
  11861                                                         else
  
  11862                                                         {
  
  11863                                                             match.hit = false;
  
  11864                                                             break;
  
  11865                                                         }
  
  11866                                                     }
  
  11867                                                     *parentMatch13 = match;
  
  11868                                                 }
  
  11869                                                 *parentMatch11 = match;
  
  11870                                             }
  
  11871                                             *parentMatch10 = match;
  
  11872                                         }
  
  11873                                         if (match.hit)
  
  11874                                         {
  
  11875                                             System.Parsing.Match match(false);
  
  11876                                             System.Parsing.Match* parentMatch14 = &match;
  
  11877                                             {
  
  11878                                                 System.Parsing.Match match(true);
  
  11879                                                 System.Parsing.Match* parentMatch15 = &match;
  
  11880                                                 {
  
  11881                                                     while (true)
  
  11882                                                     {
  
  11883                                                         long save = lexer.GetPos();
  
  11884                                                         {
  
  11885                                                             System.Parsing.Match match(lexer.Pos() != lexer.End());
  
  11886                                                             for (const System.Parsing.Range& range : s51)
  
  11887                                                             {
  
  11888                                                                 if (*lexer >= range.first && *lexer <= range.last)
  
  11889                                                                 {
  
  11890                                                                     match.hit = false;
  
  11891                                                                     break;
  
  11892                                                                 }
  
  11893                                                             }
  
  11894                                                             if (match.hit)
  
  11895                                                             {
  
  11896                                                                 auto incResult2 = ++lexer;
  
  11897                                                                 if (incResult2.Error())
  
  11898                                                                 {
  
  11899                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  11900                                                                 }
  
  11901                                                             }
  
  11902                                                             if (match.hit)
  
  11903                                                             {
  
  11904                                                                 *parentMatch15 = match;
  
  11905                                                             }
  
  11906                                                             else
  
  11907                                                             {
  
  11908                                                                 lexer.SetPos(save);
  
  11909                                                                 break;
  
  11910                                                             }
  
  11911                                                         }
  
  11912                                                     }
  
  11913                                                 }
  
  11914                                                 *parentMatch14 = match;
  
  11915                                             }
  
  11916                                             *parentMatch10 = match;
  
  11917                                         }
  
  11918                                         *parentMatch9 = match;
  
  11919                                     }
  
  11920                                     *parentMatch8 = match;
  
  11921                                 }
  
  11922                                 if (!match.hit)
  
  11923                                 {
  
  11924                                     lexer.SetPos(save);
  
  11925                                 }
  
  11926                                 *parentMatch4 = System.Parsing.Match(!match.hit, match.value);
  
  11927                             }
  
  11928                             *parentMatch3 = match;
  
  11929                         }
  
  11930                         if (match.hit)
  
  11931                         {
  
  11932                             auto result = processor->Text(span, lexer.FileIndex(), s);
  
  11933                             if (result.Error())
  
  11934                             {
  
  11935                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  11936                             }
  
  11937                         }
  
  11938                         *parentMatch2 = match;
  
  11939                     }
  
  11940                     *parentMatch1 = match;
  
  11941                 }
  
  11942                 if (match.hit)
  
  11943                 {
  
  11944                     #if (DEBUG)
  
  11945                         if (parser_debug_write_to_log)
  
  11946                         {
  
  11947                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CharData");
  
  11948                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11949                         }
  
  11950                     #endif
  
  11951                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  11952                 }
  
  11953                 *parentMatch0 = match;
  
  11954             }
  
  11955             #if (DEBUG)
  
  11956             if (parser_debug_write_to_log)
  
  11957             {
  
  11958                 if (match.hit)
  
  11959                 {
  
  11960                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CharData");
  
  11961                     if (result.Error())
  
  11962                     {
  
  11963                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11964                     }
  
  11965                 }
  
  11966                 else
  
  11967                 {
  
  11968                     auto result = System.Lex.WriteFailureToLog(lexer, u"CharData");
  
  11969                     if (result.Error())
  
  11970                     {
  
  11971                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11972                     }
  
  11973                 }
  
  11974             }
  
  11975             #endif
  
  11976             if (!match.hit)
  
  11977             {
  
  11978                 match.value = null;
  
  11979             }
  
  11980             return System.Result<System.Parsing.Match>(match);
  
  11981         }
  
  11982         public static System.Result<System.Parsing.Match> CDSect(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  11983         {
  
  11984             #if (DEBUG)
  
  11985             long parser_debug_match_pos = 0;
  
  11986             bool parser_debug_write_to_log = lexer.Log() != null;
  
  11987             if (parser_debug_write_to_log)
  
  11988             {
  
  11989                 parser_debug_match_pos = lexer.GetPos();
  
  11990                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"CDSect");
  
  11991                 if (result.Error())
  
  11992                 {
  
  11993                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  11994                 }
  
  11995             }
  
  11996             #endif
  
  11997             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475966);
  
  11998             ustring s = ustring();
  
  11999             System.Lex.Span span = System.Lex.Span();
  
  12000             System.UniquePtr<System.Parsing.Value<uchar>> chr;
  
  12001             System.Parsing.Match match(false);
  
  12002             System.Parsing.Match* parentMatch0 = &match;
  
  12003             {
  
  12004                 long pos = lexer.GetPos();
  
  12005                 System.Parsing.Match match(false);
  
  12006                 System.Parsing.Match* parentMatch1 = &match;
  
  12007                 {
  
  12008                     System.Parsing.Match match(false);
  
  12009                     System.Parsing.Match* parentMatch2 = &match;
  
  12010                     {
  
  12011                         System.Parsing.Match match(false);
  
  12012                         System.Parsing.Match* parentMatch3 = &match;
  
  12013                         {
  
  12014                             System.Parsing.Match match(true);
  
  12015                             for (int i : s52)
  
  12016                             {
  
  12017                                 if (*lexer == i)
  
  12018                                 {
  
  12019                                     auto incResult0 = ++lexer;
  
  12020                                     if (incResult0.Error())
  
  12021                                     {
  
  12022                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  12023                                     }
  
  12024                                 }
  
  12025                                 else
  
  12026                                 {
  
  12027                                     match.hit = false;
  
  12028                                     break;
  
  12029                                 }
  
  12030                             }
  
  12031                             *parentMatch3 = match;
  
  12032                         }
  
  12033                         if (match.hit)
  
  12034                         {
  
  12035                             System.Parsing.Match match(false);
  
  12036                             System.Parsing.Match* parentMatch4 = &match;
  
  12037                             {
  
  12038                                 System.Parsing.Match match(true);
  
  12039                                 System.Parsing.Match* parentMatch5 = &match;
  
  12040                                 {
  
  12041                                     while (true)
  
  12042                                     {
  
  12043                                         long save = lexer.GetPos();
  
  12044                                         {
  
  12045                                             System.Parsing.Match match(false);
  
  12046                                             System.Parsing.Match* parentMatch6 = &match;
  
  12047                                             {
  
  12048                                                 System.Parsing.Match match(false);
  
  12049                                                 System.Parsing.Match* parentMatch7 = &match;
  
  12050                                                 {
  
  12051                                                     long pos = lexer.GetPos();
  
  12052                                                     System.Parsing.Match match(false);
  
  12053                                                     System.Parsing.Match* parentMatch8 = &match;
  
  12054                                                     {
  
  12055                                                         System.Parsing.Match match(false);
  
  12056                                                         System.Parsing.Match* parentMatch9 = &match;
  
  12057                                                         long save = lexer.GetPos();
  
  12058                                                         {
  
  12059                                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Char(lexer);
  
  12060                                                             if (matchResult.Error())
  
  12061                                                             {
  
  12062                                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12063                                                             }
  
  12064                                                             System.Parsing.Match match = matchResult.Value();
  
  12065                                                             chr.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
  12066                                                             *parentMatch9 = match;
  
  12067                                                         }
  
  12068                                                         if (match.hit)
  
  12069                                                         {
  
  12070                                                             System.Parsing.Match match(false);
  
  12071                                                             System.Parsing.Match* parentMatch10 = &match;
  
  12072                                                             {
  
  12073                                                                 long tmp = lexer.GetPos();
  
  12074                                                                 lexer.SetPos(save);
  
  12075                                                                 save = tmp;
  
  12076                                                                 System.Parsing.Match match(true);
  
  12077                                                                 for (int i : s53)
  
  12078                                                                 {
  
  12079                                                                     if (*lexer == i)
  
  12080                                                                     {
  
  12081                                                                         auto incResult1 = ++lexer;
  
  12082                                                                         if (incResult1.Error())
  
  12083                                                                         {
  
  12084                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  12085                                                                         }
  
  12086                                                                     }
  
  12087                                                                     else
  
  12088                                                                     {
  
  12089                                                                         match.hit = false;
  
  12090                                                                         break;
  
  12091                                                                     }
  
  12092                                                                 }
  
  12093                                                                 *parentMatch10 = match;
  
  12094                                                             }
  
  12095                                                             if (!match.hit)
  
  12096                                                             {
  
  12097                                                                 lexer.SetPos(save);
  
  12098                                                             }
  
  12099                                                             *parentMatch9 = System.Parsing.Match(!match.hit, match.value);
  
  12100                                                         }
  
  12101                                                         *parentMatch8 = match;
  
  12102                                                     }
  
  12103                                                     if (match.hit)
  
  12104                                                     {
  
  12105                                                         if (!span.IsValid()) span = lexer.GetSpan(pos);
  
  12106                                                         s.Append(chr->value);
  
  12107                                                     }
  
  12108                                                     *parentMatch7 = match;
  
  12109                                                 }
  
  12110                                                 *parentMatch6 = match;
  
  12111                                             }
  
  12112                                             if (match.hit)
  
  12113                                             {
  
  12114                                                 *parentMatch5 = match;
  
  12115                                             }
  
  12116                                             else
  
  12117                                             {
  
  12118                                                 lexer.SetPos(save);
  
  12119                                                 break;
  
  12120                                             }
  
  12121                                         }
  
  12122                                     }
  
  12123                                 }
  
  12124                                 *parentMatch4 = match;
  
  12125                             }
  
  12126                             *parentMatch3 = match;
  
  12127                         }
  
  12128                         *parentMatch2 = match;
  
  12129                     }
  
  12130                     if (match.hit)
  
  12131                     {
  
  12132                         System.Parsing.Match match(false);
  
  12133                         System.Parsing.Match* parentMatch11 = &match;
  
  12134                         {
  
  12135                             System.Parsing.Match match(true);
  
  12136                             for (int i : s54)
  
  12137                             {
  
  12138                                 if (*lexer == i)
  
  12139                                 {
  
  12140                                     auto incResult2 = ++lexer;
  
  12141                                     if (incResult2.Error())
  
  12142                                     {
  
  12143                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  12144                                     }
  
  12145                                 }
  
  12146                                 else
  
  12147                                 {
  
  12148                                     match.hit = false;
  
  12149                                     break;
  
  12150                                 }
  
  12151                             }
  
  12152                             *parentMatch11 = match;
  
  12153                         }
  
  12154                         *parentMatch2 = match;
  
  12155                     }
  
  12156                     *parentMatch1 = match;
  
  12157                 }
  
  12158                 if (match.hit)
  
  12159                 {
  
  12160                     #if (DEBUG)
  
  12161                         if (parser_debug_write_to_log)
  
  12162                         {
  
  12163                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CDSect");
  
  12164                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12165                         }
  
  12166                     #endif
  
  12167                     auto result = processor->CDataSection(span, lexer.FileIndex(), s);
  
  12168                     if (result.Error())
  
  12169                     {
  
  12170                         return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  12171                     }
  
  12172                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  12173                 }
  
  12174                 *parentMatch0 = match;
  
  12175             }
  
  12176             #if (DEBUG)
  
  12177             if (parser_debug_write_to_log)
  
  12178             {
  
  12179                 if (match.hit)
  
  12180                 {
  
  12181                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CDSect");
  
  12182                     if (result.Error())
  
  12183                     {
  
  12184                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12185                     }
  
  12186                 }
  
  12187                 else
  
  12188                 {
  
  12189                     auto result = System.Lex.WriteFailureToLog(lexer, u"CDSect");
  
  12190                     if (result.Error())
  
  12191                     {
  
  12192                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12193                     }
  
  12194                 }
  
  12195             }
  
  12196             #endif
  
  12197             if (!match.hit)
  
  12198             {
  
  12199                 match.value = null;
  
  12200             }
  
  12201             return System.Result<System.Parsing.Match>(match);
  
  12202         }
  
  12203         public static System.Result<System.Parsing.Match> Attribute(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  12204         {
  
  12205             #if (DEBUG)
  
  12206             long parser_debug_match_pos = 0;
  
  12207             bool parser_debug_write_to_log = lexer.Log() != null;
  
  12208             if (parser_debug_write_to_log)
  
  12209             {
  
  12210                 parser_debug_match_pos = lexer.GetPos();
  
  12211                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Attribute");
  
  12212                 if (result.Error())
  
  12213                 {
  
  12214                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12215                 }
  
  12216             }
  
  12217             #endif
  
  12218             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475967);
  
  12219             System.Lex.Span span = System.Lex.Span();
  
  12220             System.UniquePtr<System.Parsing.Value<ustring>> attName;
  
  12221             System.UniquePtr<System.Parsing.Value<bool>> eq;
  
  12222             System.UniquePtr<System.Parsing.Value<ustring>> attValue;
  
  12223             System.Parsing.Match match(false);
  
  12224             System.Parsing.Match* parentMatch0 = &match;
  
  12225             {
  
  12226                 long pos = lexer.GetPos();
  
  12227                 System.Parsing.Match match(false);
  
  12228                 System.Parsing.Match* parentMatch1 = &match;
  
  12229                 {
  
  12230                     System.Parsing.Match match(false);
  
  12231                     System.Parsing.Match* parentMatch2 = &match;
  
  12232                     {
  
  12233                         System.Parsing.Match match(false);
  
  12234                         System.Parsing.Match* parentMatch3 = &match;
  
  12235                         {
  
  12236                             System.Parsing.Match match(false);
  
  12237                             System.Parsing.Match* parentMatch4 = &match;
  
  12238                             {
  
  12239                                 long pos = lexer.GetPos();
  
  12240                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  12241                                 if (matchResult.Error())
  
  12242                                 {
  
  12243                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12244                                 }
  
  12245                                 System.Parsing.Match match = matchResult.Value();
  
  12246                                 attName.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  12247                                 if (match.hit)
  
  12248                                 {
  
  12249                                     span = lexer.GetSpan(pos);
  
  12250                                 }
  
  12251                                 *parentMatch4 = match;
  
  12252                             }
  
  12253                             *parentMatch3 = match;
  
  12254                         }
  
  12255                         if (match.hit)
  
  12256                         {
  
  12257                             System.Parsing.Match match(false);
  
  12258                             System.Parsing.Match* parentMatch5 = &match;
  
  12259                             {
  
  12260                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Eq(lexer);
  
  12261                                 if (matchResult.Error())
  
  12262                                 {
  
  12263                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12264                                 }
  
  12265                                 System.Parsing.Match match = matchResult.Value();
  
  12266                                 eq.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  12267                                 *parentMatch5 = match;
  
  12268                             }
  
  12269                             *parentMatch3 = match;
  
  12270                         }
  
  12271                         *parentMatch2 = match;
  
  12272                     }
  
  12273                     if (match.hit)
  
  12274                     {
  
  12275                         System.Parsing.Match match(false);
  
  12276                         System.Parsing.Match* parentMatch6 = &match;
  
  12277                         {
  
  12278                             System.Parsing.Match match(false);
  
  12279                             System.Parsing.Match* parentMatch7 = &match;
  
  12280                             {
  
  12281                                 long pos = lexer.GetPos();
  
  12282                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.AttValue(lexer, processor);
  
  12283                                 if (matchResult.Error())
  
  12284                                 {
  
  12285                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12286                                 }
  
  12287                                 System.Parsing.Match match = matchResult.Value();
  
  12288                                 attValue.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  12289                                 if (match.hit)
  
  12290                                 {
  
  12291                                     auto result = processor->AddAttribute(attName->value, attValue->value, span, lexer.FileName(), pos);
  
  12292                                     if (result.Error())
  
  12293                                     {
  
  12294                                         return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  12295                                     }
  
  12296                                 }
  
  12297                                 *parentMatch7 = match;
  
  12298                             }
  
  12299                             *parentMatch6 = match;
  
  12300                         }
  
  12301                         *parentMatch2 = match;
  
  12302                     }
  
  12303                     *parentMatch1 = match;
  
  12304                 }
  
  12305                 if (match.hit)
  
  12306                 {
  
  12307                     #if (DEBUG)
  
  12308                         if (parser_debug_write_to_log)
  
  12309                         {
  
  12310                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Attribute");
  
  12311                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12312                         }
  
  12313                     #endif
  
  12314                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  12315                 }
  
  12316                 *parentMatch0 = match;
  
  12317             }
  
  12318             #if (DEBUG)
  
  12319             if (parser_debug_write_to_log)
  
  12320             {
  
  12321                 if (match.hit)
  
  12322                 {
  
  12323                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Attribute");
  
  12324                     if (result.Error())
  
  12325                     {
  
  12326                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12327                     }
  
  12328                 }
  
  12329                 else
  
  12330                 {
  
  12331                     auto result = System.Lex.WriteFailureToLog(lexer, u"Attribute");
  
  12332                     if (result.Error())
  
  12333                     {
  
  12334                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12335                     }
  
  12336                 }
  
  12337             }
  
  12338             #endif
  
  12339             if (!match.hit)
  
  12340             {
  
  12341                 match.value = null;
  
  12342             }
  
  12343             return System.Result<System.Parsing.Match>(match);
  
  12344         }
  
  12345         public static System.Result<System.Parsing.Match> AttValueDQ(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  12346         {
  
  12347             #if (DEBUG)
  
  12348             long parser_debug_match_pos = 0;
  
  12349             bool parser_debug_write_to_log = lexer.Log() != null;
  
  12350             if (parser_debug_write_to_log)
  
  12351             {
  
  12352                 parser_debug_match_pos = lexer.GetPos();
  
  12353                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"AttValueDQ");
  
  12354                 if (result.Error())
  
  12355                 {
  
  12356                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12357                 }
  
  12358             }
  
  12359             #endif
  
  12360             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475968);
  
  12361             System.UniquePtr<System.Parsing.Value<bool>> reference;
  
  12362             System.Parsing.Match match(false);
  
  12363             System.Parsing.Match* parentMatch0 = &match;
  
  12364             {
  
  12365                 System.Parsing.Match match(false);
  
  12366                 System.Parsing.Match* parentMatch1 = &match;
  
  12367                 {
  
  12368                     System.Parsing.Match match(false);
  
  12369                     System.Parsing.Match* parentMatch2 = &match;
  
  12370                     {
  
  12371                         long pos = lexer.GetPos();
  
  12372                         System.Parsing.Match match(false);
  
  12373                         if (*lexer == 34)
  
  12374                         {
  
  12375                             auto incResult0 = ++lexer;
  
  12376                             if (incResult0.Error())
  
  12377                             {
  
  12378                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  12379                             }
  
  12380                             match.hit = true;
  
  12381                         }
  
  12382                         if (match.hit)
  
  12383                         {
  
  12384                             auto result = processor->BeginAttributeValue();
  
  12385                             if (result.Error())
  
  12386                             {
  
  12387                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  12388                             }
  
  12389                         }
  
  12390                         *parentMatch2 = match;
  
  12391                     }
  
  12392                     *parentMatch1 = match;
  
  12393                 }
  
  12394                 if (match.hit)
  
  12395                 {
  
  12396                     System.Parsing.Match match(false);
  
  12397                     System.Parsing.Match* parentMatch3 = &match;
  
  12398                     {
  
  12399                         System.Parsing.Match match(true);
  
  12400                         System.Parsing.Match* parentMatch4 = &match;
  
  12401                         {
  
  12402                             while (true)
  
  12403                             {
  
  12404                                 long save = lexer.GetPos();
  
  12405                                 {
  
  12406                                     System.Parsing.Match match(false);
  
  12407                                     System.Parsing.Match* parentMatch5 = &match;
  
  12408                                     {
  
  12409                                         System.Parsing.Match match(false);
  
  12410                                         System.Parsing.Match* parentMatch6 = &match;
  
  12411                                         {
  
  12412                                             long save = lexer.GetPos();
  
  12413                                             System.Parsing.Match match(false);
  
  12414                                             System.Parsing.Match* parentMatch7 = &match;
  
  12415                                             {
  
  12416                                                 long pos = lexer.GetPos();
  
  12417                                                 System.Parsing.Match match(lexer.Pos() != lexer.End());
  
  12418                                                 for (const System.Parsing.Range& range : s55)
  
  12419                                                 {
  
  12420                                                     if (*lexer >= range.first && *lexer <= range.last)
  
  12421                                                     {
  
  12422                                                         match.hit = false;
  
  12423                                                         break;
  
  12424                                                     }
  
  12425                                                 }
  
  12426                                                 if (match.hit)
  
  12427                                                 {
  
  12428                                                     auto incResult1 = ++lexer;
  
  12429                                                     if (incResult1.Error())
  
  12430                                                     {
  
  12431                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  12432                                                     }
  
  12433                                                 }
  
  12434                                                 if (match.hit)
  
  12435                                                 {
  
  12436                                                     processor->AttValue().Append(lexer.GetToken(pos).ToString());
  
  12437                                                 }
  
  12438                                                 *parentMatch7 = match;
  
  12439                                             }
  
  12440                                             *parentMatch6 = match;
  
  12441                                             if (!match.hit)
  
  12442                                             {
  
  12443                                                 System.Parsing.Match match(false);
  
  12444                                                 System.Parsing.Match* parentMatch8 = &match;
  
  12445                                                 lexer.SetPos(save);
  
  12446                                                 {
  
  12447                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Reference(lexer, processor);
  
  12448                                                     if (matchResult.Error())
  
  12449                                                     {
  
  12450                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12451                                                     }
  
  12452                                                     System.Parsing.Match match = matchResult.Value();
  
  12453                                                     reference.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  12454                                                     *parentMatch8 = match;
  
  12455                                                 }
  
  12456                                                 *parentMatch6 = match;
  
  12457                                             }
  
  12458                                         }
  
  12459                                         *parentMatch5 = match;
  
  12460                                     }
  
  12461                                     if (match.hit)
  
  12462                                     {
  
  12463                                         *parentMatch4 = match;
  
  12464                                     }
  
  12465                                     else
  
  12466                                     {
  
  12467                                         lexer.SetPos(save);
  
  12468                                         break;
  
  12469                                     }
  
  12470                                 }
  
  12471                             }
  
  12472                         }
  
  12473                         *parentMatch3 = match;
  
  12474                     }
  
  12475                     *parentMatch1 = match;
  
  12476                 }
  
  12477                 *parentMatch0 = match;
  
  12478             }
  
  12479             if (match.hit)
  
  12480             {
  
  12481                 System.Parsing.Match match(false);
  
  12482                 System.Parsing.Match* parentMatch9 = &match;
  
  12483                 {
  
  12484                     System.Parsing.Match match(false);
  
  12485                     System.Parsing.Match* parentMatch10 = &match;
  
  12486                     {
  
  12487                         long pos = lexer.GetPos();
  
  12488                         System.Parsing.Match match(false);
  
  12489                         if (*lexer == 34)
  
  12490                         {
  
  12491                             auto incResult2 = ++lexer;
  
  12492                             if (incResult2.Error())
  
  12493                             {
  
  12494                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  12495                             }
  
  12496                             match.hit = true;
  
  12497                         }
  
  12498                         if (match.hit)
  
  12499                         {
  
  12500                             #if (DEBUG)
  
  12501                                 if (parser_debug_write_to_log)
  
  12502                                 {
  
  12503                                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttValueDQ");
  
  12504                                     if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12505                                 }
  
  12506                             #endif
  
  12507                             ustring value = processor->AttValue();
  
  12508                             auto result = processor->EndAttributeValue();
  
  12509                             if (result.Error())
  
  12510                             {
  
  12511                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  12512                             }
  
  12513                             return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<ustring>(value)));
  
  12514                         }
  
  12515                         *parentMatch10 = match;
  
  12516                     }
  
  12517                     *parentMatch9 = match;
  
  12518                 }
  
  12519                 *parentMatch0 = match;
  
  12520             }
  
  12521             #if (DEBUG)
  
  12522             if (parser_debug_write_to_log)
  
  12523             {
  
  12524                 if (match.hit)
  
  12525                 {
  
  12526                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttValueDQ");
  
  12527                     if (result.Error())
  
  12528                     {
  
  12529                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12530                     }
  
  12531                 }
  
  12532                 else
  
  12533                 {
  
  12534                     auto result = System.Lex.WriteFailureToLog(lexer, u"AttValueDQ");
  
  12535                     if (result.Error())
  
  12536                     {
  
  12537                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12538                     }
  
  12539                 }
  
  12540             }
  
  12541             #endif
  
  12542             if (!match.hit)
  
  12543             {
  
  12544                 match.value = null;
  
  12545             }
  
  12546             return System.Result<System.Parsing.Match>(match);
  
  12547         }
  
  12548         public static System.Result<System.Parsing.Match> AttValueSQ(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  12549         {
  
  12550             #if (DEBUG)
  
  12551             long parser_debug_match_pos = 0;
  
  12552             bool parser_debug_write_to_log = lexer.Log() != null;
  
  12553             if (parser_debug_write_to_log)
  
  12554             {
  
  12555                 parser_debug_match_pos = lexer.GetPos();
  
  12556                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"AttValueSQ");
  
  12557                 if (result.Error())
  
  12558                 {
  
  12559                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12560                 }
  
  12561             }
  
  12562             #endif
  
  12563             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475969);
  
  12564             System.UniquePtr<System.Parsing.Value<bool>> reference;
  
  12565             System.Parsing.Match match(false);
  
  12566             System.Parsing.Match* parentMatch0 = &match;
  
  12567             {
  
  12568                 System.Parsing.Match match(false);
  
  12569                 System.Parsing.Match* parentMatch1 = &match;
  
  12570                 {
  
  12571                     System.Parsing.Match match(false);
  
  12572                     System.Parsing.Match* parentMatch2 = &match;
  
  12573                     {
  
  12574                         long pos = lexer.GetPos();
  
  12575                         System.Parsing.Match match(false);
  
  12576                         if (*lexer == 39)
  
  12577                         {
  
  12578                             auto incResult0 = ++lexer;
  
  12579                             if (incResult0.Error())
  
  12580                             {
  
  12581                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  12582                             }
  
  12583                             match.hit = true;
  
  12584                         }
  
  12585                         if (match.hit)
  
  12586                         {
  
  12587                             auto result = processor->BeginAttributeValue();
  
  12588                             if (result.Error())
  
  12589                             {
  
  12590                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  12591                             }
  
  12592                         }
  
  12593                         *parentMatch2 = match;
  
  12594                     }
  
  12595                     *parentMatch1 = match;
  
  12596                 }
  
  12597                 if (match.hit)
  
  12598                 {
  
  12599                     System.Parsing.Match match(false);
  
  12600                     System.Parsing.Match* parentMatch3 = &match;
  
  12601                     {
  
  12602                         System.Parsing.Match match(true);
  
  12603                         System.Parsing.Match* parentMatch4 = &match;
  
  12604                         {
  
  12605                             while (true)
  
  12606                             {
  
  12607                                 long save = lexer.GetPos();
  
  12608                                 {
  
  12609                                     System.Parsing.Match match(false);
  
  12610                                     System.Parsing.Match* parentMatch5 = &match;
  
  12611                                     {
  
  12612                                         System.Parsing.Match match(false);
  
  12613                                         System.Parsing.Match* parentMatch6 = &match;
  
  12614                                         {
  
  12615                                             long save = lexer.GetPos();
  
  12616                                             System.Parsing.Match match(false);
  
  12617                                             System.Parsing.Match* parentMatch7 = &match;
  
  12618                                             {
  
  12619                                                 long pos = lexer.GetPos();
  
  12620                                                 System.Parsing.Match match(lexer.Pos() != lexer.End());
  
  12621                                                 for (const System.Parsing.Range& range : s56)
  
  12622                                                 {
  
  12623                                                     if (*lexer >= range.first && *lexer <= range.last)
  
  12624                                                     {
  
  12625                                                         match.hit = false;
  
  12626                                                         break;
  
  12627                                                     }
  
  12628                                                 }
  
  12629                                                 if (match.hit)
  
  12630                                                 {
  
  12631                                                     auto incResult1 = ++lexer;
  
  12632                                                     if (incResult1.Error())
  
  12633                                                     {
  
  12634                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  12635                                                     }
  
  12636                                                 }
  
  12637                                                 if (match.hit)
  
  12638                                                 {
  
  12639                                                     processor->AttValue().Append(lexer.GetToken(pos).ToString());
  
  12640                                                 }
  
  12641                                                 *parentMatch7 = match;
  
  12642                                             }
  
  12643                                             *parentMatch6 = match;
  
  12644                                             if (!match.hit)
  
  12645                                             {
  
  12646                                                 System.Parsing.Match match(false);
  
  12647                                                 System.Parsing.Match* parentMatch8 = &match;
  
  12648                                                 lexer.SetPos(save);
  
  12649                                                 {
  
  12650                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Reference(lexer, processor);
  
  12651                                                     if (matchResult.Error())
  
  12652                                                     {
  
  12653                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12654                                                     }
  
  12655                                                     System.Parsing.Match match = matchResult.Value();
  
  12656                                                     reference.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  12657                                                     *parentMatch8 = match;
  
  12658                                                 }
  
  12659                                                 *parentMatch6 = match;
  
  12660                                             }
  
  12661                                         }
  
  12662                                         *parentMatch5 = match;
  
  12663                                     }
  
  12664                                     if (match.hit)
  
  12665                                     {
  
  12666                                         *parentMatch4 = match;
  
  12667                                     }
  
  12668                                     else
  
  12669                                     {
  
  12670                                         lexer.SetPos(save);
  
  12671                                         break;
  
  12672                                     }
  
  12673                                 }
  
  12674                             }
  
  12675                         }
  
  12676                         *parentMatch3 = match;
  
  12677                     }
  
  12678                     *parentMatch1 = match;
  
  12679                 }
  
  12680                 *parentMatch0 = match;
  
  12681             }
  
  12682             if (match.hit)
  
  12683             {
  
  12684                 System.Parsing.Match match(false);
  
  12685                 System.Parsing.Match* parentMatch9 = &match;
  
  12686                 {
  
  12687                     System.Parsing.Match match(false);
  
  12688                     System.Parsing.Match* parentMatch10 = &match;
  
  12689                     {
  
  12690                         long pos = lexer.GetPos();
  
  12691                         System.Parsing.Match match(false);
  
  12692                         if (*lexer == 39)
  
  12693                         {
  
  12694                             auto incResult2 = ++lexer;
  
  12695                             if (incResult2.Error())
  
  12696                             {
  
  12697                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  12698                             }
  
  12699                             match.hit = true;
  
  12700                         }
  
  12701                         if (match.hit)
  
  12702                         {
  
  12703                             #if (DEBUG)
  
  12704                                 if (parser_debug_write_to_log)
  
  12705                                 {
  
  12706                                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttValueSQ");
  
  12707                                     if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12708                                 }
  
  12709                             #endif
  
  12710                             ustring value = processor->AttValue();
  
  12711                             auto result = processor->EndAttributeValue();
  
  12712                             if (result.Error())
  
  12713                             {
  
  12714                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  12715                             }
  
  12716                             return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<ustring>(value)));
  
  12717                         }
  
  12718                         *parentMatch10 = match;
  
  12719                     }
  
  12720                     *parentMatch9 = match;
  
  12721                 }
  
  12722                 *parentMatch0 = match;
  
  12723             }
  
  12724             #if (DEBUG)
  
  12725             if (parser_debug_write_to_log)
  
  12726             {
  
  12727                 if (match.hit)
  
  12728                 {
  
  12729                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttValueSQ");
  
  12730                     if (result.Error())
  
  12731                     {
  
  12732                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12733                     }
  
  12734                 }
  
  12735                 else
  
  12736                 {
  
  12737                     auto result = System.Lex.WriteFailureToLog(lexer, u"AttValueSQ");
  
  12738                     if (result.Error())
  
  12739                     {
  
  12740                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12741                     }
  
  12742                 }
  
  12743             }
  
  12744             #endif
  
  12745             if (!match.hit)
  
  12746             {
  
  12747                 match.value = null;
  
  12748             }
  
  12749             return System.Result<System.Parsing.Match>(match);
  
  12750         }
  
  12751         public static System.Result<System.Parsing.Match> AttValue(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  12752         {
  
  12753             #if (DEBUG)
  
  12754             long parser_debug_match_pos = 0;
  
  12755             bool parser_debug_write_to_log = lexer.Log() != null;
  
  12756             if (parser_debug_write_to_log)
  
  12757             {
  
  12758                 parser_debug_match_pos = lexer.GetPos();
  
  12759                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"AttValue");
  
  12760                 if (result.Error())
  
  12761                 {
  
  12762                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12763                 }
  
  12764             }
  
  12765             #endif
  
  12766             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475970);
  
  12767             System.UniquePtr<System.Parsing.Value<ustring>> attValueDQ;
  
  12768             System.UniquePtr<System.Parsing.Value<ustring>> attValueSQ;
  
  12769             System.Parsing.Match match(false);
  
  12770             System.Parsing.Match* parentMatch0 = &match;
  
  12771             {
  
  12772                 long save = lexer.GetPos();
  
  12773                 System.Parsing.Match match(false);
  
  12774                 System.Parsing.Match* parentMatch1 = &match;
  
  12775                 {
  
  12776                     long pos = lexer.GetPos();
  
  12777                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.AttValueDQ(lexer, processor);
  
  12778                     if (matchResult.Error())
  
  12779                     {
  
  12780                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12781                     }
  
  12782                     System.Parsing.Match match = matchResult.Value();
  
  12783                     attValueDQ.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  12784                     if (match.hit)
  
  12785                     {
  
  12786                         #if (DEBUG)
  
  12787                             if (parser_debug_write_to_log)
  
  12788                             {
  
  12789                                 auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttValue");
  
  12790                                 if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12791                             }
  
  12792                         #endif
  
  12793                         return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<ustring>(attValueDQ->value)));
  
  12794                     }
  
  12795                     *parentMatch1 = match;
  
  12796                 }
  
  12797                 *parentMatch0 = match;
  
  12798                 if (!match.hit)
  
  12799                 {
  
  12800                     System.Parsing.Match match(false);
  
  12801                     System.Parsing.Match* parentMatch2 = &match;
  
  12802                     lexer.SetPos(save);
  
  12803                     {
  
  12804                         System.Parsing.Match match(false);
  
  12805                         System.Parsing.Match* parentMatch3 = &match;
  
  12806                         {
  
  12807                             long pos = lexer.GetPos();
  
  12808                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.AttValueSQ(lexer, processor);
  
  12809                             if (matchResult.Error())
  
  12810                             {
  
  12811                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12812                             }
  
  12813                             System.Parsing.Match match = matchResult.Value();
  
  12814                             attValueSQ.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  12815                             if (match.hit)
  
  12816                             {
  
  12817                                 #if (DEBUG)
  
  12818                                     if (parser_debug_write_to_log)
  
  12819                                     {
  
  12820                                         auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttValue");
  
  12821                                         if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12822                                     }
  
  12823                                 #endif
  
  12824                                 return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<ustring>(attValueSQ->value)));
  
  12825                             }
  
  12826                             *parentMatch3 = match;
  
  12827                         }
  
  12828                         *parentMatch2 = match;
  
  12829                     }
  
  12830                     *parentMatch0 = match;
  
  12831                 }
  
  12832             }
  
  12833             #if (DEBUG)
  
  12834             if (parser_debug_write_to_log)
  
  12835             {
  
  12836                 if (match.hit)
  
  12837                 {
  
  12838                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"AttValue");
  
  12839                     if (result.Error())
  
  12840                     {
  
  12841                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12842                     }
  
  12843                 }
  
  12844                 else
  
  12845                 {
  
  12846                     auto result = System.Lex.WriteFailureToLog(lexer, u"AttValue");
  
  12847                     if (result.Error())
  
  12848                     {
  
  12849                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12850                     }
  
  12851                 }
  
  12852             }
  
  12853             #endif
  
  12854             if (!match.hit)
  
  12855             {
  
  12856                 match.value = null;
  
  12857             }
  
  12858             return System.Result<System.Parsing.Match>(match);
  
  12859         }
  
  12860         public static System.Result<System.Parsing.Match> EntityRef(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  12861         {
  
  12862             #if (DEBUG)
  
  12863             long parser_debug_match_pos = 0;
  
  12864             bool parser_debug_write_to_log = lexer.Log() != null;
  
  12865             if (parser_debug_write_to_log)
  
  12866             {
  
  12867                 parser_debug_match_pos = lexer.GetPos();
  
  12868                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"EntityRef");
  
  12869                 if (result.Error())
  
  12870                 {
  
  12871                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12872                 }
  
  12873             }
  
  12874             #endif
  
  12875             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475971);
  
  12876             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
  12877             System.Parsing.Match match(false);
  
  12878             System.Parsing.Match* parentMatch0 = &match;
  
  12879             {
  
  12880                 long pos = lexer.GetPos();
  
  12881                 System.Parsing.Match match(false);
  
  12882                 System.Parsing.Match* parentMatch1 = &match;
  
  12883                 {
  
  12884                     System.Parsing.Match match(false);
  
  12885                     System.Parsing.Match* parentMatch2 = &match;
  
  12886                     {
  
  12887                         long pos = lexer.GetPos();
  
  12888                         System.Parsing.Match match(false);
  
  12889                         System.Parsing.Match* parentMatch3 = &match;
  
  12890                         {
  
  12891                             System.Parsing.Match match(false);
  
  12892                             System.Parsing.Match* parentMatch4 = &match;
  
  12893                             {
  
  12894                                 System.Parsing.Match match(false);
  
  12895                                 System.Parsing.Match* parentMatch5 = &match;
  
  12896                                 {
  
  12897                                     System.Parsing.Match match(false);
  
  12898                                     if (*lexer == 38)
  
  12899                                     {
  
  12900                                         auto incResult0 = ++lexer;
  
  12901                                         if (incResult0.Error())
  
  12902                                         {
  
  12903                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  12904                                         }
  
  12905                                         match.hit = true;
  
  12906                                     }
  
  12907                                     *parentMatch5 = match;
  
  12908                                 }
  
  12909                                 if (match.hit)
  
  12910                                 {
  
  12911                                     System.Parsing.Match match(false);
  
  12912                                     System.Parsing.Match* parentMatch6 = &match;
  
  12913                                     {
  
  12914                                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  12915                                         if (matchResult.Error())
  
  12916                                         {
  
  12917                                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  12918                                         }
  
  12919                                         System.Parsing.Match match = matchResult.Value();
  
  12920                                         name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  12921                                         *parentMatch6 = match;
  
  12922                                     }
  
  12923                                     *parentMatch5 = match;
  
  12924                                 }
  
  12925                                 *parentMatch4 = match;
  
  12926                             }
  
  12927                             if (match.hit)
  
  12928                             {
  
  12929                                 System.Parsing.Match match(false);
  
  12930                                 System.Parsing.Match* parentMatch7 = &match;
  
  12931                                 {
  
  12932                                     System.Parsing.Match match(false);
  
  12933                                     if (*lexer == 59)
  
  12934                                     {
  
  12935                                         auto incResult1 = ++lexer;
  
  12936                                         if (incResult1.Error())
  
  12937                                         {
  
  12938                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  12939                                         }
  
  12940                                         match.hit = true;
  
  12941                                     }
  
  12942                                     *parentMatch7 = match;
  
  12943                                 }
  
  12944                                 *parentMatch4 = match;
  
  12945                             }
  
  12946                             *parentMatch3 = match;
  
  12947                         }
  
  12948                         if (match.hit)
  
  12949                         {
  
  12950                             auto result = processor->EntityRef(name->value, lexer.GetSpan(pos), lexer.FileIndex(), lexer.FileName());
  
  12951                             if (result.Error())
  
  12952                             {
  
  12953                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  12954                             }
  
  12955                         }
  
  12956                         *parentMatch2 = match;
  
  12957                     }
  
  12958                     *parentMatch1 = match;
  
  12959                 }
  
  12960                 if (match.hit)
  
  12961                 {
  
  12962                     #if (DEBUG)
  
  12963                         if (parser_debug_write_to_log)
  
  12964                         {
  
  12965                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityRef");
  
  12966                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12967                         }
  
  12968                     #endif
  
  12969                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  12970                 }
  
  12971                 *parentMatch0 = match;
  
  12972             }
  
  12973             #if (DEBUG)
  
  12974             if (parser_debug_write_to_log)
  
  12975             {
  
  12976                 if (match.hit)
  
  12977                 {
  
  12978                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"EntityRef");
  
  12979                     if (result.Error())
  
  12980                     {
  
  12981                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12982                     }
  
  12983                 }
  
  12984                 else
  
  12985                 {
  
  12986                     auto result = System.Lex.WriteFailureToLog(lexer, u"EntityRef");
  
  12987                     if (result.Error())
  
  12988                     {
  
  12989                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  12990                     }
  
  12991                 }
  
  12992             }
  
  12993             #endif
  
  12994             if (!match.hit)
  
  12995             {
  
  12996                 match.value = null;
  
  12997             }
  
  12998             return System.Result<System.Parsing.Match>(match);
  
  12999         }
  
  13000         public static System.Result<System.Parsing.Match> DecCodePoint(LexerT& lexer)
  
  13001         {
  
  13002             #if (DEBUG)
  
  13003             long parser_debug_match_pos = 0;
  
  13004             bool parser_debug_write_to_log = lexer.Log() != null;
  
  13005             if (parser_debug_write_to_log)
  
  13006             {
  
  13007                 parser_debug_match_pos = lexer.GetPos();
  
  13008                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"DecCodePoint");
  
  13009                 if (result.Error())
  
  13010                 {
  
  13011                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13012                 }
  
  13013             }
  
  13014             #endif
  
  13015             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475972);
  
  13016             uint val = uint();
  
  13017             System.Parsing.Match match(false);
  
  13018             System.Parsing.Match* parentMatch0 = &match;
  
  13019             {
  
  13020                 long pos = lexer.GetPos();
  
  13021                 System.Parsing.Match match(false);
  
  13022                 System.Parsing.Match* parentMatch1 = &match;
  
  13023                 {
  
  13024                     System.Parsing.Match match(false);
  
  13025                     System.Parsing.Match* parentMatch2 = &match;
  
  13026                     {
  
  13027                         System.Parsing.Match match(false);
  
  13028                         System.Parsing.Match* parentMatch3 = &match;
  
  13029                         {
  
  13030                             System.Parsing.Match match(false);
  
  13031                             System.Parsing.Match* parentMatch4 = &match;
  
  13032                             {
  
  13033                                 long pos = lexer.GetPos();
  
  13034                                 System.Parsing.Match match(false);
  
  13035                                 for (const System.Parsing.Range& range : s57)
  
  13036                                 {
  
  13037                                     if (*lexer >= range.first && *lexer <= range.last)
  
  13038                                     {
  
  13039                                         match.hit = true;
  
  13040                                         auto incResult0 = ++lexer;
  
  13041                                         if (incResult0.Error())
  
  13042                                         {
  
  13043                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  13044                                         }
  
  13045                                         break;
  
  13046                                     }
  
  13047                                 }
  
  13048                                 if (match.hit)
  
  13049                                 {
  
  13050                                     Token token = lexer.GetToken(pos);
  
  13051                                     val = 10u * val + cast<uint>(token.id) - cast<uint>('0');
  
  13052                                 }
  
  13053                                 *parentMatch4 = match;
  
  13054                             }
  
  13055                             *parentMatch3 = match;
  
  13056                         }
  
  13057                         *parentMatch2 = match;
  
  13058                     }
  
  13059                     if (match.hit)
  
  13060                     {
  
  13061                         System.Parsing.Match match(true);
  
  13062                         System.Parsing.Match* parentMatch5 = &match;
  
  13063                         while (true)
  
  13064                         {
  
  13065                             long save = lexer.GetPos();
  
  13066                             {
  
  13067                                 System.Parsing.Match match(false);
  
  13068                                 System.Parsing.Match* parentMatch6 = &match;
  
  13069                                 {
  
  13070                                     System.Parsing.Match match(false);
  
  13071                                     System.Parsing.Match* parentMatch7 = &match;
  
  13072                                     {
  
  13073                                         long pos = lexer.GetPos();
  
  13074                                         System.Parsing.Match match(false);
  
  13075                                         for (const System.Parsing.Range& range : s57)
  
  13076                                         {
  
  13077                                             if (*lexer >= range.first && *lexer <= range.last)
  
  13078                                             {
  
  13079                                                 match.hit = true;
  
  13080                                                 auto incResult1 = ++lexer;
  
  13081                                                 if (incResult1.Error())
  
  13082                                                 {
  
  13083                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  13084                                                 }
  
  13085                                                 break;
  
  13086                                             }
  
  13087                                         }
  
  13088                                         if (match.hit)
  
  13089                                         {
  
  13090                                             Token token = lexer.GetToken(pos);
  
  13091                                             val = 10u * val + cast<uint>(token.id) - cast<uint>('0');
  
  13092                                         }
  
  13093                                         *parentMatch7 = match;
  
  13094                                     }
  
  13095                                     *parentMatch6 = match;
  
  13096                                 }
  
  13097                                 if (match.hit)
  
  13098                                 {
  
  13099                                     *parentMatch5 = match;
  
  13100                                 }
  
  13101                                 else
  
  13102                                 {
  
  13103                                     lexer.SetPos(save);
  
  13104                                     break;
  
  13105                                 }
  
  13106                             }
  
  13107                         }
  
  13108                     }
  
  13109                     *parentMatch1 = match;
  
  13110                 }
  
  13111                 if (match.hit)
  
  13112                 {
  
  13113                     #if (DEBUG)
  
  13114                         if (parser_debug_write_to_log)
  
  13115                         {
  
  13116                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DecCodePoint");
  
  13117                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13118                         }
  
  13119                     #endif
  
  13120                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<uint>(val)));
  
  13121                 }
  
  13122                 *parentMatch0 = match;
  
  13123             }
  
  13124             #if (DEBUG)
  
  13125             if (parser_debug_write_to_log)
  
  13126             {
  
  13127                 if (match.hit)
  
  13128                 {
  
  13129                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"DecCodePoint");
  
  13130                     if (result.Error())
  
  13131                     {
  
  13132                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13133                     }
  
  13134                 }
  
  13135                 else
  
  13136                 {
  
  13137                     auto result = System.Lex.WriteFailureToLog(lexer, u"DecCodePoint");
  
  13138                     if (result.Error())
  
  13139                     {
  
  13140                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13141                     }
  
  13142                 }
  
  13143             }
  
  13144             #endif
  
  13145             if (!match.hit)
  
  13146             {
  
  13147                 match.value = null;
  
  13148             }
  
  13149             return System.Result<System.Parsing.Match>(match);
  
  13150         }
  
  13151         public static System.Result<System.Parsing.Match> HexCodePoint(LexerT& lexer)
  
  13152         {
  
  13153             #if (DEBUG)
  
  13154             long parser_debug_match_pos = 0;
  
  13155             bool parser_debug_write_to_log = lexer.Log() != null;
  
  13156             if (parser_debug_write_to_log)
  
  13157             {
  
  13158                 parser_debug_match_pos = lexer.GetPos();
  
  13159                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"HexCodePoint");
  
  13160                 if (result.Error())
  
  13161                 {
  
  13162                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13163                 }
  
  13164             }
  
  13165             #endif
  
  13166             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475973);
  
  13167             uint val = uint();
  
  13168             System.Parsing.Match match(false);
  
  13169             System.Parsing.Match* parentMatch0 = &match;
  
  13170             {
  
  13171                 long pos = lexer.GetPos();
  
  13172                 System.Parsing.Match match(false);
  
  13173                 System.Parsing.Match* parentMatch1 = &match;
  
  13174                 {
  
  13175                     System.Parsing.Match match(false);
  
  13176                     System.Parsing.Match* parentMatch2 = &match;
  
  13177                     {
  
  13178                         System.Parsing.Match match(false);
  
  13179                         System.Parsing.Match* parentMatch3 = &match;
  
  13180                         {
  
  13181                             System.Parsing.Match match(false);
  
  13182                             System.Parsing.Match* parentMatch4 = &match;
  
  13183                             {
  
  13184                                 long pos = lexer.GetPos();
  
  13185                                 System.Parsing.Match match(false);
  
  13186                                 for (const System.Parsing.Range& range : s58)
  
  13187                                 {
  
  13188                                     if (*lexer >= range.first && *lexer <= range.last)
  
  13189                                     {
  
  13190                                         match.hit = true;
  
  13191                                         auto incResult0 = ++lexer;
  
  13192                                         if (incResult0.Error())
  
  13193                                         {
  
  13194                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  13195                                         }
  
  13196                                         break;
  
  13197                                     }
  
  13198                                 }
  
  13199                                 if (match.hit)
  
  13200                                 {
  
  13201                                     Token token = lexer.GetToken(pos);
  
  13202                                     if (token.id >= cast<int>('0') && token.id <= cast<int>('9')) val = 16u * val + cast<uint>(token.id) - cast<uint>('0');
  
  13203                                     else if (token.id >= cast<int>('a') && token.id <= cast<int>('f')) val = 16u * val + 10u + cast<uint>(token.id) - cast<uint>('a');
  
  13204                                     else if (token.id >= cast<int>('A') && token.id <= cast<int>('F')) val = 16u * val + 10u + cast<uint>(token.id) - cast<uint>('A');
  
  13205                                 }
  
  13206                                 *parentMatch4 = match;
  
  13207                             }
  
  13208                             *parentMatch3 = match;
  
  13209                         }
  
  13210                         *parentMatch2 = match;
  
  13211                     }
  
  13212                     if (match.hit)
  
  13213                     {
  
  13214                         System.Parsing.Match match(true);
  
  13215                         System.Parsing.Match* parentMatch5 = &match;
  
  13216                         while (true)
  
  13217                         {
  
  13218                             long save = lexer.GetPos();
  
  13219                             {
  
  13220                                 System.Parsing.Match match(false);
  
  13221                                 System.Parsing.Match* parentMatch6 = &match;
  
  13222                                 {
  
  13223                                     System.Parsing.Match match(false);
  
  13224                                     System.Parsing.Match* parentMatch7 = &match;
  
  13225                                     {
  
  13226                                         long pos = lexer.GetPos();
  
  13227                                         System.Parsing.Match match(false);
  
  13228                                         for (const System.Parsing.Range& range : s58)
  
  13229                                         {
  
  13230                                             if (*lexer >= range.first && *lexer <= range.last)
  
  13231                                             {
  
  13232                                                 match.hit = true;
  
  13233                                                 auto incResult1 = ++lexer;
  
  13234                                                 if (incResult1.Error())
  
  13235                                                 {
  
  13236                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  13237                                                 }
  
  13238                                                 break;
  
  13239                                             }
  
  13240                                         }
  
  13241                                         if (match.hit)
  
  13242                                         {
  
  13243                                             Token token = lexer.GetToken(pos);
  
  13244                                             if (token.id >= cast<int>('0') && token.id <= cast<int>('9')) val = 16u * val + cast<uint>(token.id) - cast<uint>('0');
  
  13245                                             else if (token.id >= cast<int>('a') && token.id <= cast<int>('f')) val = 16u * val + 10u + cast<uint>(token.id) - cast<uint>('a');
  
  13246                                             else if (token.id >= cast<int>('A') && token.id <= cast<int>('F')) val = 16u * val + 10u + cast<uint>(token.id) - cast<uint>('A');
  
  13247                                         }
  
  13248                                         *parentMatch7 = match;
  
  13249                                     }
  
  13250                                     *parentMatch6 = match;
  
  13251                                 }
  
  13252                                 if (match.hit)
  
  13253                                 {
  
  13254                                     *parentMatch5 = match;
  
  13255                                 }
  
  13256                                 else
  
  13257                                 {
  
  13258                                     lexer.SetPos(save);
  
  13259                                     break;
  
  13260                                 }
  
  13261                             }
  
  13262                         }
  
  13263                     }
  
  13264                     *parentMatch1 = match;
  
  13265                 }
  
  13266                 if (match.hit)
  
  13267                 {
  
  13268                     #if (DEBUG)
  
  13269                         if (parser_debug_write_to_log)
  
  13270                         {
  
  13271                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"HexCodePoint");
  
  13272                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13273                         }
  
  13274                     #endif
  
  13275                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<uint>(val)));
  
  13276                 }
  
  13277                 *parentMatch0 = match;
  
  13278             }
  
  13279             #if (DEBUG)
  
  13280             if (parser_debug_write_to_log)
  
  13281             {
  
  13282                 if (match.hit)
  
  13283                 {
  
  13284                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"HexCodePoint");
  
  13285                     if (result.Error())
  
  13286                     {
  
  13287                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13288                     }
  
  13289                 }
  
  13290                 else
  
  13291                 {
  
  13292                     auto result = System.Lex.WriteFailureToLog(lexer, u"HexCodePoint");
  
  13293                     if (result.Error())
  
  13294                     {
  
  13295                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13296                     }
  
  13297                 }
  
  13298             }
  
  13299             #endif
  
  13300             if (!match.hit)
  
  13301             {
  
  13302                 match.value = null;
  
  13303             }
  
  13304             return System.Result<System.Parsing.Match>(match);
  
  13305         }
  
  13306         public static System.Result<System.Parsing.Match> CharRef(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  13307         {
  
  13308             #if (DEBUG)
  
  13309             long parser_debug_match_pos = 0;
  
  13310             bool parser_debug_write_to_log = lexer.Log() != null;
  
  13311             if (parser_debug_write_to_log)
  
  13312             {
  
  13313                 parser_debug_match_pos = lexer.GetPos();
  
  13314                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"CharRef");
  
  13315                 if (result.Error())
  
  13316                 {
  
  13317                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13318                 }
  
  13319             }
  
  13320             #endif
  
  13321             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475974);
  
  13322             System.UniquePtr<System.Parsing.Value<uint>> decCodePoint;
  
  13323             System.UniquePtr<System.Parsing.Value<uint>> hexCodePoint;
  
  13324             System.Parsing.Match match(false);
  
  13325             System.Parsing.Match* parentMatch0 = &match;
  
  13326             {
  
  13327                 long pos = lexer.GetPos();
  
  13328                 System.Parsing.Match match(false);
  
  13329                 System.Parsing.Match* parentMatch1 = &match;
  
  13330                 {
  
  13331                     System.Parsing.Match match(false);
  
  13332                     System.Parsing.Match* parentMatch2 = &match;
  
  13333                     {
  
  13334                         long save = lexer.GetPos();
  
  13335                         System.Parsing.Match match(false);
  
  13336                         System.Parsing.Match* parentMatch3 = &match;
  
  13337                         {
  
  13338                             long pos = lexer.GetPos();
  
  13339                             System.Parsing.Match match(false);
  
  13340                             System.Parsing.Match* parentMatch4 = &match;
  
  13341                             {
  
  13342                                 System.Parsing.Match match(false);
  
  13343                                 System.Parsing.Match* parentMatch5 = &match;
  
  13344                                 {
  
  13345                                     System.Parsing.Match match(false);
  
  13346                                     System.Parsing.Match* parentMatch6 = &match;
  
  13347                                     {
  
  13348                                         System.Parsing.Match match(true);
  
  13349                                         for (int i : s59)
  
  13350                                         {
  
  13351                                             if (*lexer == i)
  
  13352                                             {
  
  13353                                                 auto incResult0 = ++lexer;
  
  13354                                                 if (incResult0.Error())
  
  13355                                                 {
  
  13356                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  13357                                                 }
  
  13358                                             }
  
  13359                                             else
  
  13360                                             {
  
  13361                                                 match.hit = false;
  
  13362                                                 break;
  
  13363                                             }
  
  13364                                         }
  
  13365                                         *parentMatch6 = match;
  
  13366                                     }
  
  13367                                     if (match.hit)
  
  13368                                     {
  
  13369                                         System.Parsing.Match match(false);
  
  13370                                         System.Parsing.Match* parentMatch7 = &match;
  
  13371                                         {
  
  13372                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.DecCodePoint(lexer);
  
  13373                                             if (matchResult.Error())
  
  13374                                             {
  
  13375                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13376                                             }
  
  13377                                             System.Parsing.Match match = matchResult.Value();
  
  13378                                             decCodePoint.Reset(cast<System.Parsing.Value<uint>*>(match.value));
  
  13379                                             *parentMatch7 = match;
  
  13380                                         }
  
  13381                                         *parentMatch6 = match;
  
  13382                                     }
  
  13383                                     *parentMatch5 = match;
  
  13384                                 }
  
  13385                                 if (match.hit)
  
  13386                                 {
  
  13387                                     System.Parsing.Match match(false);
  
  13388                                     System.Parsing.Match* parentMatch8 = &match;
  
  13389                                     {
  
  13390                                         System.Parsing.Match match(false);
  
  13391                                         if (*lexer == 59)
  
  13392                                         {
  
  13393                                             auto incResult1 = ++lexer;
  
  13394                                             if (incResult1.Error())
  
  13395                                             {
  
  13396                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  13397                                             }
  
  13398                                             match.hit = true;
  
  13399                                         }
  
  13400                                         *parentMatch8 = match;
  
  13401                                     }
  
  13402                                     *parentMatch5 = match;
  
  13403                                 }
  
  13404                                 *parentMatch4 = match;
  
  13405                             }
  
  13406                             if (match.hit)
  
  13407                             {
  
  13408                                 auto result = processor->Text(lexer.GetSpan(pos), lexer.FileIndex(), ustring(cast<uchar>(decCodePoint->value)));
  
  13409                                 if (result.Error())
  
  13410                                 {
  
  13411                                     return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  13412                                 }
  
  13413                             }
  
  13414                             *parentMatch3 = match;
  
  13415                         }
  
  13416                         *parentMatch2 = match;
  
  13417                         if (!match.hit)
  
  13418                         {
  
  13419                             System.Parsing.Match match(false);
  
  13420                             System.Parsing.Match* parentMatch9 = &match;
  
  13421                             lexer.SetPos(save);
  
  13422                             {
  
  13423                                 System.Parsing.Match match(false);
  
  13424                                 System.Parsing.Match* parentMatch10 = &match;
  
  13425                                 {
  
  13426                                     long pos = lexer.GetPos();
  
  13427                                     System.Parsing.Match match(false);
  
  13428                                     System.Parsing.Match* parentMatch11 = &match;
  
  13429                                     {
  
  13430                                         System.Parsing.Match match(false);
  
  13431                                         System.Parsing.Match* parentMatch12 = &match;
  
  13432                                         {
  
  13433                                             System.Parsing.Match match(false);
  
  13434                                             System.Parsing.Match* parentMatch13 = &match;
  
  13435                                             {
  
  13436                                                 System.Parsing.Match match(true);
  
  13437                                                 for (int i : s60)
  
  13438                                                 {
  
  13439                                                     if (*lexer == i)
  
  13440                                                     {
  
  13441                                                         auto incResult2 = ++lexer;
  
  13442                                                         if (incResult2.Error())
  
  13443                                                         {
  
  13444                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  13445                                                         }
  
  13446                                                     }
  
  13447                                                     else
  
  13448                                                     {
  
  13449                                                         match.hit = false;
  
  13450                                                         break;
  
  13451                                                     }
  
  13452                                                 }
  
  13453                                                 *parentMatch13 = match;
  
  13454                                             }
  
  13455                                             if (match.hit)
  
  13456                                             {
  
  13457                                                 System.Parsing.Match match(false);
  
  13458                                                 System.Parsing.Match* parentMatch14 = &match;
  
  13459                                                 {
  
  13460                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.HexCodePoint(lexer);
  
  13461                                                     if (matchResult.Error())
  
  13462                                                     {
  
  13463                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13464                                                     }
  
  13465                                                     System.Parsing.Match match = matchResult.Value();
  
  13466                                                     hexCodePoint.Reset(cast<System.Parsing.Value<uint>*>(match.value));
  
  13467                                                     *parentMatch14 = match;
  
  13468                                                 }
  
  13469                                                 *parentMatch13 = match;
  
  13470                                             }
  
  13471                                             *parentMatch12 = match;
  
  13472                                         }
  
  13473                                         if (match.hit)
  
  13474                                         {
  
  13475                                             System.Parsing.Match match(false);
  
  13476                                             System.Parsing.Match* parentMatch15 = &match;
  
  13477                                             {
  
  13478                                                 System.Parsing.Match match(false);
  
  13479                                                 if (*lexer == 59)
  
  13480                                                 {
  
  13481                                                     auto incResult3 = ++lexer;
  
  13482                                                     if (incResult3.Error())
  
  13483                                                     {
  
  13484                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
  13485                                                     }
  
  13486                                                     match.hit = true;
  
  13487                                                 }
  
  13488                                                 *parentMatch15 = match;
  
  13489                                             }
  
  13490                                             *parentMatch12 = match;
  
  13491                                         }
  
  13492                                         *parentMatch11 = match;
  
  13493                                     }
  
  13494                                     if (match.hit)
  
  13495                                     {
  
  13496                                         auto result = processor->Text(lexer.GetSpan(pos), lexer.FileIndex(), ustring(cast<uchar>(hexCodePoint->value)));
  
  13497                                         if (result.Error())
  
  13498                                         {
  
  13499                                             return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  13500                                         }
  
  13501                                     }
  
  13502                                     *parentMatch10 = match;
  
  13503                                 }
  
  13504                                 *parentMatch9 = match;
  
  13505                             }
  
  13506                             *parentMatch2 = match;
  
  13507                         }
  
  13508                     }
  
  13509                     *parentMatch1 = match;
  
  13510                 }
  
  13511                 if (match.hit)
  
  13512                 {
  
  13513                     #if (DEBUG)
  
  13514                         if (parser_debug_write_to_log)
  
  13515                         {
  
  13516                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CharRef");
  
  13517                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13518                         }
  
  13519                     #endif
  
  13520                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  13521                 }
  
  13522                 *parentMatch0 = match;
  
  13523             }
  
  13524             #if (DEBUG)
  
  13525             if (parser_debug_write_to_log)
  
  13526             {
  
  13527                 if (match.hit)
  
  13528                 {
  
  13529                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"CharRef");
  
  13530                     if (result.Error())
  
  13531                     {
  
  13532                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13533                     }
  
  13534                 }
  
  13535                 else
  
  13536                 {
  
  13537                     auto result = System.Lex.WriteFailureToLog(lexer, u"CharRef");
  
  13538                     if (result.Error())
  
  13539                     {
  
  13540                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13541                     }
  
  13542                 }
  
  13543             }
  
  13544             #endif
  
  13545             if (!match.hit)
  
  13546             {
  
  13547                 match.value = null;
  
  13548             }
  
  13549             return System.Result<System.Parsing.Match>(match);
  
  13550         }
  
  13551         public static System.Result<System.Parsing.Match> Reference(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  13552         {
  
  13553             #if (DEBUG)
  
  13554             long parser_debug_match_pos = 0;
  
  13555             bool parser_debug_write_to_log = lexer.Log() != null;
  
  13556             if (parser_debug_write_to_log)
  
  13557             {
  
  13558                 parser_debug_match_pos = lexer.GetPos();
  
  13559                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Reference");
  
  13560                 if (result.Error())
  
  13561                 {
  
  13562                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13563                 }
  
  13564             }
  
  13565             #endif
  
  13566             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475975);
  
  13567             System.UniquePtr<System.Parsing.Value<bool>> entityRef;
  
  13568             System.UniquePtr<System.Parsing.Value<bool>> charRef;
  
  13569             System.Parsing.Match match(false);
  
  13570             System.Parsing.Match* parentMatch0 = &match;
  
  13571             {
  
  13572                 long pos = lexer.GetPos();
  
  13573                 System.Parsing.Match match(false);
  
  13574                 System.Parsing.Match* parentMatch1 = &match;
  
  13575                 {
  
  13576                     System.Parsing.Match match(false);
  
  13577                     System.Parsing.Match* parentMatch2 = &match;
  
  13578                     {
  
  13579                         long save = lexer.GetPos();
  
  13580                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.EntityRef(lexer, processor);
  
  13581                         if (matchResult.Error())
  
  13582                         {
  
  13583                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13584                         }
  
  13585                         System.Parsing.Match match = matchResult.Value();
  
  13586                         entityRef.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  13587                         *parentMatch2 = match;
  
  13588                         if (!match.hit)
  
  13589                         {
  
  13590                             System.Parsing.Match match(false);
  
  13591                             System.Parsing.Match* parentMatch3 = &match;
  
  13592                             lexer.SetPos(save);
  
  13593                             {
  
  13594                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.CharRef(lexer, processor);
  
  13595                                 if (matchResult.Error())
  
  13596                                 {
  
  13597                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13598                                 }
  
  13599                                 System.Parsing.Match match = matchResult.Value();
  
  13600                                 charRef.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  13601                                 *parentMatch3 = match;
  
  13602                             }
  
  13603                             *parentMatch2 = match;
  
  13604                         }
  
  13605                     }
  
  13606                     *parentMatch1 = match;
  
  13607                 }
  
  13608                 if (match.hit)
  
  13609                 {
  
  13610                     #if (DEBUG)
  
  13611                         if (parser_debug_write_to_log)
  
  13612                         {
  
  13613                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Reference");
  
  13614                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13615                         }
  
  13616                     #endif
  
  13617                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  13618                 }
  
  13619                 *parentMatch0 = match;
  
  13620             }
  
  13621             #if (DEBUG)
  
  13622             if (parser_debug_write_to_log)
  
  13623             {
  
  13624                 if (match.hit)
  
  13625                 {
  
  13626                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Reference");
  
  13627                     if (result.Error())
  
  13628                     {
  
  13629                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13630                     }
  
  13631                 }
  
  13632                 else
  
  13633                 {
  
  13634                     auto result = System.Lex.WriteFailureToLog(lexer, u"Reference");
  
  13635                     if (result.Error())
  
  13636                     {
  
  13637                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13638                     }
  
  13639                 }
  
  13640             }
  
  13641             #endif
  
  13642             if (!match.hit)
  
  13643             {
  
  13644                 match.value = null;
  
  13645             }
  
  13646             return System.Result<System.Parsing.Match>(match);
  
  13647         }
  
  13648         public static System.Result<System.Parsing.Match> Misc(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  13649         {
  
  13650             #if (DEBUG)
  
  13651             long parser_debug_match_pos = 0;
  
  13652             bool parser_debug_write_to_log = lexer.Log() != null;
  
  13653             if (parser_debug_write_to_log)
  
  13654             {
  
  13655                 parser_debug_match_pos = lexer.GetPos();
  
  13656                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Misc");
  
  13657                 if (result.Error())
  
  13658                 {
  
  13659                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13660                 }
  
  13661             }
  
  13662             #endif
  
  13663             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475976);
  
  13664             System.UniquePtr<System.Parsing.Value<bool>> comment;
  
  13665             System.UniquePtr<System.Parsing.Value<bool>> pi;
  
  13666             System.UniquePtr<System.Parsing.Value<bool>> s;
  
  13667             System.Parsing.Match match(false);
  
  13668             System.Parsing.Match* parentMatch0 = &match;
  
  13669             {
  
  13670                 long pos = lexer.GetPos();
  
  13671                 System.Parsing.Match match(false);
  
  13672                 System.Parsing.Match* parentMatch1 = &match;
  
  13673                 {
  
  13674                     System.Parsing.Match match(false);
  
  13675                     System.Parsing.Match* parentMatch2 = &match;
  
  13676                     {
  
  13677                         long save = lexer.GetPos();
  
  13678                         System.Parsing.Match match(false);
  
  13679                         System.Parsing.Match* parentMatch3 = &match;
  
  13680                         {
  
  13681                             long save = lexer.GetPos();
  
  13682                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Comment(lexer, processor);
  
  13683                             if (matchResult.Error())
  
  13684                             {
  
  13685                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13686                             }
  
  13687                             System.Parsing.Match match = matchResult.Value();
  
  13688                             comment.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  13689                             *parentMatch3 = match;
  
  13690                             if (!match.hit)
  
  13691                             {
  
  13692                                 System.Parsing.Match match(false);
  
  13693                                 System.Parsing.Match* parentMatch4 = &match;
  
  13694                                 lexer.SetPos(save);
  
  13695                                 {
  
  13696                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PI(lexer, processor);
  
  13697                                     if (matchResult.Error())
  
  13698                                     {
  
  13699                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13700                                     }
  
  13701                                     System.Parsing.Match match = matchResult.Value();
  
  13702                                     pi.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  13703                                     *parentMatch4 = match;
  
  13704                                 }
  
  13705                                 *parentMatch3 = match;
  
  13706                             }
  
  13707                         }
  
  13708                         *parentMatch2 = match;
  
  13709                         if (!match.hit)
  
  13710                         {
  
  13711                             System.Parsing.Match match(false);
  
  13712                             System.Parsing.Match* parentMatch5 = &match;
  
  13713                             lexer.SetPos(save);
  
  13714                             {
  
  13715                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  13716                                 if (matchResult.Error())
  
  13717                                 {
  
  13718                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13719                                 }
  
  13720                                 System.Parsing.Match match = matchResult.Value();
  
  13721                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  13722                                 *parentMatch5 = match;
  
  13723                             }
  
  13724                             *parentMatch2 = match;
  
  13725                         }
  
  13726                     }
  
  13727                     *parentMatch1 = match;
  
  13728                 }
  
  13729                 if (match.hit)
  
  13730                 {
  
  13731                     #if (DEBUG)
  
  13732                         if (parser_debug_write_to_log)
  
  13733                         {
  
  13734                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Misc");
  
  13735                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13736                         }
  
  13737                     #endif
  
  13738                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  13739                 }
  
  13740                 *parentMatch0 = match;
  
  13741             }
  
  13742             #if (DEBUG)
  
  13743             if (parser_debug_write_to_log)
  
  13744             {
  
  13745                 if (match.hit)
  
  13746                 {
  
  13747                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Misc");
  
  13748                     if (result.Error())
  
  13749                     {
  
  13750                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13751                     }
  
  13752                 }
  
  13753                 else
  
  13754                 {
  
  13755                     auto result = System.Lex.WriteFailureToLog(lexer, u"Misc");
  
  13756                     if (result.Error())
  
  13757                     {
  
  13758                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13759                     }
  
  13760                 }
  
  13761             }
  
  13762             #endif
  
  13763             if (!match.hit)
  
  13764             {
  
  13765                 match.value = null;
  
  13766             }
  
  13767             return System.Result<System.Parsing.Match>(match);
  
  13768         }
  
  13769         public static System.Result<System.Parsing.Match> Comment(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  13770         {
  
  13771             #if (DEBUG)
  
  13772             long parser_debug_match_pos = 0;
  
  13773             bool parser_debug_write_to_log = lexer.Log() != null;
  
  13774             if (parser_debug_write_to_log)
  
  13775             {
  
  13776                 parser_debug_match_pos = lexer.GetPos();
  
  13777                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Comment");
  
  13778                 if (result.Error())
  
  13779                 {
  
  13780                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  13781                 }
  
  13782             }
  
  13783             #endif
  
  13784             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475977);
  
  13785             ustring s = ustring();
  
  13786             System.Lex.Span span = System.Lex.Span();
  
  13787             System.UniquePtr<System.Parsing.Value<uchar>> chr;
  
  13788             System.Parsing.Match match(false);
  
  13789             System.Parsing.Match* parentMatch0 = &match;
  
  13790             {
  
  13791                 long pos = lexer.GetPos();
  
  13792                 System.Parsing.Match match(false);
  
  13793                 System.Parsing.Match* parentMatch1 = &match;
  
  13794                 {
  
  13795                     System.Parsing.Match match(false);
  
  13796                     System.Parsing.Match* parentMatch2 = &match;
  
  13797                     {
  
  13798                         System.Parsing.Match match(false);
  
  13799                         System.Parsing.Match* parentMatch3 = &match;
  
  13800                         {
  
  13801                             System.Parsing.Match match(true);
  
  13802                             for (int i : s61)
  
  13803                             {
  
  13804                                 if (*lexer == i)
  
  13805                                 {
  
  13806                                     auto incResult0 = ++lexer;
  
  13807                                     if (incResult0.Error())
  
  13808                                     {
  
  13809                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  13810                                     }
  
  13811                                 }
  
  13812                                 else
  
  13813                                 {
  
  13814                                     match.hit = false;
  
  13815                                     break;
  
  13816                                 }
  
  13817                             }
  
  13818                             *parentMatch3 = match;
  
  13819                         }
  
  13820                         if (match.hit)
  
  13821                         {
  
  13822                             System.Parsing.Match match(false);
  
  13823                             System.Parsing.Match* parentMatch4 = &match;
  
  13824                             {
  
  13825                                 System.Parsing.Match match(true);
  
  13826                                 System.Parsing.Match* parentMatch5 = &match;
  
  13827                                 {
  
  13828                                     while (true)
  
  13829                                     {
  
  13830                                         long save = lexer.GetPos();
  
  13831                                         {
  
  13832                                             System.Parsing.Match match(false);
  
  13833                                             System.Parsing.Match* parentMatch6 = &match;
  
  13834                                             {
  
  13835                                                 System.Parsing.Match match(false);
  
  13836                                                 System.Parsing.Match* parentMatch7 = &match;
  
  13837                                                 {
  
  13838                                                     long save = lexer.GetPos();
  
  13839                                                     System.Parsing.Match match(false);
  
  13840                                                     System.Parsing.Match* parentMatch8 = &match;
  
  13841                                                     {
  
  13842                                                         long pos = lexer.GetPos();
  
  13843                                                         System.Parsing.Match match(false);
  
  13844                                                         System.Parsing.Match* parentMatch9 = &match;
  
  13845                                                         {
  
  13846                                                             System.Parsing.Match match(false);
  
  13847                                                             System.Parsing.Match* parentMatch10 = &match;
  
  13848                                                             long save = lexer.GetPos();
  
  13849                                                             {
  
  13850                                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Char(lexer);
  
  13851                                                                 if (matchResult.Error())
  
  13852                                                                 {
  
  13853                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13854                                                                 }
  
  13855                                                                 System.Parsing.Match match = matchResult.Value();
  
  13856                                                                 chr.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
  13857                                                                 *parentMatch10 = match;
  
  13858                                                             }
  
  13859                                                             if (match.hit)
  
  13860                                                             {
  
  13861                                                                 System.Parsing.Match match(false);
  
  13862                                                                 System.Parsing.Match* parentMatch11 = &match;
  
  13863                                                                 {
  
  13864                                                                     long tmp = lexer.GetPos();
  
  13865                                                                     lexer.SetPos(save);
  
  13866                                                                     save = tmp;
  
  13867                                                                     System.Parsing.Match match(false);
  
  13868                                                                     if (*lexer == 45)
  
  13869                                                                     {
  
  13870                                                                         auto incResult1 = ++lexer;
  
  13871                                                                         if (incResult1.Error())
  
  13872                                                                         {
  
  13873                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  13874                                                                         }
  
  13875                                                                         match.hit = true;
  
  13876                                                                     }
  
  13877                                                                     *parentMatch11 = match;
  
  13878                                                                 }
  
  13879                                                                 if (!match.hit)
  
  13880                                                                 {
  
  13881                                                                     lexer.SetPos(save);
  
  13882                                                                 }
  
  13883                                                                 *parentMatch10 = System.Parsing.Match(!match.hit, match.value);
  
  13884                                                             }
  
  13885                                                             *parentMatch9 = match;
  
  13886                                                         }
  
  13887                                                         if (match.hit)
  
  13888                                                         {
  
  13889                                                             span = lexer.GetSpan(pos);
  
  13890                                                             s.Append(chr->value);
  
  13891                                                         }
  
  13892                                                         *parentMatch8 = match;
  
  13893                                                     }
  
  13894                                                     *parentMatch7 = match;
  
  13895                                                     if (!match.hit)
  
  13896                                                     {
  
  13897                                                         System.Parsing.Match match(false);
  
  13898                                                         System.Parsing.Match* parentMatch12 = &match;
  
  13899                                                         lexer.SetPos(save);
  
  13900                                                         {
  
  13901                                                             System.Parsing.Match match(false);
  
  13902                                                             System.Parsing.Match* parentMatch13 = &match;
  
  13903                                                             {
  
  13904                                                                 System.Parsing.Match match(false);
  
  13905                                                                 if (*lexer == 45)
  
  13906                                                                 {
  
  13907                                                                     auto incResult2 = ++lexer;
  
  13908                                                                     if (incResult2.Error())
  
  13909                                                                     {
  
  13910                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  13911                                                                     }
  
  13912                                                                     match.hit = true;
  
  13913                                                                 }
  
  13914                                                                 *parentMatch13 = match;
  
  13915                                                             }
  
  13916                                                             if (match.hit)
  
  13917                                                             {
  
  13918                                                                 System.Parsing.Match match(false);
  
  13919                                                                 System.Parsing.Match* parentMatch14 = &match;
  
  13920                                                                 {
  
  13921                                                                     System.Parsing.Match match(false);
  
  13922                                                                     System.Parsing.Match* parentMatch15 = &match;
  
  13923                                                                     {
  
  13924                                                                         long pos = lexer.GetPos();
  
  13925                                                                         System.Parsing.Match match(false);
  
  13926                                                                         System.Parsing.Match* parentMatch16 = &match;
  
  13927                                                                         {
  
  13928                                                                             System.Parsing.Match match(false);
  
  13929                                                                             System.Parsing.Match* parentMatch17 = &match;
  
  13930                                                                             long save = lexer.GetPos();
  
  13931                                                                             {
  
  13932                                                                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Char(lexer);
  
  13933                                                                                 if (matchResult.Error())
  
  13934                                                                                 {
  
  13935                                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  13936                                                                                 }
  
  13937                                                                                 System.Parsing.Match match = matchResult.Value();
  
  13938                                                                                 chr.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
  13939                                                                                 *parentMatch17 = match;
  
  13940                                                                             }
  
  13941                                                                             if (match.hit)
  
  13942                                                                             {
  
  13943                                                                                 System.Parsing.Match match(false);
  
  13944                                                                                 System.Parsing.Match* parentMatch18 = &match;
  
  13945                                                                                 {
  
  13946                                                                                     long tmp = lexer.GetPos();
  
  13947                                                                                     lexer.SetPos(save);
  
  13948                                                                                     save = tmp;
  
  13949                                                                                     System.Parsing.Match match(false);
  
  13950                                                                                     if (*lexer == 45)
  
  13951                                                                                     {
  
  13952                                                                                         auto incResult3 = ++lexer;
  
  13953                                                                                         if (incResult3.Error())
  
  13954                                                                                         {
  
  13955                                                                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult3.GetErrorId()));
  
  13956                                                                                         }
  
  13957                                                                                         match.hit = true;
  
  13958                                                                                     }
  
  13959                                                                                     *parentMatch18 = match;
  
  13960                                                                                 }
  
  13961                                                                                 if (!match.hit)
  
  13962                                                                                 {
  
  13963                                                                                     lexer.SetPos(save);
  
  13964                                                                                 }
  
  13965                                                                                 *parentMatch17 = System.Parsing.Match(!match.hit, match.value);
  
  13966                                                                             }
  
  13967                                                                             *parentMatch16 = match;
  
  13968                                                                         }
  
  13969                                                                         if (match.hit)
  
  13970                                                                         {
  
  13971                                                                             span.Union(lexer.GetSpan(pos));
  
  13972                                                                             s.Append('-').Append(chr->value);
  
  13973                                                                         }
  
  13974                                                                         *parentMatch15 = match;
  
  13975                                                                     }
  
  13976                                                                     *parentMatch14 = match;
  
  13977                                                                 }
  
  13978                                                                 *parentMatch13 = match;
  
  13979                                                             }
  
  13980                                                             *parentMatch12 = match;
  
  13981                                                         }
  
  13982                                                         *parentMatch7 = match;
  
  13983                                                     }
  
  13984                                                 }
  
  13985                                                 *parentMatch6 = match;
  
  13986                                             }
  
  13987                                             if (match.hit)
  
  13988                                             {
  
  13989                                                 *parentMatch5 = match;
  
  13990                                             }
  
  13991                                             else
  
  13992                                             {
  
  13993                                                 lexer.SetPos(save);
  
  13994                                                 break;
  
  13995                                             }
  
  13996                                         }
  
  13997                                     }
  
  13998                                 }
  
  13999                                 *parentMatch4 = match;
  
  14000                             }
  
  14001                             *parentMatch3 = match;
  
  14002                         }
  
  14003                         *parentMatch2 = match;
  
  14004                     }
  
  14005                     if (match.hit)
  
  14006                     {
  
  14007                         System.Parsing.Match match(false);
  
  14008                         System.Parsing.Match* parentMatch19 = &match;
  
  14009                         {
  
  14010                             System.Parsing.Match match(true);
  
  14011                             for (int i : s62)
  
  14012                             {
  
  14013                                 if (*lexer == i)
  
  14014                                 {
  
  14015                                     auto incResult4 = ++lexer;
  
  14016                                     if (incResult4.Error())
  
  14017                                     {
  
  14018                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult4.GetErrorId()));
  
  14019                                     }
  
  14020                                 }
  
  14021                                 else
  
  14022                                 {
  
  14023                                     match.hit = false;
  
  14024                                     break;
  
  14025                                 }
  
  14026                             }
  
  14027                             *parentMatch19 = match;
  
  14028                         }
  
  14029                         *parentMatch2 = match;
  
  14030                     }
  
  14031                     *parentMatch1 = match;
  
  14032                 }
  
  14033                 if (match.hit)
  
  14034                 {
  
  14035                     #if (DEBUG)
  
  14036                         if (parser_debug_write_to_log)
  
  14037                         {
  
  14038                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Comment");
  
  14039                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14040                         }
  
  14041                     #endif
  
  14042                     auto result = processor->Comment(span, lexer.FileIndex(), s);
  
  14043                     if (result.Error())
  
  14044                     {
  
  14045                         return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  14046                     }
  
  14047                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  14048                 }
  
  14049                 *parentMatch0 = match;
  
  14050             }
  
  14051             #if (DEBUG)
  
  14052             if (parser_debug_write_to_log)
  
  14053             {
  
  14054                 if (match.hit)
  
  14055                 {
  
  14056                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Comment");
  
  14057                     if (result.Error())
  
  14058                     {
  
  14059                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14060                     }
  
  14061                 }
  
  14062                 else
  
  14063                 {
  
  14064                     auto result = System.Lex.WriteFailureToLog(lexer, u"Comment");
  
  14065                     if (result.Error())
  
  14066                     {
  
  14067                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14068                     }
  
  14069                 }
  
  14070             }
  
  14071             #endif
  
  14072             if (!match.hit)
  
  14073             {
  
  14074                 match.value = null;
  
  14075             }
  
  14076             return System.Result<System.Parsing.Match>(match);
  
  14077         }
  
  14078         public static System.Result<System.Parsing.Match> PI(LexerT& lexer, System.Xml.XmlProcessor* processor)
  
  14079         {
  
  14080             #if (DEBUG)
  
  14081             long parser_debug_match_pos = 0;
  
  14082             bool parser_debug_write_to_log = lexer.Log() != null;
  
  14083             if (parser_debug_write_to_log)
  
  14084             {
  
  14085                 parser_debug_match_pos = lexer.GetPos();
  
  14086                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PI");
  
  14087                 if (result.Error())
  
  14088                 {
  
  14089                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14090                 }
  
  14091             }
  
  14092             #endif
  
  14093             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475978);
  
  14094             ustring data = ustring();
  
  14095             System.Lex.Span span = System.Lex.Span();
  
  14096             System.UniquePtr<System.Parsing.Value<ustring>> target;
  
  14097             System.UniquePtr<System.Parsing.Value<bool>> s;
  
  14098             System.UniquePtr<System.Parsing.Value<uchar>> chr;
  
  14099             System.Parsing.Match match(false);
  
  14100             System.Parsing.Match* parentMatch0 = &match;
  
  14101             {
  
  14102                 long pos = lexer.GetPos();
  
  14103                 System.Parsing.Match match(false);
  
  14104                 System.Parsing.Match* parentMatch1 = &match;
  
  14105                 {
  
  14106                     System.Parsing.Match match(false);
  
  14107                     System.Parsing.Match* parentMatch2 = &match;
  
  14108                     {
  
  14109                         long pos = lexer.GetPos();
  
  14110                         System.Parsing.Match match(false);
  
  14111                         System.Parsing.Match* parentMatch3 = &match;
  
  14112                         {
  
  14113                             System.Parsing.Match match(false);
  
  14114                             System.Parsing.Match* parentMatch4 = &match;
  
  14115                             {
  
  14116                                 System.Parsing.Match match(false);
  
  14117                                 System.Parsing.Match* parentMatch5 = &match;
  
  14118                                 {
  
  14119                                     System.Parsing.Match match(false);
  
  14120                                     System.Parsing.Match* parentMatch6 = &match;
  
  14121                                     {
  
  14122                                         System.Parsing.Match match(false);
  
  14123                                         System.Parsing.Match* parentMatch7 = &match;
  
  14124                                         {
  
  14125                                             System.Parsing.Match match(true);
  
  14126                                             for (int i : s63)
  
  14127                                             {
  
  14128                                                 if (*lexer == i)
  
  14129                                                 {
  
  14130                                                     auto incResult0 = ++lexer;
  
  14131                                                     if (incResult0.Error())
  
  14132                                                     {
  
  14133                                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  14134                                                     }
  
  14135                                                 }
  
  14136                                                 else
  
  14137                                                 {
  
  14138                                                     match.hit = false;
  
  14139                                                     break;
  
  14140                                                 }
  
  14141                                             }
  
  14142                                             *parentMatch7 = match;
  
  14143                                         }
  
  14144                                         if (match.hit)
  
  14145                                         {
  
  14146                                             System.Parsing.Match match(false);
  
  14147                                             System.Parsing.Match* parentMatch8 = &match;
  
  14148                                             {
  
  14149                                                 System.Parsing.Match match(false);
  
  14150                                                 System.Parsing.Match* parentMatch9 = &match;
  
  14151                                                 {
  
  14152                                                     long pos = lexer.GetPos();
  
  14153                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.PITarget(lexer);
  
  14154                                                     if (matchResult.Error())
  
  14155                                                     {
  
  14156                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  14157                                                     }
  
  14158                                                     System.Parsing.Match match = matchResult.Value();
  
  14159                                                     target.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  14160                                                     if (match.hit)
  
  14161                                                     {
  
  14162                                                         span = lexer.GetSpan(pos);
  
  14163                                                     }
  
  14164                                                     *parentMatch9 = match;
  
  14165                                                 }
  
  14166                                                 *parentMatch8 = match;
  
  14167                                             }
  
  14168                                             *parentMatch7 = match;
  
  14169                                         }
  
  14170                                         *parentMatch6 = match;
  
  14171                                     }
  
  14172                                     if (match.hit)
  
  14173                                     {
  
  14174                                         System.Parsing.Match match(false);
  
  14175                                         System.Parsing.Match* parentMatch10 = &match;
  
  14176                                         {
  
  14177                                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  14178                                             if (matchResult.Error())
  
  14179                                             {
  
  14180                                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  14181                                             }
  
  14182                                             System.Parsing.Match match = matchResult.Value();
  
  14183                                             s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  14184                                             *parentMatch10 = match;
  
  14185                                         }
  
  14186                                         *parentMatch6 = match;
  
  14187                                     }
  
  14188                                     *parentMatch5 = match;
  
  14189                                 }
  
  14190                                 if (match.hit)
  
  14191                                 {
  
  14192                                     System.Parsing.Match match(false);
  
  14193                                     System.Parsing.Match* parentMatch11 = &match;
  
  14194                                     {
  
  14195                                         System.Parsing.Match match(true);
  
  14196                                         System.Parsing.Match* parentMatch12 = &match;
  
  14197                                         {
  
  14198                                             while (true)
  
  14199                                             {
  
  14200                                                 long save = lexer.GetPos();
  
  14201                                                 {
  
  14202                                                     System.Parsing.Match match(false);
  
  14203                                                     System.Parsing.Match* parentMatch13 = &match;
  
  14204                                                     {
  
  14205                                                         System.Parsing.Match match(false);
  
  14206                                                         System.Parsing.Match* parentMatch14 = &match;
  
  14207                                                         {
  
  14208                                                             long pos = lexer.GetPos();
  
  14209                                                             System.Parsing.Match match(false);
  
  14210                                                             System.Parsing.Match* parentMatch15 = &match;
  
  14211                                                             {
  
  14212                                                                 System.Parsing.Match match(false);
  
  14213                                                                 System.Parsing.Match* parentMatch16 = &match;
  
  14214                                                                 long save = lexer.GetPos();
  
  14215                                                                 {
  
  14216                                                                     System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Char(lexer);
  
  14217                                                                     if (matchResult.Error())
  
  14218                                                                     {
  
  14219                                                                         return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  14220                                                                     }
  
  14221                                                                     System.Parsing.Match match = matchResult.Value();
  
  14222                                                                     chr.Reset(cast<System.Parsing.Value<uchar>*>(match.value));
  
  14223                                                                     *parentMatch16 = match;
  
  14224                                                                 }
  
  14225                                                                 if (match.hit)
  
  14226                                                                 {
  
  14227                                                                     System.Parsing.Match match(false);
  
  14228                                                                     System.Parsing.Match* parentMatch17 = &match;
  
  14229                                                                     {
  
  14230                                                                         long tmp = lexer.GetPos();
  
  14231                                                                         lexer.SetPos(save);
  
  14232                                                                         save = tmp;
  
  14233                                                                         System.Parsing.Match match(true);
  
  14234                                                                         for (int i : s64)
  
  14235                                                                         {
  
  14236                                                                             if (*lexer == i)
  
  14237                                                                             {
  
  14238                                                                                 auto incResult1 = ++lexer;
  
  14239                                                                                 if (incResult1.Error())
  
  14240                                                                                 {
  
  14241                                                                                     return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  14242                                                                                 }
  
  14243                                                                             }
  
  14244                                                                             else
  
  14245                                                                             {
  
  14246                                                                                 match.hit = false;
  
  14247                                                                                 break;
  
  14248                                                                             }
  
  14249                                                                         }
  
  14250                                                                         *parentMatch17 = match;
  
  14251                                                                     }
  
  14252                                                                     if (!match.hit)
  
  14253                                                                     {
  
  14254                                                                         lexer.SetPos(save);
  
  14255                                                                     }
  
  14256                                                                     *parentMatch16 = System.Parsing.Match(!match.hit, match.value);
  
  14257                                                                 }
  
  14258                                                                 *parentMatch15 = match;
  
  14259                                                             }
  
  14260                                                             if (match.hit)
  
  14261                                                             {
  
  14262                                                                 data.Append(chr->value);
  
  14263                                                             }
  
  14264                                                             *parentMatch14 = match;
  
  14265                                                         }
  
  14266                                                         *parentMatch13 = match;
  
  14267                                                     }
  
  14268                                                     if (match.hit)
  
  14269                                                     {
  
  14270                                                         *parentMatch12 = match;
  
  14271                                                     }
  
  14272                                                     else
  
  14273                                                     {
  
  14274                                                         lexer.SetPos(save);
  
  14275                                                         break;
  
  14276                                                     }
  
  14277                                                 }
  
  14278                                             }
  
  14279                                         }
  
  14280                                         *parentMatch11 = match;
  
  14281                                     }
  
  14282                                     *parentMatch5 = match;
  
  14283                                 }
  
  14284                                 *parentMatch4 = match;
  
  14285                             }
  
  14286                             if (match.hit)
  
  14287                             {
  
  14288                                 System.Parsing.Match match(false);
  
  14289                                 System.Parsing.Match* parentMatch18 = &match;
  
  14290                                 {
  
  14291                                     System.Parsing.Match match(true);
  
  14292                                     for (int i : s65)
  
  14293                                     {
  
  14294                                         if (*lexer == i)
  
  14295                                         {
  
  14296                                             auto incResult2 = ++lexer;
  
  14297                                             if (incResult2.Error())
  
  14298                                             {
  
  14299                                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  14300                                             }
  
  14301                                         }
  
  14302                                         else
  
  14303                                         {
  
  14304                                             match.hit = false;
  
  14305                                             break;
  
  14306                                         }
  
  14307                                     }
  
  14308                                     *parentMatch18 = match;
  
  14309                                 }
  
  14310                                 *parentMatch4 = match;
  
  14311                             }
  
  14312                             *parentMatch3 = match;
  
  14313                         }
  
  14314                         if (match.hit)
  
  14315                         {
  
  14316                             auto result = processor->PI(span, lexer.FileIndex(), target->value, data);
  
  14317                             if (result.Error())
  
  14318                             {
  
  14319                                 return System.Result<System.Parsing.Match>(ErrorId(result.GetErrorId()));
  
  14320                             }
  
  14321                         }
  
  14322                         *parentMatch2 = match;
  
  14323                     }
  
  14324                     *parentMatch1 = match;
  
  14325                 }
  
  14326                 if (match.hit)
  
  14327                 {
  
  14328                     #if (DEBUG)
  
  14329                         if (parser_debug_write_to_log)
  
  14330                         {
  
  14331                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PI");
  
  14332                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14333                         }
  
  14334                     #endif
  
  14335                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  14336                 }
  
  14337                 *parentMatch0 = match;
  
  14338             }
  
  14339             #if (DEBUG)
  
  14340             if (parser_debug_write_to_log)
  
  14341             {
  
  14342                 if (match.hit)
  
  14343                 {
  
  14344                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PI");
  
  14345                     if (result.Error())
  
  14346                     {
  
  14347                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14348                     }
  
  14349                 }
  
  14350                 else
  
  14351                 {
  
  14352                     auto result = System.Lex.WriteFailureToLog(lexer, u"PI");
  
  14353                     if (result.Error())
  
  14354                     {
  
  14355                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14356                     }
  
  14357                 }
  
  14358             }
  
  14359             #endif
  
  14360             if (!match.hit)
  
  14361             {
  
  14362                 match.value = null;
  
  14363             }
  
  14364             return System.Result<System.Parsing.Match>(match);
  
  14365         }
  
  14366         public static System.Result<System.Parsing.Match> PITarget(LexerT& lexer)
  
  14367         {
  
  14368             #if (DEBUG)
  
  14369             long parser_debug_match_pos = 0;
  
  14370             bool parser_debug_write_to_log = lexer.Log() != null;
  
  14371             if (parser_debug_write_to_log)
  
  14372             {
  
  14373                 parser_debug_match_pos = lexer.GetPos();
  
  14374                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"PITarget");
  
  14375                 if (result.Error())
  
  14376                 {
  
  14377                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14378                 }
  
  14379             }
  
  14380             #endif
  
  14381             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475979);
  
  14382             System.UniquePtr<System.Parsing.Value<ustring>> name;
  
  14383             System.UniquePtr<System.Parsing.Value<bool>> xml;
  
  14384             System.Parsing.Match match(false);
  
  14385             System.Parsing.Match* parentMatch0 = &match;
  
  14386             {
  
  14387                 long pos = lexer.GetPos();
  
  14388                 System.Parsing.Match match(false);
  
  14389                 System.Parsing.Match* parentMatch1 = &match;
  
  14390                 {
  
  14391                     System.Parsing.Match match(false);
  
  14392                     System.Parsing.Match* parentMatch2 = &match;
  
  14393                     long save = lexer.GetPos();
  
  14394                     {
  
  14395                         System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Name(lexer);
  
  14396                         if (matchResult.Error())
  
  14397                         {
  
  14398                             return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  14399                         }
  
  14400                         System.Parsing.Match match = matchResult.Value();
  
  14401                         name.Reset(cast<System.Parsing.Value<ustring>*>(match.value));
  
  14402                         *parentMatch2 = match;
  
  14403                     }
  
  14404                     if (match.hit)
  
  14405                     {
  
  14406                         System.Parsing.Match match(false);
  
  14407                         System.Parsing.Match* parentMatch3 = &match;
  
  14408                         {
  
  14409                             long tmp = lexer.GetPos();
  
  14410                             lexer.SetPos(save);
  
  14411                             save = tmp;
  
  14412                             System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.Xml(lexer);
  
  14413                             if (matchResult.Error())
  
  14414                             {
  
  14415                                 return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  14416                             }
  
  14417                             System.Parsing.Match match = matchResult.Value();
  
  14418                             xml.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  14419                             *parentMatch3 = match;
  
  14420                         }
  
  14421                         if (!match.hit)
  
  14422                         {
  
  14423                             lexer.SetPos(save);
  
  14424                         }
  
  14425                         *parentMatch2 = System.Parsing.Match(!match.hit, match.value);
  
  14426                     }
  
  14427                     *parentMatch1 = match;
  
  14428                 }
  
  14429                 if (match.hit)
  
  14430                 {
  
  14431                     #if (DEBUG)
  
  14432                         if (parser_debug_write_to_log)
  
  14433                         {
  
  14434                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PITarget");
  
  14435                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14436                         }
  
  14437                     #endif
  
  14438                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<ustring>(name->value)));
  
  14439                 }
  
  14440                 *parentMatch0 = match;
  
  14441             }
  
  14442             #if (DEBUG)
  
  14443             if (parser_debug_write_to_log)
  
  14444             {
  
  14445                 if (match.hit)
  
  14446                 {
  
  14447                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"PITarget");
  
  14448                     if (result.Error())
  
  14449                     {
  
  14450                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14451                     }
  
  14452                 }
  
  14453                 else
  
  14454                 {
  
  14455                     auto result = System.Lex.WriteFailureToLog(lexer, u"PITarget");
  
  14456                     if (result.Error())
  
  14457                     {
  
  14458                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14459                     }
  
  14460                 }
  
  14461             }
  
  14462             #endif
  
  14463             if (!match.hit)
  
  14464             {
  
  14465                 match.value = null;
  
  14466             }
  
  14467             return System.Result<System.Parsing.Match>(match);
  
  14468         }
  
  14469         public static System.Result<System.Parsing.Match> Xml(LexerT& lexer)
  
  14470         {
  
  14471             #if (DEBUG)
  
  14472             long parser_debug_match_pos = 0;
  
  14473             bool parser_debug_write_to_log = lexer.Log() != null;
  
  14474             if (parser_debug_write_to_log)
  
  14475             {
  
  14476                 parser_debug_match_pos = lexer.GetPos();
  
  14477                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Xml");
  
  14478                 if (result.Error())
  
  14479                 {
  
  14480                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14481                 }
  
  14482             }
  
  14483             #endif
  
  14484             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475980);
  
  14485             System.Parsing.Match match(false);
  
  14486             System.Parsing.Match* parentMatch0 = &match;
  
  14487             {
  
  14488                 long pos = lexer.GetPos();
  
  14489                 System.Parsing.Match match(false);
  
  14490                 System.Parsing.Match* parentMatch1 = &match;
  
  14491                 {
  
  14492                     System.Parsing.Match match(false);
  
  14493                     System.Parsing.Match* parentMatch2 = &match;
  
  14494                     {
  
  14495                         System.Parsing.Match match(false);
  
  14496                         System.Parsing.Match* parentMatch3 = &match;
  
  14497                         {
  
  14498                             System.Parsing.Match match(false);
  
  14499                             for (const System.Parsing.Range& range : s66)
  
  14500                             {
  
  14501                                 if (*lexer >= range.first && *lexer <= range.last)
  
  14502                                 {
  
  14503                                     match.hit = true;
  
  14504                                     auto incResult0 = ++lexer;
  
  14505                                     if (incResult0.Error())
  
  14506                                     {
  
  14507                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  14508                                     }
  
  14509                                     break;
  
  14510                                 }
  
  14511                             }
  
  14512                             *parentMatch3 = match;
  
  14513                         }
  
  14514                         if (match.hit)
  
  14515                         {
  
  14516                             System.Parsing.Match match(false);
  
  14517                             System.Parsing.Match* parentMatch4 = &match;
  
  14518                             {
  
  14519                                 System.Parsing.Match match(false);
  
  14520                                 for (const System.Parsing.Range& range : s67)
  
  14521                                 {
  
  14522                                     if (*lexer >= range.first && *lexer <= range.last)
  
  14523                                     {
  
  14524                                         match.hit = true;
  
  14525                                         auto incResult1 = ++lexer;
  
  14526                                         if (incResult1.Error())
  
  14527                                         {
  
  14528                                             return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  14529                                         }
  
  14530                                         break;
  
  14531                                     }
  
  14532                                 }
  
  14533                                 *parentMatch4 = match;
  
  14534                             }
  
  14535                             *parentMatch3 = match;
  
  14536                         }
  
  14537                         *parentMatch2 = match;
  
  14538                     }
  
  14539                     if (match.hit)
  
  14540                     {
  
  14541                         System.Parsing.Match match(false);
  
  14542                         System.Parsing.Match* parentMatch5 = &match;
  
  14543                         {
  
  14544                             System.Parsing.Match match(false);
  
  14545                             for (const System.Parsing.Range& range : s68)
  
  14546                             {
  
  14547                                 if (*lexer >= range.first && *lexer <= range.last)
  
  14548                                 {
  
  14549                                     match.hit = true;
  
  14550                                     auto incResult2 = ++lexer;
  
  14551                                     if (incResult2.Error())
  
  14552                                     {
  
  14553                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult2.GetErrorId()));
  
  14554                                     }
  
  14555                                     break;
  
  14556                                 }
  
  14557                             }
  
  14558                             *parentMatch5 = match;
  
  14559                         }
  
  14560                         *parentMatch2 = match;
  
  14561                     }
  
  14562                     *parentMatch1 = match;
  
  14563                 }
  
  14564                 if (match.hit)
  
  14565                 {
  
  14566                     #if (DEBUG)
  
  14567                         if (parser_debug_write_to_log)
  
  14568                         {
  
  14569                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Xml");
  
  14570                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14571                         }
  
  14572                     #endif
  
  14573                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  14574                 }
  
  14575                 *parentMatch0 = match;
  
  14576             }
  
  14577             #if (DEBUG)
  
  14578             if (parser_debug_write_to_log)
  
  14579             {
  
  14580                 if (match.hit)
  
  14581                 {
  
  14582                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Xml");
  
  14583                     if (result.Error())
  
  14584                     {
  
  14585                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14586                     }
  
  14587                 }
  
  14588                 else
  
  14589                 {
  
  14590                     auto result = System.Lex.WriteFailureToLog(lexer, u"Xml");
  
  14591                     if (result.Error())
  
  14592                     {
  
  14593                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14594                     }
  
  14595                 }
  
  14596             }
  
  14597             #endif
  
  14598             if (!match.hit)
  
  14599             {
  
  14600                 match.value = null;
  
  14601             }
  
  14602             return System.Result<System.Parsing.Match>(match);
  
  14603         }
  
  14604         public static System.Result<System.Parsing.Match> Eq(LexerT& lexer)
  
  14605         {
  
  14606             #if (DEBUG)
  
  14607             long parser_debug_match_pos = 0;
  
  14608             bool parser_debug_write_to_log = lexer.Log() != null;
  
  14609             if (parser_debug_write_to_log)
  
  14610             {
  
  14611                 parser_debug_match_pos = lexer.GetPos();
  
  14612                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"Eq");
  
  14613                 if (result.Error())
  
  14614                 {
  
  14615                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14616                 }
  
  14617             }
  
  14618             #endif
  
  14619             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475981);
  
  14620             System.UniquePtr<System.Parsing.Value<bool>> s;
  
  14621             System.Parsing.Match match(false);
  
  14622             System.Parsing.Match* parentMatch0 = &match;
  
  14623             {
  
  14624                 long pos = lexer.GetPos();
  
  14625                 System.Parsing.Match match(false);
  
  14626                 System.Parsing.Match* parentMatch1 = &match;
  
  14627                 {
  
  14628                     System.Parsing.Match match(false);
  
  14629                     System.Parsing.Match* parentMatch2 = &match;
  
  14630                     {
  
  14631                         System.Parsing.Match match(false);
  
  14632                         System.Parsing.Match* parentMatch3 = &match;
  
  14633                         {
  
  14634                             System.Parsing.Match match(true);
  
  14635                             long save = lexer.GetPos();
  
  14636                             System.Parsing.Match* parentMatch4 = &match;
  
  14637                             {
  
  14638                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  14639                                 if (matchResult.Error())
  
  14640                                 {
  
  14641                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  14642                                 }
  
  14643                                 System.Parsing.Match match = matchResult.Value();
  
  14644                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  14645                                 if (match.hit)
  
  14646                                 {
  
  14647                                     *parentMatch4 = match;
  
  14648                                 }
  
  14649                                 else
  
  14650                                 {
  
  14651                                     lexer.SetPos(save);
  
  14652                                 }
  
  14653                             }
  
  14654                             *parentMatch3 = match;
  
  14655                         }
  
  14656                         if (match.hit)
  
  14657                         {
  
  14658                             System.Parsing.Match match(false);
  
  14659                             System.Parsing.Match* parentMatch5 = &match;
  
  14660                             {
  
  14661                                 System.Parsing.Match match(false);
  
  14662                                 if (*lexer == 61)
  
  14663                                 {
  
  14664                                     auto incResult0 = ++lexer;
  
  14665                                     if (incResult0.Error())
  
  14666                                     {
  
  14667                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  14668                                     }
  
  14669                                     match.hit = true;
  
  14670                                 }
  
  14671                                 *parentMatch5 = match;
  
  14672                             }
  
  14673                             *parentMatch3 = match;
  
  14674                         }
  
  14675                         *parentMatch2 = match;
  
  14676                     }
  
  14677                     if (match.hit)
  
  14678                     {
  
  14679                         System.Parsing.Match match(false);
  
  14680                         System.Parsing.Match* parentMatch6 = &match;
  
  14681                         {
  
  14682                             System.Parsing.Match match(true);
  
  14683                             long save = lexer.GetPos();
  
  14684                             System.Parsing.Match* parentMatch7 = &match;
  
  14685                             {
  
  14686                                 System.Result<System.Parsing.Match> matchResult = System.Xml.XmlParser<LexerT>.S(lexer);
  
  14687                                 if (matchResult.Error())
  
  14688                                 {
  
  14689                                     return System.Result<System.Parsing.Match>(System.ErrorId(matchResult.GetErrorId()));
  
  14690                                 }
  
  14691                                 System.Parsing.Match match = matchResult.Value();
  
  14692                                 s.Reset(cast<System.Parsing.Value<bool>*>(match.value));
  
  14693                                 if (match.hit)
  
  14694                                 {
  
  14695                                     *parentMatch7 = match;
  
  14696                                 }
  
  14697                                 else
  
  14698                                 {
  
  14699                                     lexer.SetPos(save);
  
  14700                                 }
  
  14701                             }
  
  14702                             *parentMatch6 = match;
  
  14703                         }
  
  14704                         *parentMatch2 = match;
  
  14705                     }
  
  14706                     *parentMatch1 = match;
  
  14707                 }
  
  14708                 if (match.hit)
  
  14709                 {
  
  14710                     #if (DEBUG)
  
  14711                         if (parser_debug_write_to_log)
  
  14712                         {
  
  14713                             auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Eq");
  
  14714                             if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14715                         }
  
  14716                     #endif
  
  14717                     return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  14718                 }
  
  14719                 *parentMatch0 = match;
  
  14720             }
  
  14721             #if (DEBUG)
  
  14722             if (parser_debug_write_to_log)
  
  14723             {
  
  14724                 if (match.hit)
  
  14725                 {
  
  14726                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"Eq");
  
  14727                     if (result.Error())
  
  14728                     {
  
  14729                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14730                     }
  
  14731                 }
  
  14732                 else
  
  14733                 {
  
  14734                     auto result = System.Lex.WriteFailureToLog(lexer, u"Eq");
  
  14735                     if (result.Error())
  
  14736                     {
  
  14737                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14738                     }
  
  14739                 }
  
  14740             }
  
  14741             #endif
  
  14742             if (!match.hit)
  
  14743             {
  
  14744                 match.value = null;
  
  14745             }
  
  14746             return System.Result<System.Parsing.Match>(match);
  
  14747         }
  
  14748         public static System.Result<System.Parsing.Match> YesNo(LexerT& lexer)
  
  14749         {
  
  14750             #if (DEBUG)
  
  14751             long parser_debug_match_pos = 0;
  
  14752             bool parser_debug_write_to_log = lexer.Log() != null;
  
  14753             if (parser_debug_write_to_log)
  
  14754             {
  
  14755                 parser_debug_match_pos = lexer.GetPos();
  
  14756                 auto result = System.Lex.WriteBeginRuleToLog(lexer, u"YesNo");
  
  14757                 if (result.Error())
  
  14758                 {
  
  14759                     return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14760                 }
  
  14761             }
  
  14762             #endif
  
  14763             System.Lex.RuleGuard<LexerT> ruleGuard(lexer, 3049927998548475982);
  
  14764             System.Parsing.Match match(false);
  
  14765             System.Parsing.Match* parentMatch0 = &match;
  
  14766             {
  
  14767                 long save = lexer.GetPos();
  
  14768                 System.Parsing.Match match(false);
  
  14769                 System.Parsing.Match* parentMatch1 = &match;
  
  14770                 {
  
  14771                     long pos = lexer.GetPos();
  
  14772                     System.Parsing.Match match(true);
  
  14773                     for (int i : s69)
  
  14774                     {
  
  14775                         if (*lexer == i)
  
  14776                         {
  
  14777                             auto incResult0 = ++lexer;
  
  14778                             if (incResult0.Error())
  
  14779                             {
  
  14780                                 return System.Result<System.Parsing.Match>(System.ErrorId(incResult0.GetErrorId()));
  
  14781                             }
  
  14782                         }
  
  14783                         else
  
  14784                         {
  
  14785                             match.hit = false;
  
  14786                             break;
  
  14787                         }
  
  14788                     }
  
  14789                     if (match.hit)
  
  14790                     {
  
  14791                         #if (DEBUG)
  
  14792                             if (parser_debug_write_to_log)
  
  14793                             {
  
  14794                                 auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"YesNo");
  
  14795                                 if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14796                             }
  
  14797                         #endif
  
  14798                         return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(true)));
  
  14799                     }
  
  14800                     *parentMatch1 = match;
  
  14801                 }
  
  14802                 *parentMatch0 = match;
  
  14803                 if (!match.hit)
  
  14804                 {
  
  14805                     System.Parsing.Match match(false);
  
  14806                     System.Parsing.Match* parentMatch2 = &match;
  
  14807                     lexer.SetPos(save);
  
  14808                     {
  
  14809                         System.Parsing.Match match(false);
  
  14810                         System.Parsing.Match* parentMatch3 = &match;
  
  14811                         {
  
  14812                             long pos = lexer.GetPos();
  
  14813                             System.Parsing.Match match(true);
  
  14814                             for (int i : s70)
  
  14815                             {
  
  14816                                 if (*lexer == i)
  
  14817                                 {
  
  14818                                     auto incResult1 = ++lexer;
  
  14819                                     if (incResult1.Error())
  
  14820                                     {
  
  14821                                         return System.Result<System.Parsing.Match>(System.ErrorId(incResult1.GetErrorId()));
  
  14822                                     }
  
  14823                                 }
  
  14824                                 else
  
  14825                                 {
  
  14826                                     match.hit = false;
  
  14827                                     break;
  
  14828                                 }
  
  14829                             }
  
  14830                             if (match.hit)
  
  14831                             {
  
  14832                                 #if (DEBUG)
  
  14833                                     if (parser_debug_write_to_log)
  
  14834                                     {
  
  14835                                         auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"YesNo");
  
  14836                                         if (result.Error()) return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14837                                     }
  
  14838                                 #endif
  
  14839                                 return System.Result<System.Parsing.Match>(System.Parsing.Match(true, new System.Parsing.Value<bool>(false)));
  
  14840                             }
  
  14841                             *parentMatch3 = match;
  
  14842                         }
  
  14843                         *parentMatch2 = match;
  
  14844                     }
  
  14845                     *parentMatch0 = match;
  
  14846                 }
  
  14847             }
  
  14848             #if (DEBUG)
  
  14849             if (parser_debug_write_to_log)
  
  14850             {
  
  14851                 if (match.hit)
  
  14852                 {
  
  14853                     auto result = System.Lex.WriteSuccessToLog(lexer, parser_debug_match_pos, u"YesNo");
  
  14854                     if (result.Error())
  
  14855                     {
  
  14856                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14857                     }
  
  14858                 }
  
  14859                 else
  
  14860                 {
  
  14861                     auto result = System.Lex.WriteFailureToLog(lexer, u"YesNo");
  
  14862                     if (result.Error())
  
  14863                     {
  
  14864                         return System.Result<System.Parsing.Match>(System.ErrorId(result.GetErrorId()));
  
  14865                     }
  
  14866                 }
  
  14867             }
  
  14868             #endif
  
  14869             if (!match.hit)
  
  14870             {
  
  14871                 match.value = null;
  
  14872             }
  
  14873             return System.Result<System.Parsing.Match>(match);
  
  14874         }
  
  14875     }
  
  14876 }
  
  14877 
  
  14878 new class System.Xml.XmlParser<System.Lex.TrivialLexer>;