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