1 #include "Declaration.hpp"
   2 #include <soulng/util/Unicode.hpp>
   3 #include <sngcpp/parser/SourceFile.hpp>
   4 #include <sngcpp/parser/Declarator.hpp>
   5 #include <sngcpp/parser/Identifier.hpp>
   6 #include <sngcpp/parser/TypeExpr.hpp>
   7 #include <sngcpp/parser/Function.hpp>
   8 #include <sngcpp/parser/Class.hpp>
   9 #include <sngcpp/parser/Enumeration.hpp>
  10 #include <sngcpp/parser/Literal.hpp>
  11 #include <sngcpp/parser/Template.hpp>
  12 #include <sngcpp/lexer/CppLexer.hpp>
  13 #include <sngcpp/lexer/CppTokens.hpp>
  14 
  15 // this file has been automatically generated from 'D:/work/soulng-project/sngcpp/parser/Declaration.parser' using soulng parser generator spg version 3.0.0
  16 
  17 using namespace soulng::unicode;
  18 using namespace CppTokens;
  19 using namespace soulng::lexer;
  20 
  21 soulng::parser::Match DeclarationParser::Declaration(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
  22 {
  23     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
  24 
  25 
  26 
  27 
  28 
  29 
  30 
  31     #endif // SOULNG_PARSER_DEBUG_SUPPORT
  32     std::unique_ptr<sngcpp::ast::Node> namespaceDefinition;
  33     std::unique_ptr<sngcpp::ast::Node> functionDefinition;
  34     std::unique_ptr<sngcpp::ast::Node> specialMemberFunctionDefinition;
  35     std::unique_ptr<sngcpp::ast::Node> templateDeclaration;
  36     std::unique_ptr<sngcpp::ast::Node> explicitInstantiation;
  37     std::unique_ptr<sngcpp::ast::Node> explicitSpecialization;
  38     std::unique_ptr<sngcpp::ast::Node> classDeclaration;
  39     std::unique_ptr<sngcpp::ast::Node> enumDeclaration;
  40     std::unique_ptr<sngcpp::ast::Node> linkageSpecification;
  41     std::unique_ptr<sngcpp::ast::Node> blockDeclaration;
  42     soulng::parser::Match match(false);
  43     soulng::parser::Match* parentMatch0 = &match;
  44     {
  45         int64_t save = lexer.GetPos();
  46         soulng::parser::Match match(false);
  47         soulng::parser::Match* parentMatch1 = &match;
  48         {
  49             int64_t save = lexer.GetPos();
  50             soulng::parser::Match match(false);
  51             soulng::parser::Match* parentMatch2 = &match;
  52             {
  53                 int64_t save = lexer.GetPos();
  54                 soulng::parser::Match match(false);
  55                 soulng::parser::Match* parentMatch3 = &match;
  56                 {
  57                     int64_t save = lexer.GetPos();
  58                     soulng::parser::Match match(false);
  59                     soulng::parser::Match* parentMatch4 = &match;
  60                     {
  61                         int64_t save = lexer.GetPos();
  62                         soulng::parser::Match match(false);
  63                         soulng::parser::Match* parentMatch5 = &match;
  64                         {
  65                             int64_t save = lexer.GetPos();
  66                             soulng::parser::Match match(false);
  67                             soulng::parser::Match* parentMatch6 = &match;
  68                             {
  69                                 int64_t save = lexer.GetPos();
  70                                 soulng::parser::Match match(false);
  71                                 soulng::parser::Match* parentMatch7 = &match;
  72                                 {
  73                                     int64_t save = lexer.GetPos();
  74                                     soulng::parser::Match match(false);
  75                                     soulng::parser::Match* parentMatch8 = &match;
  76                                     {
  77                                         int64_t save = lexer.GetPos();
  78                                         soulng::parser::Match match(false);
  79                                         soulng::parser::Match* parentMatch9 = &match;
  80                                         {
  81                                             int64_t pos = lexer.GetPos();
  82                                             soulng::parser::Match match = DeclarationParser::NamespaceDefinition(lexerctx);
  83                                             namespaceDefinition.reset(static_cast<sngcpp::ast::Node*>(match.value));
  84                                             if (match.hit)
  85                                             {
  86                                                 {
  87                                                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
  88 
  89                                                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
  90                                                     return soulng::parser::Match(truenamespaceDefinition.release());
  91                                                 }
  92                                             }
  93                                             *parentMatch9 = match;
  94                                         }
  95                                         *parentMatch8 = match;
  96                                         if (!match.hit)
  97                                         {
  98                                             soulng::parser::Match match(false);
  99                                             soulng::parser::Match* parentMatch10 = &match;
 100                                             lexer.SetPos(save);
 101                                             {
 102                                                 soulng::parser::Match match(false);
 103                                                 soulng::parser::Match* parentMatch11 = &match;
 104                                                 {
 105                                                     int64_t pos = lexer.GetPos();
 106                                                     soulng::parser::Match match = FunctionParser::FunctionDefinition(lexerctx);
 107                                                     functionDefinition.reset(static_cast<sngcpp::ast::Node*>(match.value));
 108                                                     if (match.hit)
 109                                                     {
 110                                                         {
 111                                                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 112 
 113                                                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
 114                                                             return soulng::parser::Match(truefunctionDefinition.release());
 115                                                         }
 116                                                     }
 117                                                     *parentMatch11 = match;
 118                                                 }
 119                                                 *parentMatch10 = match;
 120                                             }
 121                                             *parentMatch8 = match;
 122                                         }
 123                                     }
 124                                     *parentMatch7 = match;
 125                                     if (!match.hit)
 126                                     {
 127                                         soulng::parser::Match match(false);
 128                                         soulng::parser::Match* parentMatch12 = &match;
 129                                         lexer.SetPos(save);
 130                                         {
 131                                             soulng::parser::Match match(false);
 132                                             soulng::parser::Match* parentMatch13 = &match;
 133                                             {
 134                                                 int64_t pos = lexer.GetPos();
 135                                                 soulng::parser::Match match = ClassParser::SpecialMemberFunctionDefinition(lexerctx);
 136                                                 specialMemberFunctionDefinition.reset(static_cast<sngcpp::ast::Node*>(match.value));
 137                                                 if (match.hit)
 138                                                 {
 139                                                     {
 140                                                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 141 
 142                                                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
 143                                                         return soulng::parser::Match(truespecialMemberFunctionDefinition.release());
 144                                                     }
 145                                                 }
 146                                                 *parentMatch13 = match;
 147                                             }
 148                                             *parentMatch12 = match;
 149                                         }
 150                                         *parentMatch7 = match;
 151                                     }
 152                                 }
 153                                 *parentMatch6 = match;
 154                                 if (!match.hit)
 155                                 {
 156                                     soulng::parser::Match match(false);
 157                                     soulng::parser::Match* parentMatch14 = &match;
 158                                     lexer.SetPos(save);
 159                                     {
 160                                         soulng::parser::Match match(false);
 161                                         soulng::parser::Match* parentMatch15 = &match;
 162                                         {
 163                                             int64_t pos = lexer.GetPos();
 164                                             soulng::parser::Match match = TemplateParser::TemplateDeclaration(lexerctx);
 165                                             templateDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 166                                             if (match.hit)
 167                                             {
 168                                                 {
 169                                                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 170 
 171                                                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 172                                                     return soulng::parser::Match(truetemplateDeclaration.release());
 173                                                 }
 174                                             }
 175                                             *parentMatch15 = match;
 176                                         }
 177                                         *parentMatch14 = match;
 178                                     }
 179                                     *parentMatch6 = match;
 180                                 }
 181                             }
 182                             *parentMatch5 = match;
 183                             if (!match.hit)
 184                             {
 185                                 soulng::parser::Match match(false);
 186                                 soulng::parser::Match* parentMatch16 = &match;
 187                                 lexer.SetPos(save);
 188                                 {
 189                                     soulng::parser::Match match(false);
 190                                     soulng::parser::Match* parentMatch17 = &match;
 191                                     {
 192                                         int64_t pos = lexer.GetPos();
 193                                         soulng::parser::Match match = TemplateParser::ExplicitInstantiation(lexerctx);
 194                                         explicitInstantiation.reset(static_cast<sngcpp::ast::Node*>(match.value));
 195                                         if (match.hit)
 196                                         {
 197                                             {
 198                                                 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 199 
 200                                                 #endif // SOULNG_PARSER_DEBUG_SUPPORT
 201                                                 return soulng::parser::Match(trueexplicitInstantiation.release());
 202                                             }
 203                                         }
 204                                         *parentMatch17 = match;
 205                                     }
 206                                     *parentMatch16 = match;
 207                                 }
 208                                 *parentMatch5 = match;
 209                             }
 210                         }
 211                         *parentMatch4 = match;
 212                         if (!match.hit)
 213                         {
 214                             soulng::parser::Match match(false);
 215                             soulng::parser::Match* parentMatch18 = &match;
 216                             lexer.SetPos(save);
 217                             {
 218                                 soulng::parser::Match match(false);
 219                                 soulng::parser::Match* parentMatch19 = &match;
 220                                 {
 221                                     int64_t pos = lexer.GetPos();
 222                                     soulng::parser::Match match = TemplateParser::ExplicitSpecialization(lexerctx);
 223                                     explicitSpecialization.reset(static_cast<sngcpp::ast::Node*>(match.value));
 224                                     if (match.hit)
 225                                     {
 226                                         {
 227                                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 228 
 229                                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
 230                                             return soulng::parser::Match(trueexplicitSpecialization.release());
 231                                         }
 232                                     }
 233                                     *parentMatch19 = match;
 234                                 }
 235                                 *parentMatch18 = match;
 236                             }
 237                             *parentMatch4 = match;
 238                         }
 239                     }
 240                     *parentMatch3 = match;
 241                     if (!match.hit)
 242                     {
 243                         soulng::parser::Match match(false);
 244                         soulng::parser::Match* parentMatch20 = &match;
 245                         lexer.SetPos(save);
 246                         {
 247                             soulng::parser::Match match(false);
 248                             soulng::parser::Match* parentMatch21 = &match;
 249                             {
 250                                 int64_t pos = lexer.GetPos();
 251                                 soulng::parser::Match match = ClassParser::ClassDeclaration(lexerctx);
 252                                 classDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 253                                 if (match.hit)
 254                                 {
 255                                     {
 256                                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 257 
 258                                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
 259                                         return soulng::parser::Match(trueclassDeclaration.release());
 260                                     }
 261                                 }
 262                                 *parentMatch21 = match;
 263                             }
 264                             *parentMatch20 = match;
 265                         }
 266                         *parentMatch3 = match;
 267                     }
 268                 }
 269                 *parentMatch2 = match;
 270                 if (!match.hit)
 271                 {
 272                     soulng::parser::Match match(false);
 273                     soulng::parser::Match* parentMatch22 = &match;
 274                     lexer.SetPos(save);
 275                     {
 276                         soulng::parser::Match match(false);
 277                         soulng::parser::Match* parentMatch23 = &match;
 278                         {
 279                             int64_t pos = lexer.GetPos();
 280                             soulng::parser::Match match = EnumerationParser::EnumDeclaration(lexerctx);
 281                             enumDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 282                             if (match.hit)
 283                             {
 284                                 {
 285                                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 286 
 287                                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 288                                     return soulng::parser::Match(trueenumDeclaration.release());
 289                                 }
 290                             }
 291                             *parentMatch23 = match;
 292                         }
 293                         *parentMatch22 = match;
 294                     }
 295                     *parentMatch2 = match;
 296                 }
 297             }
 298             *parentMatch1 = match;
 299             if (!match.hit)
 300             {
 301                 soulng::parser::Match match(false);
 302                 soulng::parser::Match* parentMatch24 = &match;
 303                 lexer.SetPos(save);
 304                 {
 305                     soulng::parser::Match match(false);
 306                     soulng::parser::Match* parentMatch25 = &match;
 307                     {
 308                         int64_t pos = lexer.GetPos();
 309                         soulng::parser::Match match = DeclarationParser::LinkageSpecification(lexerctx);
 310                         linkageSpecification.reset(static_cast<sngcpp::ast::Node*>(match.value));
 311                         if (match.hit)
 312                         {
 313                             {
 314                                 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 315 
 316                                 #endif // SOULNG_PARSER_DEBUG_SUPPORT
 317                                 return soulng::parser::Match(truelinkageSpecification.release());
 318                             }
 319                         }
 320                         *parentMatch25 = match;
 321                     }
 322                     *parentMatch24 = match;
 323                 }
 324                 *parentMatch1 = match;
 325             }
 326         }
 327         *parentMatch0 = match;
 328         if (!match.hit)
 329         {
 330             soulng::parser::Match match(false);
 331             soulng::parser::Match* parentMatch26 = &match;
 332             lexer.SetPos(save);
 333             {
 334                 soulng::parser::Match match(false);
 335                 soulng::parser::Match* parentMatch27 = &match;
 336                 {
 337                     int64_t pos = lexer.GetPos();
 338                     soulng::parser::Match match = DeclarationParser::BlockDeclaration(lexerctx);
 339                     blockDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 340                     if (match.hit)
 341                     {
 342                         {
 343                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 344 
 345                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
 346                             return soulng::parser::Match(trueblockDeclaration.release());
 347                         }
 348                     }
 349                     *parentMatch27 = match;
 350                 }
 351                 *parentMatch26 = match;
 352             }
 353             *parentMatch0 = match;
 354         }
 355     }
 356     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 357 
 358 
 359 
 360 
 361 
 362     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 363     if (!match.hit)
 364     {
 365         match.value = nullptr;
 366     }
 367     return match;
 368 }
 369 
 370 soulng::parser::Match DeclarationParser::NamespaceDefinition(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
 371 {
 372     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 373 
 374 
 375 
 376 
 377 
 378 
 379 
 380     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 381     std::unique_ptr<sngcpp::ast::Node> namedNamespaceDefinition;
 382     std::unique_ptr<sngcpp::ast::Node> unnamedNamespaceDefinition;
 383     soulng::parser::Match match(false);
 384     soulng::parser::Match* parentMatch0 = &match;
 385     {
 386         int64_t save = lexer.GetPos();
 387         soulng::parser::Match match(false);
 388         soulng::parser::Match* parentMatch1 = &match;
 389         {
 390             int64_t pos = lexer.GetPos();
 391             soulng::parser::Match match = DeclarationParser::NamedNamespaceDefinition(lexerctx);
 392             namedNamespaceDefinition.reset(static_cast<sngcpp::ast::Node*>(match.value));
 393             if (match.hit)
 394             {
 395                 {
 396                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 397 
 398                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 399                     return soulng::parser::Match(truenamedNamespaceDefinition.release());
 400                 }
 401             }
 402             *parentMatch1 = match;
 403         }
 404         *parentMatch0 = match;
 405         if (!match.hit)
 406         {
 407             soulng::parser::Match match(false);
 408             soulng::parser::Match* parentMatch2 = &match;
 409             lexer.SetPos(save);
 410             {
 411                 soulng::parser::Match match(false);
 412                 soulng::parser::Match* parentMatch3 = &match;
 413                 {
 414                     int64_t pos = lexer.GetPos();
 415                     soulng::parser::Match match = DeclarationParser::UnnamedNamespaceDefinition(lexerctx);
 416                     unnamedNamespaceDefinition.reset(static_cast<sngcpp::ast::Node*>(match.value));
 417                     if (match.hit)
 418                     {
 419                         {
 420                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 421 
 422                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
 423                             return soulng::parser::Match(trueunnamedNamespaceDefinition.release());
 424                         }
 425                     }
 426                     *parentMatch3 = match;
 427                 }
 428                 *parentMatch2 = match;
 429             }
 430             *parentMatch0 = match;
 431         }
 432     }
 433     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 434 
 435 
 436 
 437 
 438 
 439     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 440     if (!match.hit)
 441     {
 442         match.value = nullptr;
 443     }
 444     return match;
 445 }
 446 
 447 soulng::parser::Match DeclarationParser::NamedNamespaceDefinition(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
 448 {
 449     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 450 
 451 
 452 
 453 
 454 
 455 
 456 
 457     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 458     std::unique_ptr<sngcpp::ast::NamespaceNode> ns = std::unique_ptr<sngcpp::ast::NamespaceNode>();
 459     Span s = Span();
 460     std::unique_ptr<soulng::parser::soulng::parser::Value<std::u32string>>id;
 461     soulng::parser::Match match(false);
 462     soulng::parser::Match* parentMatch0 = &match;
 463     {
 464         soulng::parser::Match match(false);
 465         soulng::parser::Match* parentMatch1 = &match;
 466         {
 467             soulng::parser::Match match(false);
 468             soulng::parser::Match* parentMatch2 = &match;
 469             {
 470                 soulng::parser::Match match(false);
 471                 soulng::parser::Match* parentMatch3 = &match;
 472                 {
 473                     soulng::parser::Match match(false);
 474                     soulng::parser::Match* parentMatch4 = &match;
 475                     {
 476                         int64_t pos = lexer.GetPos();
 477                         soulng::lexer::Span span = lexer.GetSpan();
 478                         soulng::parser::Match match(false);
 479                         if (*lexer == NAMESPACE)
 480                         {
 481                             ++lexer;
 482                             match.hit = true;
 483                         }
 484                         if (match.hit)
 485                         {
 486                             s = span;
 487                         }
 488                         *parentMatch4 = match;
 489                     }
 490                     *parentMatch3 = match;
 491                 }
 492                 if (match.hit)
 493                 {
 494                     soulng::parser::Match match(false);
 495                     soulng::parser::Match* parentMatch5 = &match;
 496                     {
 497                         soulng::parser::Match match = IdentifierParser::Identifier(lexer);
 498                         id.reset(static_cast<soulng::parser::soulng::parser::Value<std::u32string>*>(match.value));
 499                         *parentMatch5 = match;
 500                     }
 501                     *parentMatch3 = match;
 502                 }
 503                 *parentMatch2 = match;
 504             }
 505             if (match.hit)
 506             {
 507                 soulng::parser::Match match(false);
 508                 soulng::parser::Match* parentMatch6 = &match;
 509                 {
 510                     soulng::parser::Match match(false);
 511                     soulng::parser::Match* parentMatch7 = &match;
 512                     {
 513                         int64_t pos = lexer.GetPos();
 514                         soulng::lexer::Span span = lexer.GetSpan();
 515                         soulng::parser::Match match(false);
 516                         if (*lexer == LBRACE)
 517                         {
 518                             ++lexer;
 519                             match.hit = true;
 520                         }
 521                         if (match.hit)
 522                         {
 523                             s.end = span.end;
 524                             ns.reset(new sngcpp::ast::NamespaceNode(sid->value));
 525                         }
 526                         *parentMatch7 = match;
 527                     }
 528                     *parentMatch6 = match;
 529                 }
 530                 *parentMatch2 = match;
 531             }
 532             *parentMatch1 = match;
 533         }
 534         if (match.hit)
 535         {
 536             soulng::parser::Match match(false);
 537             soulng::parser::Match* parentMatch8 = &match;
 538             {
 539                 soulng::parser::Match match = SourceFileParser::Declarations(lexerctxns.get());
 540                 *parentMatch8 = match;
 541             }
 542             *parentMatch1 = match;
 543         }
 544         *parentMatch0 = match;
 545     }
 546     if (match.hit)
 547     {
 548         soulng::parser::Match match(false);
 549         soulng::parser::Match* parentMatch9 = &match;
 550         {
 551             soulng::parser::Match match(false);
 552             soulng::parser::Match* parentMatch10 = &match;
 553             {
 554                 int64_t pos = lexer.GetPos();
 555                 soulng::parser::Match match(true);
 556                 soulng::parser::Match* parentMatch11 = &match;
 557                 {
 558                     soulng::lexer::Span span = lexer.GetSpan();
 559                     soulng::parser::Match match(false);
 560                     if (*lexer == RBRACE)
 561                     {
 562                         ++lexer;
 563                         match.hit = true;
 564                     }
 565                     if (match.hit)
 566                     {
 567                         *parentMatch11 = match;
 568                     }
 569                     else
 570                     {
 571                         lexer.ThrowExpectationFailure(spanToUtf32(GetTokenInfo(RBRACE)));
 572                     }
 573                 }
 574                 if (match.hit)
 575                 {
 576                     {
 577                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 578 
 579                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
 580                         return soulng::parser::Match(truens.release());
 581                     }
 582                 }
 583                 *parentMatch10 = match;
 584             }
 585             *parentMatch9 = match;
 586         }
 587         *parentMatch0 = match;
 588     }
 589     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 590 
 591 
 592 
 593 
 594 
 595     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 596     if (!match.hit)
 597     {
 598         match.value = nullptr;
 599     }
 600     return match;
 601 }
 602 
 603 soulng::parser::Match DeclarationParser::UnnamedNamespaceDefinition(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
 604 {
 605     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 606 
 607 
 608 
 609 
 610 
 611 
 612 
 613     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 614     std::unique_ptr<sngcpp::ast::NamespaceNode> ns = std::unique_ptr<sngcpp::ast::NamespaceNode>();
 615     Span s = Span();
 616     soulng::parser::Match match(false);
 617     soulng::parser::Match* parentMatch0 = &match;
 618     {
 619         soulng::parser::Match match(false);
 620         soulng::parser::Match* parentMatch1 = &match;
 621         {
 622             soulng::parser::Match match(false);
 623             soulng::parser::Match* parentMatch2 = &match;
 624             {
 625                 soulng::parser::Match match(false);
 626                 soulng::parser::Match* parentMatch3 = &match;
 627                 {
 628                     int64_t pos = lexer.GetPos();
 629                     soulng::lexer::Span span = lexer.GetSpan();
 630                     soulng::parser::Match match(false);
 631                     if (*lexer == NAMESPACE)
 632                     {
 633                         ++lexer;
 634                         match.hit = true;
 635                     }
 636                     if (match.hit)
 637                     {
 638                         s = span;
 639                     }
 640                     *parentMatch3 = match;
 641                 }
 642                 *parentMatch2 = match;
 643             }
 644             if (match.hit)
 645             {
 646                 soulng::parser::Match match(false);
 647                 soulng::parser::Match* parentMatch4 = &match;
 648                 {
 649                     soulng::parser::Match match(false);
 650                     soulng::parser::Match* parentMatch5 = &match;
 651                     {
 652                         int64_t pos = lexer.GetPos();
 653                         soulng::lexer::Span span = lexer.GetSpan();
 654                         soulng::parser::Match match(false);
 655                         if (*lexer == LBRACE)
 656                         {
 657                             ++lexer;
 658                             match.hit = true;
 659                         }
 660                         if (match.hit)
 661                         {
 662                             s.end = span.end;
 663                             ns.reset(new sngcpp::ast::NamespaceNode(s));
 664                         }
 665                         *parentMatch5 = match;
 666                     }
 667                     *parentMatch4 = match;
 668                 }
 669                 *parentMatch2 = match;
 670             }
 671             *parentMatch1 = match;
 672         }
 673         if (match.hit)
 674         {
 675             soulng::parser::Match match(false);
 676             soulng::parser::Match* parentMatch6 = &match;
 677             {
 678                 soulng::parser::Match match = SourceFileParser::Declarations(lexerctxns.get());
 679                 *parentMatch6 = match;
 680             }
 681             *parentMatch1 = match;
 682         }
 683         *parentMatch0 = match;
 684     }
 685     if (match.hit)
 686     {
 687         soulng::parser::Match match(false);
 688         soulng::parser::Match* parentMatch7 = &match;
 689         {
 690             soulng::parser::Match match(false);
 691             soulng::parser::Match* parentMatch8 = &match;
 692             {
 693                 int64_t pos = lexer.GetPos();
 694                 soulng::parser::Match match(true);
 695                 soulng::parser::Match* parentMatch9 = &match;
 696                 {
 697                     soulng::lexer::Span span = lexer.GetSpan();
 698                     soulng::parser::Match match(false);
 699                     if (*lexer == RBRACE)
 700                     {
 701                         ++lexer;
 702                         match.hit = true;
 703                     }
 704                     if (match.hit)
 705                     {
 706                         *parentMatch9 = match;
 707                     }
 708                     else
 709                     {
 710                         lexer.ThrowExpectationFailure(spanToUtf32(GetTokenInfo(RBRACE)));
 711                     }
 712                 }
 713                 if (match.hit)
 714                 {
 715                     {
 716                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 717 
 718                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
 719                         return soulng::parser::Match(truens.release());
 720                     }
 721                 }
 722                 *parentMatch8 = match;
 723             }
 724             *parentMatch7 = match;
 725         }
 726         *parentMatch0 = match;
 727     }
 728     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 729 
 730 
 731 
 732 
 733 
 734     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 735     if (!match.hit)
 736     {
 737         match.value = nullptr;
 738     }
 739     return match;
 740 }
 741 
 742 soulng::parser::Match DeclarationParser::BlockDeclaration(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
 743 {
 744     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 745 
 746 
 747 
 748 
 749 
 750 
 751 
 752     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 753     std::unique_ptr<sngcpp::ast::Node> simpleDeclaration;
 754     std::unique_ptr<sngcpp::ast::Node> aliasDeclaration;
 755     std::unique_ptr<sngcpp::ast::Node> usingDirective;
 756     std::unique_ptr<sngcpp::ast::Node> usingDeclaration;
 757     std::unique_ptr<sngcpp::ast::Node> opaqueEnumDeclaration;
 758     std::unique_ptr<sngcpp::ast::Node> typedefDeclaration;
 759     std::unique_ptr<sngcpp::ast::Node> forwardClassDeclaration;
 760     soulng::parser::Match match(false);
 761     soulng::parser::Match* parentMatch0 = &match;
 762     {
 763         int64_t save = lexer.GetPos();
 764         soulng::parser::Match match(false);
 765         soulng::parser::Match* parentMatch1 = &match;
 766         {
 767             int64_t save = lexer.GetPos();
 768             soulng::parser::Match match(false);
 769             soulng::parser::Match* parentMatch2 = &match;
 770             {
 771                 int64_t save = lexer.GetPos();
 772                 soulng::parser::Match match(false);
 773                 soulng::parser::Match* parentMatch3 = &match;
 774                 {
 775                     int64_t save = lexer.GetPos();
 776                     soulng::parser::Match match(false);
 777                     soulng::parser::Match* parentMatch4 = &match;
 778                     {
 779                         int64_t save = lexer.GetPos();
 780                         soulng::parser::Match match(false);
 781                         soulng::parser::Match* parentMatch5 = &match;
 782                         {
 783                             int64_t save = lexer.GetPos();
 784                             soulng::parser::Match match(false);
 785                             soulng::parser::Match* parentMatch6 = &match;
 786                             {
 787                                 int64_t pos = lexer.GetPos();
 788                                 soulng::parser::Match match = DeclarationParser::SimpleDeclaration(lexerctx);
 789                                 simpleDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 790                                 if (match.hit)
 791                                 {
 792                                     {
 793                                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 794 
 795                                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
 796                                         return soulng::parser::Match(truesimpleDeclaration.release());
 797                                     }
 798                                 }
 799                                 *parentMatch6 = match;
 800                             }
 801                             *parentMatch5 = match;
 802                             if (!match.hit)
 803                             {
 804                                 soulng::parser::Match match(false);
 805                                 soulng::parser::Match* parentMatch7 = &match;
 806                                 lexer.SetPos(save);
 807                                 {
 808                                     soulng::parser::Match match(false);
 809                                     soulng::parser::Match* parentMatch8 = &match;
 810                                     {
 811                                         int64_t pos = lexer.GetPos();
 812                                         soulng::parser::Match match = DeclarationParser::AliasDeclaration(lexerctx);
 813                                         aliasDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 814                                         if (match.hit)
 815                                         {
 816                                             {
 817                                                 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 818 
 819                                                 #endif // SOULNG_PARSER_DEBUG_SUPPORT
 820                                                 return soulng::parser::Match(truealiasDeclaration.release());
 821                                             }
 822                                         }
 823                                         *parentMatch8 = match;
 824                                     }
 825                                     *parentMatch7 = match;
 826                                 }
 827                                 *parentMatch5 = match;
 828                             }
 829                         }
 830                         *parentMatch4 = match;
 831                         if (!match.hit)
 832                         {
 833                             soulng::parser::Match match(false);
 834                             soulng::parser::Match* parentMatch9 = &match;
 835                             lexer.SetPos(save);
 836                             {
 837                                 soulng::parser::Match match(false);
 838                                 soulng::parser::Match* parentMatch10 = &match;
 839                                 {
 840                                     int64_t pos = lexer.GetPos();
 841                                     soulng::parser::Match match = DeclarationParser::UsingDirective(lexerctx);
 842                                     usingDirective.reset(static_cast<sngcpp::ast::Node*>(match.value));
 843                                     if (match.hit)
 844                                     {
 845                                         {
 846                                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 847 
 848                                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
 849                                             return soulng::parser::Match(trueusingDirective.release());
 850                                         }
 851                                     }
 852                                     *parentMatch10 = match;
 853                                 }
 854                                 *parentMatch9 = match;
 855                             }
 856                             *parentMatch4 = match;
 857                         }
 858                     }
 859                     *parentMatch3 = match;
 860                     if (!match.hit)
 861                     {
 862                         soulng::parser::Match match(false);
 863                         soulng::parser::Match* parentMatch11 = &match;
 864                         lexer.SetPos(save);
 865                         {
 866                             soulng::parser::Match match(false);
 867                             soulng::parser::Match* parentMatch12 = &match;
 868                             {
 869                                 int64_t pos = lexer.GetPos();
 870                                 soulng::parser::Match match = DeclarationParser::UsingDeclaration(lexerctx);
 871                                 usingDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 872                                 if (match.hit)
 873                                 {
 874                                     {
 875                                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 876 
 877                                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
 878                                         return soulng::parser::Match(trueusingDeclaration.release());
 879                                     }
 880                                 }
 881                                 *parentMatch12 = match;
 882                             }
 883                             *parentMatch11 = match;
 884                         }
 885                         *parentMatch3 = match;
 886                     }
 887                 }
 888                 *parentMatch2 = match;
 889                 if (!match.hit)
 890                 {
 891                     soulng::parser::Match match(false);
 892                     soulng::parser::Match* parentMatch13 = &match;
 893                     lexer.SetPos(save);
 894                     {
 895                         soulng::parser::Match match(false);
 896                         soulng::parser::Match* parentMatch14 = &match;
 897                         {
 898                             int64_t pos = lexer.GetPos();
 899                             soulng::parser::Match match = EnumerationParser::OpaqueEnumDeclaration(lexerctx);
 900                             opaqueEnumDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 901                             if (match.hit)
 902                             {
 903                                 {
 904                                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 905 
 906                                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 907                                     return soulng::parser::Match(trueopaqueEnumDeclaration.release());
 908                                 }
 909                             }
 910                             *parentMatch14 = match;
 911                         }
 912                         *parentMatch13 = match;
 913                     }
 914                     *parentMatch2 = match;
 915                 }
 916             }
 917             *parentMatch1 = match;
 918             if (!match.hit)
 919             {
 920                 soulng::parser::Match match(false);
 921                 soulng::parser::Match* parentMatch15 = &match;
 922                 lexer.SetPos(save);
 923                 {
 924                     soulng::parser::Match match(false);
 925                     soulng::parser::Match* parentMatch16 = &match;
 926                     {
 927                         int64_t pos = lexer.GetPos();
 928                         soulng::parser::Match match = DeclarationParser::TypedefDeclaration(lexerctx);
 929                         typedefDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 930                         if (match.hit)
 931                         {
 932                             {
 933                                 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 934 
 935                                 #endif // SOULNG_PARSER_DEBUG_SUPPORT
 936                                 return soulng::parser::Match(truetypedefDeclaration.release());
 937                             }
 938                         }
 939                         *parentMatch16 = match;
 940                     }
 941                     *parentMatch15 = match;
 942                 }
 943                 *parentMatch1 = match;
 944             }
 945         }
 946         *parentMatch0 = match;
 947         if (!match.hit)
 948         {
 949             soulng::parser::Match match(false);
 950             soulng::parser::Match* parentMatch17 = &match;
 951             lexer.SetPos(save);
 952             {
 953                 soulng::parser::Match match(false);
 954                 soulng::parser::Match* parentMatch18 = &match;
 955                 {
 956                     int64_t pos = lexer.GetPos();
 957                     soulng::parser::Match match = ClassParser::ForwardClassDeclaration(lexerctx);
 958                     forwardClassDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
 959                     if (match.hit)
 960                     {
 961                         {
 962                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 963 
 964                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
 965                             return soulng::parser::Match(trueforwardClassDeclaration.release());
 966                         }
 967                     }
 968                     *parentMatch18 = match;
 969                 }
 970                 *parentMatch17 = match;
 971             }
 972             *parentMatch0 = match;
 973         }
 974     }
 975     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 976 
 977 
 978 
 979 
 980 
 981     #endif // SOULNG_PARSER_DEBUG_SUPPORT
 982     if (!match.hit)
 983     {
 984         match.value = nullptr;
 985     }
 986     return match;
 987 }
 988 
 989 soulng::parser::Match DeclarationParser::SimpleDeclaration(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
 990 {
 991     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
 992 
 993 
 994 
 995 
 996 
 997 
 998 
 999     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1000     Span s = Span();
1001     std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>declSpecifiers;
1002     std::unique_ptr<sngcpp::ast::Node> typeExpr;
1003     std::unique_ptr<sngcpp::ast::Node> initDeclarator;
1004     soulng::parser::Match match(false);
1005     soulng::parser::Match* parentMatch0 = &match;
1006     {
1007         soulng::parser::Match match(false);
1008         soulng::parser::Match* parentMatch1 = &match;
1009         {
1010             soulng::parser::Match match(false);
1011             soulng::parser::Match* parentMatch2 = &match;
1012             {
1013                 soulng::parser::Match match(false);
1014                 soulng::parser::Match* parentMatch3 = &match;
1015                 {
1016                     int64_t pos = lexer.GetPos();
1017                     soulng::lexer::Span span = lexer.GetSpan();
1018                     soulng::parser::Match match = DeclarationParser::DeclSpecifiers(lexer);
1019                     declSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1020                     if (match.hit)
1021                     {
1022                         s = span;
1023                     }
1024                     *parentMatch3 = match;
1025                 }
1026                 *parentMatch2 = match;
1027             }
1028             if (match.hit)
1029             {
1030                 soulng::parser::Match match(false);
1031                 soulng::parser::Match* parentMatch4 = &match;
1032                 {
1033                     soulng::parser::Match match = TypeExprParser::TypeExpr(lexerctx);
1034                     typeExpr.reset(static_cast<sngcpp::ast::Node*>(match.value));
1035                     *parentMatch4 = match;
1036                 }
1037                 *parentMatch2 = match;
1038             }
1039             *parentMatch1 = match;
1040         }
1041         if (match.hit)
1042         {
1043             soulng::parser::Match match(false);
1044             soulng::parser::Match* parentMatch5 = &match;
1045             {
1046                 soulng::parser::Match match = DeclaratorParser::InitDeclarator(lexerctx);
1047                 initDeclarator.reset(static_cast<sngcpp::ast::Node*>(match.value));
1048                 *parentMatch5 = match;
1049             }
1050             *parentMatch1 = match;
1051         }
1052         *parentMatch0 = match;
1053     }
1054     if (match.hit)
1055     {
1056         soulng::parser::Match match(false);
1057         soulng::parser::Match* parentMatch6 = &match;
1058         {
1059             soulng::parser::Match match(false);
1060             soulng::parser::Match* parentMatch7 = &match;
1061             {
1062                 int64_t pos = lexer.GetPos();
1063                 soulng::lexer::Span span = lexer.GetSpan();
1064                 soulng::parser::Match match(false);
1065                 if (*lexer == SEMICOLON)
1066                 {
1067                     ++lexer;
1068                     match.hit = true;
1069                 }
1070                 if (match.hit)
1071                 {
1072                     s.end = span.end;
1073                     {
1074                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1075 
1076                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
1077                         return soulng::parser::Match(truenew sngcpp::ast::SimpleDeclarationNode(sdeclSpecifiers->valuetypeExpr.release()initDeclarator.release()));
1078                     }
1079                 }
1080                 *parentMatch7 = match;
1081             }
1082             *parentMatch6 = match;
1083         }
1084         *parentMatch0 = match;
1085     }
1086     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1087 
1088 
1089 
1090 
1091 
1092     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1093     if (!match.hit)
1094     {
1095         match.value = nullptr;
1096     }
1097     return match;
1098 }
1099 
1100 soulng::parser::Match DeclarationParser::DeclSpecifiers(CppLexer& lexer)
1101 {
1102     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1103 
1104 
1105 
1106 
1107 
1108 
1109 
1110     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1111     sngcpp::ast::Specifier specifiers = sngcpp::ast::Specifier();
1112     std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>declSpecifier;
1113     soulng::parser::Match match(false);
1114     soulng::parser::Match* parentMatch0 = &match;
1115     {
1116         int64_t pos = lexer.GetPos();
1117         soulng::parser::Match match(false);
1118         soulng::parser::Match* parentMatch1 = &match;
1119         {
1120             soulng::parser::Match match(true);
1121             soulng::parser::Match* parentMatch2 = &match;
1122             {
1123                 while (true)
1124                 {
1125                     int64_t save = lexer.GetPos();
1126                     {
1127                         soulng::parser::Match match(false);
1128                         soulng::parser::Match* parentMatch3 = &match;
1129                         {
1130                             soulng::parser::Match match(false);
1131                             soulng::parser::Match* parentMatch4 = &match;
1132                             {
1133                                 int64_t pos = lexer.GetPos();
1134                                 soulng::parser::Match match = DeclarationParser::DeclSpecifier(lexer);
1135                                 declSpecifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1136                                 if (match.hit)
1137                                 {
1138                                     specifiers = specifiers | declSpecifier->value;
1139                                 }
1140                                 *parentMatch4 = match;
1141                             }
1142                             *parentMatch3 = match;
1143                         }
1144                         if (match.hit)
1145                         {
1146                             *parentMatch2 = match;
1147                         }
1148                         else
1149                         {
1150                             lexer.SetPos(save);
1151                             break;
1152                         }
1153                     }
1154                 }
1155             }
1156             *parentMatch1 = match;
1157         }
1158         if (match.hit)
1159         {
1160             {
1161                 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1162 
1163                 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1164                 return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(specifiers));
1165             }
1166         }
1167         *parentMatch0 = match;
1168     }
1169     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1170 
1171 
1172 
1173 
1174 
1175     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1176     if (!match.hit)
1177     {
1178         match.value = nullptr;
1179     }
1180     return match;
1181 }
1182 
1183 soulng::parser::Match DeclarationParser::DeclSpecifier(CppLexer& lexer)
1184 {
1185     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1194     std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>storageClassSpecifier;
1195     std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>functionSpecifier;
1196     soulng::parser::Match match(false);
1197     soulng::parser::Match* parentMatch0 = &match;
1198     {
1199         int64_t save = lexer.GetPos();
1200         soulng::parser::Match match(false);
1201         soulng::parser::Match* parentMatch1 = &match;
1202         {
1203             int64_t save = lexer.GetPos();
1204             soulng::parser::Match match(false);
1205             soulng::parser::Match* parentMatch2 = &match;
1206             {
1207                 int64_t save = lexer.GetPos();
1208                 soulng::parser::Match match(false);
1209                 soulng::parser::Match* parentMatch3 = &match;
1210                 {
1211                     int64_t save = lexer.GetPos();
1212                     soulng::parser::Match match(false);
1213                     soulng::parser::Match* parentMatch4 = &match;
1214                     {
1215                         int64_t save = lexer.GetPos();
1216                         soulng::parser::Match match(false);
1217                         soulng::parser::Match* parentMatch5 = &match;
1218                         {
1219                             int64_t pos = lexer.GetPos();
1220                             soulng::parser::Match match = DeclarationParser::StorageClassSpecifier(lexer);
1221                             storageClassSpecifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1222                             if (match.hit)
1223                             {
1224                                 {
1225                                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1226 
1227                                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1228                                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(storageClassSpecifier->value));
1229                                 }
1230                             }
1231                             *parentMatch5 = match;
1232                         }
1233                         *parentMatch4 = match;
1234                         if (!match.hit)
1235                         {
1236                             soulng::parser::Match match(false);
1237                             soulng::parser::Match* parentMatch6 = &match;
1238                             lexer.SetPos(save);
1239                             {
1240                                 soulng::parser::Match match(false);
1241                                 soulng::parser::Match* parentMatch7 = &match;
1242                                 {
1243                                     int64_t pos = lexer.GetPos();
1244                                     soulng::parser::Match match = DeclarationParser::FunctionSpecifier(lexer);
1245                                     functionSpecifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1246                                     if (match.hit)
1247                                     {
1248                                         {
1249                                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1250 
1251                                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
1252                                             return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(functionSpecifier->value));
1253                                         }
1254                                     }
1255                                     *parentMatch7 = match;
1256                                 }
1257                                 *parentMatch6 = match;
1258                             }
1259                             *parentMatch4 = match;
1260                         }
1261                     }
1262                     *parentMatch3 = match;
1263                     if (!match.hit)
1264                     {
1265                         soulng::parser::Match match(false);
1266                         soulng::parser::Match* parentMatch8 = &match;
1267                         lexer.SetPos(save);
1268                         {
1269                             soulng::parser::Match match(false);
1270                             soulng::parser::Match* parentMatch9 = &match;
1271                             {
1272                                 int64_t pos = lexer.GetPos();
1273                                 soulng::parser::Match match(false);
1274                                 if (*lexer == FRIEND)
1275                                 {
1276                                     ++lexer;
1277                                     match.hit = true;
1278                                 }
1279                                 if (match.hit)
1280                                 {
1281                                     {
1282                                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1283 
1284                                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
1285                                         return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::friend_));
1286                                     }
1287                                 }
1288                                 *parentMatch9 = match;
1289                             }
1290                             *parentMatch8 = match;
1291                         }
1292                         *parentMatch3 = match;
1293                     }
1294                 }
1295                 *parentMatch2 = match;
1296                 if (!match.hit)
1297                 {
1298                     soulng::parser::Match match(false);
1299                     soulng::parser::Match* parentMatch10 = &match;
1300                     lexer.SetPos(save);
1301                     {
1302                         soulng::parser::Match match(false);
1303                         soulng::parser::Match* parentMatch11 = &match;
1304                         {
1305                             int64_t pos = lexer.GetPos();
1306                             soulng::parser::Match match(false);
1307                             if (*lexer == CONSTEXPR)
1308                             {
1309                                 ++lexer;
1310                                 match.hit = true;
1311                             }
1312                             if (match.hit)
1313                             {
1314                                 {
1315                                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1316 
1317                                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1318                                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::constExpr));
1319                                 }
1320                             }
1321                             *parentMatch11 = match;
1322                         }
1323                         *parentMatch10 = match;
1324                     }
1325                     *parentMatch2 = match;
1326                 }
1327             }
1328             *parentMatch1 = match;
1329             if (!match.hit)
1330             {
1331                 soulng::parser::Match match(false);
1332                 soulng::parser::Match* parentMatch12 = &match;
1333                 lexer.SetPos(save);
1334                 {
1335                     soulng::parser::Match match(false);
1336                     soulng::parser::Match* parentMatch13 = &match;
1337                     {
1338                         soulng::parser::Match match(false);
1339                         soulng::parser::Match* parentMatch14 = &match;
1340                         {
1341                             soulng::parser::Match match(false);
1342                             soulng::parser::Match* parentMatch15 = &match;
1343                             {
1344                                 soulng::parser::Match match(false);
1345                                 if (*lexer == __DECLSPEC)
1346                                 {
1347                                     ++lexer;
1348                                     match.hit = true;
1349                                 }
1350                                 *parentMatch15 = match;
1351                             }
1352                             if (match.hit)
1353                             {
1354                                 soulng::parser::Match match(false);
1355                                 soulng::parser::Match* parentMatch16 = &match;
1356                                 {
1357                                     soulng::parser::Match match(false);
1358                                     if (*lexer == LPAREN)
1359                                     {
1360                                         ++lexer;
1361                                         match.hit = true;
1362                                     }
1363                                     *parentMatch16 = match;
1364                                 }
1365                                 *parentMatch15 = match;
1366                             }
1367                             *parentMatch14 = match;
1368                         }
1369                         if (match.hit)
1370                         {
1371                             soulng::parser::Match match(false);
1372                             soulng::parser::Match* parentMatch17 = &match;
1373                             {
1374                                 soulng::parser::Match match(false);
1375                                 if (*lexer == ID)
1376                                 {
1377                                     ++lexer;
1378                                     match.hit = true;
1379                                 }
1380                                 *parentMatch17 = match;
1381                             }
1382                             *parentMatch14 = match;
1383                         }
1384                         *parentMatch13 = match;
1385                     }
1386                     if (match.hit)
1387                     {
1388                         soulng::parser::Match match(false);
1389                         soulng::parser::Match* parentMatch18 = &match;
1390                         {
1391                             soulng::parser::Match match(false);
1392                             soulng::parser::Match* parentMatch19 = &match;
1393                             {
1394                                 int64_t pos = lexer.GetPos();
1395                                 soulng::parser::Match match(false);
1396                                 if (*lexer == RPAREN)
1397                                 {
1398                                     ++lexer;
1399                                     match.hit = true;
1400                                 }
1401                                 if (match.hit)
1402                                 {
1403                                     {
1404                                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1405 
1406                                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
1407                                         return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::extension));
1408                                     }
1409                                 }
1410                                 *parentMatch19 = match;
1411                             }
1412                             *parentMatch18 = match;
1413                         }
1414                         *parentMatch13 = match;
1415                     }
1416                     *parentMatch12 = match;
1417                 }
1418                 *parentMatch1 = match;
1419             }
1420         }
1421         *parentMatch0 = match;
1422         if (!match.hit)
1423         {
1424             soulng::parser::Match match(false);
1425             soulng::parser::Match* parentMatch20 = &match;
1426             lexer.SetPos(save);
1427             {
1428                 soulng::parser::Match match(false);
1429                 soulng::parser::Match* parentMatch21 = &match;
1430                 {
1431                     int64_t pos = lexer.GetPos();
1432                     soulng::parser::Match match(false);
1433                     if (*lexer == __THREAD)
1434                     {
1435                         ++lexer;
1436                         match.hit = true;
1437                     }
1438                     if (match.hit)
1439                     {
1440                         {
1441                             #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1442 
1443                             #endif // SOULNG_PARSER_DEBUG_SUPPORT
1444                             return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::extension));
1445                         }
1446                     }
1447                     *parentMatch21 = match;
1448                 }
1449                 *parentMatch20 = match;
1450             }
1451             *parentMatch0 = match;
1452         }
1453     }
1454     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1455 
1456 
1457 
1458 
1459 
1460     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1461     if (!match.hit)
1462     {
1463         match.value = nullptr;
1464     }
1465     return match;
1466 }
1467 
1468 soulng::parser::Match DeclarationParser::StorageClassSpecifier(CppLexer& lexer)
1469 {
1470     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1471 
1472 
1473 
1474 
1475 
1476 
1477 
1478     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1479     soulng::parser::Match match(false);
1480     int64_t pos = lexer.GetPos();
1481     soulng::lexer::Span span = lexer.GetSpan();
1482     switch (*lexer)
1483     {
1484         case REGISTER:
1485         {
1486             ++lexer;
1487             {
1488                 {
1489                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1490 
1491                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1492                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::register_));
1493                 }
1494             }
1495             break;
1496         }
1497         case STATIC:
1498         {
1499             ++lexer;
1500             {
1501                 {
1502                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1503 
1504                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1505                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::static_));
1506                 }
1507             }
1508             break;
1509         }
1510         case EXTERN:
1511         {
1512             ++lexer;
1513             {
1514                 {
1515                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1516 
1517                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1518                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::extern_));
1519                 }
1520             }
1521             break;
1522         }
1523         case MUTABLE:
1524         {
1525             ++lexer;
1526             {
1527                 {
1528                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1529 
1530                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1531                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::mutable_));
1532                 }
1533             }
1534             break;
1535         }
1536     }
1537     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1538 
1539 
1540 
1541 
1542 
1543     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1544     if (!match.hit)
1545     {
1546         match.value = nullptr;
1547     }
1548     return match;
1549 }
1550 
1551 soulng::parser::Match DeclarationParser::FunctionSpecifier(CppLexer& lexer)
1552 {
1553     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1554 
1555 
1556 
1557 
1558 
1559 
1560 
1561     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1562     soulng::parser::Match match(false);
1563     int64_t pos = lexer.GetPos();
1564     soulng::lexer::Span span = lexer.GetSpan();
1565     switch (*lexer)
1566     {
1567         case INLINE:
1568         {
1569             ++lexer;
1570             {
1571                 {
1572                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1573 
1574                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1575                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::inline_));
1576                 }
1577             }
1578             break;
1579         }
1580         case VIRTUAL:
1581         {
1582             ++lexer;
1583             {
1584                 {
1585                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1586 
1587                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1588                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::virtual_));
1589                 }
1590             }
1591             break;
1592         }
1593         case EXPLICIT:
1594         {
1595             ++lexer;
1596             {
1597                 {
1598                     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1599 
1600                     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1601                     return soulng::parser::Match(truenew soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::explicit_));
1602                 }
1603             }
1604             break;
1605         }
1606     }
1607     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1608 
1609 
1610 
1611 
1612 
1613     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1614     if (!match.hit)
1615     {
1616         match.value = nullptr;
1617     }
1618     return match;
1619 }
1620 
1621 soulng::parser::Match DeclarationParser::AliasDeclaration(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
1622 {
1623     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1624 
1625 
1626 
1627 
1628 
1629 
1630 
1631     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1632     Span s = Span();
1633     std::unique_ptr<soulng::parser::soulng::parser::Value<std::u32string>>id;
1634     std::unique_ptr<sngcpp::ast::Node> typeExpr;
1635     soulng::parser::Match match(false);
1636     soulng::parser::Match* parentMatch0 = &match;
1637     {
1638         soulng::parser::Match match(false);
1639         soulng::parser::Match* parentMatch1 = &match;
1640         {
1641             soulng::parser::Match match(false);
1642             soulng::parser::Match* parentMatch2 = &match;
1643             {
1644                 soulng::parser::Match match(false);
1645                 soulng::parser::Match* parentMatch3 = &match;
1646                 {
1647                     soulng::parser::Match match(false);
1648                     soulng::parser::Match* parentMatch4 = &match;
1649                     {
1650                         int64_t pos = lexer.GetPos();
1651                         soulng::lexer::Span span = lexer.GetSpan();
1652                         soulng::parser::Match match(false);
1653                         if (*lexer == USING)
1654                         {
1655                             ++lexer;
1656                             match.hit = true;
1657                         }
1658                         if (match.hit)
1659                         {
1660                             s = span;
1661                         }
1662                         *parentMatch4 = match;
1663                     }
1664                     *parentMatch3 = match;
1665                 }
1666                 if (match.hit)
1667                 {
1668                     soulng::parser::Match match(false);
1669                     soulng::parser::Match* parentMatch5 = &match;
1670                     {
1671                         soulng::parser::Match match = IdentifierParser::Identifier(lexer);
1672                         id.reset(static_cast<soulng::parser::soulng::parser::Value<std::u32string>*>(match.value));
1673                         *parentMatch5 = match;
1674                     }
1675                     *parentMatch3 = match;
1676                 }
1677                 *parentMatch2 = match;
1678             }
1679             if (match.hit)
1680             {
1681                 soulng::parser::Match match(false);
1682                 soulng::parser::Match* parentMatch6 = &match;
1683                 {
1684                     soulng::parser::Match match(false);
1685                     if (*lexer == ASSIGN)
1686                     {
1687                         ++lexer;
1688                         match.hit = true;
1689                     }
1690                     *parentMatch6 = match;
1691                 }
1692                 *parentMatch2 = match;
1693             }
1694             *parentMatch1 = match;
1695         }
1696         if (match.hit)
1697         {
1698             soulng::parser::Match match(false);
1699             soulng::parser::Match* parentMatch7 = &match;
1700             {
1701                 soulng::parser::Match match(true);
1702                 soulng::parser::Match* parentMatch8 = &match;
1703                 {
1704                     soulng::lexer::Span span = lexer.GetSpan();
1705                     soulng::parser::Match match = TypeExprParser::TypeExpr(lexerctx);
1706                     typeExpr.reset(static_cast<sngcpp::ast::Node*>(match.value));
1707                     if (match.hit)
1708                     {
1709                         *parentMatch8 = match;
1710                     }
1711                     else
1712                     {
1713                         lexer.ThrowExpectationFailure(spanU"TypeExpr");
1714                     }
1715                 }
1716                 *parentMatch7 = match;
1717             }
1718             *parentMatch1 = match;
1719         }
1720         *parentMatch0 = match;
1721     }
1722     if (match.hit)
1723     {
1724         soulng::parser::Match match(false);
1725         soulng::parser::Match* parentMatch9 = &match;
1726         {
1727             soulng::parser::Match match(false);
1728             soulng::parser::Match* parentMatch10 = &match;
1729             {
1730                 int64_t pos = lexer.GetPos();
1731                 soulng::lexer::Span span = lexer.GetSpan();
1732                 soulng::parser::Match match(true);
1733                 soulng::parser::Match* parentMatch11 = &match;
1734                 {
1735                     soulng::lexer::Span span = lexer.GetSpan();
1736                     soulng::parser::Match match(false);
1737                     if (*lexer == SEMICOLON)
1738                     {
1739                         ++lexer;
1740                         match.hit = true;
1741                     }
1742                     if (match.hit)
1743                     {
1744                         *parentMatch11 = match;
1745                     }
1746                     else
1747                     {
1748                         lexer.ThrowExpectationFailure(spanToUtf32(GetTokenInfo(SEMICOLON)));
1749                     }
1750                 }
1751                 if (match.hit)
1752                 {
1753                     s.end = span.end;
1754                     {
1755                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1756 
1757                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
1758                         return soulng::parser::Match(truenew sngcpp::ast::AliasDeclarationNode(sid->valuetypeExpr.release()));
1759                     }
1760                 }
1761                 *parentMatch10 = match;
1762             }
1763             *parentMatch9 = match;
1764         }
1765         *parentMatch0 = match;
1766     }
1767     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1768 
1769 
1770 
1771 
1772 
1773     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1774     if (!match.hit)
1775     {
1776         match.value = nullptr;
1777     }
1778     return match;
1779 }
1780 
1781 soulng::parser::Match DeclarationParser::UsingDirective(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
1782 {
1783     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1784 
1785 
1786 
1787 
1788 
1789 
1790 
1791     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1792     Span s = Span();
1793     std::unique_ptr<sngcpp::ast::Node> qid;
1794     soulng::parser::Match match(false);
1795     soulng::parser::Match* parentMatch0 = &match;
1796     {
1797         soulng::parser::Match match(false);
1798         soulng::parser::Match* parentMatch1 = &match;
1799         {
1800             soulng::parser::Match match(false);
1801             soulng::parser::Match* parentMatch2 = &match;
1802             {
1803                 soulng::parser::Match match(false);
1804                 soulng::parser::Match* parentMatch3 = &match;
1805                 {
1806                     int64_t pos = lexer.GetPos();
1807                     soulng::lexer::Span span = lexer.GetSpan();
1808                     soulng::parser::Match match(false);
1809                     if (*lexer == USING)
1810                     {
1811                         ++lexer;
1812                         match.hit = true;
1813                     }
1814                     if (match.hit)
1815                     {
1816                         s = span;
1817                     }
1818                     *parentMatch3 = match;
1819                 }
1820                 *parentMatch2 = match;
1821             }
1822             if (match.hit)
1823             {
1824                 soulng::parser::Match match(false);
1825                 soulng::parser::Match* parentMatch4 = &match;
1826                 {
1827                     soulng::parser::Match match(false);
1828                     if (*lexer == NAMESPACE)
1829                     {
1830                         ++lexer;
1831                         match.hit = true;
1832                     }
1833                     *parentMatch4 = match;
1834                 }
1835                 *parentMatch2 = match;
1836             }
1837             *parentMatch1 = match;
1838         }
1839         if (match.hit)
1840         {
1841             soulng::parser::Match match(false);
1842             soulng::parser::Match* parentMatch5 = &match;
1843             {
1844                 soulng::parser::Match match(true);
1845                 soulng::parser::Match* parentMatch6 = &match;
1846                 {
1847                     soulng::lexer::Span span = lexer.GetSpan();
1848                     soulng::parser::Match match = IdentifierParser::QualifiedIdNode(lexerctx);
1849                     qid.reset(static_cast<sngcpp::ast::Node*>(match.value));
1850                     if (match.hit)
1851                     {
1852                         *parentMatch6 = match;
1853                     }
1854                     else
1855                     {
1856                         lexer.ThrowExpectationFailure(spanU"QualifiedIdNode");
1857                     }
1858                 }
1859                 *parentMatch5 = match;
1860             }
1861             *parentMatch1 = match;
1862         }
1863         *parentMatch0 = match;
1864     }
1865     if (match.hit)
1866     {
1867         soulng::parser::Match match(false);
1868         soulng::parser::Match* parentMatch7 = &match;
1869         {
1870             soulng::parser::Match match(false);
1871             soulng::parser::Match* parentMatch8 = &match;
1872             {
1873                 int64_t pos = lexer.GetPos();
1874                 soulng::lexer::Span span = lexer.GetSpan();
1875                 soulng::parser::Match match(true);
1876                 soulng::parser::Match* parentMatch9 = &match;
1877                 {
1878                     soulng::lexer::Span span = lexer.GetSpan();
1879                     soulng::parser::Match match(false);
1880                     if (*lexer == SEMICOLON)
1881                     {
1882                         ++lexer;
1883                         match.hit = true;
1884                     }
1885                     if (match.hit)
1886                     {
1887                         *parentMatch9 = match;
1888                     }
1889                     else
1890                     {
1891                         lexer.ThrowExpectationFailure(spanToUtf32(GetTokenInfo(SEMICOLON)));
1892                     }
1893                 }
1894                 if (match.hit)
1895                 {
1896                     s.end = span.end;
1897                     sngcpp::ast::Node*  value = new sngcpp::ast::UsingDirectiveNode(sqid.release());
1898                     ctx->GetSourceFileNode()->AddUsingDirectiveOrDeclaration(value);
1899                     {
1900                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1901 
1902                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
1903                         return soulng::parser::Match(truevalue);
1904                     }
1905                 }
1906                 *parentMatch8 = match;
1907             }
1908             *parentMatch7 = match;
1909         }
1910         *parentMatch0 = match;
1911     }
1912     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1913 
1914 
1915 
1916 
1917 
1918     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1919     if (!match.hit)
1920     {
1921         match.value = nullptr;
1922     }
1923     return match;
1924 }
1925 
1926 soulng::parser::Match DeclarationParser::UsingDeclaration(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
1927 {
1928     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1929 
1930 
1931 
1932 
1933 
1934 
1935 
1936     #endif // SOULNG_PARSER_DEBUG_SUPPORT
1937     Span s = Span();
1938     std::unique_ptr<sngcpp::ast::Node> qid;
1939     soulng::parser::Match match(false);
1940     soulng::parser::Match* parentMatch0 = &match;
1941     {
1942         soulng::parser::Match match(false);
1943         soulng::parser::Match* parentMatch1 = &match;
1944         {
1945             soulng::parser::Match match(false);
1946             soulng::parser::Match* parentMatch2 = &match;
1947             {
1948                 int64_t pos = lexer.GetPos();
1949                 soulng::lexer::Span span = lexer.GetSpan();
1950                 soulng::parser::Match match(false);
1951                 if (*lexer == USING)
1952                 {
1953                     ++lexer;
1954                     match.hit = true;
1955                 }
1956                 if (match.hit)
1957                 {
1958                     s = span;
1959                 }
1960                 *parentMatch2 = match;
1961             }
1962             *parentMatch1 = match;
1963         }
1964         if (match.hit)
1965         {
1966             soulng::parser::Match match(false);
1967             soulng::parser::Match* parentMatch3 = &match;
1968             {
1969                 soulng::parser::Match match = IdentifierParser::QualifiedIdNode(lexerctx);
1970                 qid.reset(static_cast<sngcpp::ast::Node*>(match.value));
1971                 *parentMatch3 = match;
1972             }
1973             *parentMatch1 = match;
1974         }
1975         *parentMatch0 = match;
1976     }
1977     if (match.hit)
1978     {
1979         soulng::parser::Match match(false);
1980         soulng::parser::Match* parentMatch4 = &match;
1981         {
1982             soulng::parser::Match match(false);
1983             soulng::parser::Match* parentMatch5 = &match;
1984             {
1985                 int64_t pos = lexer.GetPos();
1986                 soulng::lexer::Span span = lexer.GetSpan();
1987                 soulng::parser::Match match(false);
1988                 if (*lexer == SEMICOLON)
1989                 {
1990                     ++lexer;
1991                     match.hit = true;
1992                 }
1993                 if (match.hit)
1994                 {
1995                     s.end = span.end;
1996                     sngcpp::ast::Node*  value = new sngcpp::ast::UsingDeclarationNode(sqid.release());
1997                     ctx->GetSourceFileNode()->AddUsingDirectiveOrDeclaration(value);
1998                     {
1999                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2000 
2001                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
2002                         return soulng::parser::Match(truevalue);
2003                     }
2004                 }
2005                 *parentMatch5 = match;
2006             }
2007             *parentMatch4 = match;
2008         }
2009         *parentMatch0 = match;
2010     }
2011     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2012 
2013 
2014 
2015 
2016 
2017     #endif // SOULNG_PARSER_DEBUG_SUPPORT
2018     if (!match.hit)
2019     {
2020         match.value = nullptr;
2021     }
2022     return match;
2023 }
2024 
2025 soulng::parser::Match DeclarationParser::TypedefDeclaration(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
2026 {
2027     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2028 
2029 
2030 
2031 
2032 
2033 
2034 
2035     #endif // SOULNG_PARSER_DEBUG_SUPPORT
2036     Span s = Span();
2037     std::unique_ptr<sngcpp::ast::Node> typeExpr;
2038     std::unique_ptr<sngcpp::ast::Node> declarator;
2039     soulng::parser::Match match(false);
2040     soulng::parser::Match* parentMatch0 = &match;
2041     {
2042         soulng::parser::Match match(false);
2043         soulng::parser::Match* parentMatch1 = &match;
2044         {
2045             soulng::parser::Match match(false);
2046             soulng::parser::Match* parentMatch2 = &match;
2047             {
2048                 soulng::parser::Match match(false);
2049                 soulng::parser::Match* parentMatch3 = &match;
2050                 {
2051                     int64_t pos = lexer.GetPos();
2052                     soulng::lexer::Span span = lexer.GetSpan();
2053                     soulng::parser::Match match(false);
2054                     if (*lexer == TYPEDEF)
2055                     {
2056                         ++lexer;
2057                         match.hit = true;
2058                     }
2059                     if (match.hit)
2060                     {
2061                         s = span;
2062                     }
2063                     *parentMatch3 = match;
2064                 }
2065                 *parentMatch2 = match;
2066             }
2067             if (match.hit)
2068             {
2069                 soulng::parser::Match match(false);
2070                 soulng::parser::Match* parentMatch4 = &match;
2071                 {
2072                     soulng::parser::Match match(true);
2073                     soulng::parser::Match* parentMatch5 = &match;
2074                     {
2075                         soulng::lexer::Span span = lexer.GetSpan();
2076                         soulng::parser::Match match = TypeExprParser::TypeExpr(lexerctx);
2077                         typeExpr.reset(static_cast<sngcpp::ast::Node*>(match.value));
2078                         if (match.hit)
2079                         {
2080                             *parentMatch5 = match;
2081                         }
2082                         else
2083                         {
2084                             lexer.ThrowExpectationFailure(spanU"TypeExpr");
2085                         }
2086                     }
2087                     *parentMatch4 = match;
2088                 }
2089                 *parentMatch2 = match;
2090             }
2091             *parentMatch1 = match;
2092         }
2093         if (match.hit)
2094         {
2095             soulng::parser::Match match(false);
2096             soulng::parser::Match* parentMatch6 = &match;
2097             {
2098                 soulng::parser::Match match(true);
2099                 soulng::parser::Match* parentMatch7 = &match;
2100                 {
2101                     soulng::lexer::Span span = lexer.GetSpan();
2102                     soulng::parser::Match match = DeclaratorParser::Declarator(lexerctx);
2103                     declarator.reset(static_cast<sngcpp::ast::Node*>(match.value));
2104                     if (match.hit)
2105                     {
2106                         *parentMatch7 = match;
2107                     }
2108                     else
2109                     {
2110                         lexer.ThrowExpectationFailure(spanU"Declarator");
2111                     }
2112                 }
2113                 *parentMatch6 = match;
2114             }
2115             *parentMatch1 = match;
2116         }
2117         *parentMatch0 = match;
2118     }
2119     if (match.hit)
2120     {
2121         soulng::parser::Match match(false);
2122         soulng::parser::Match* parentMatch8 = &match;
2123         {
2124             soulng::parser::Match match(false);
2125             soulng::parser::Match* parentMatch9 = &match;
2126             {
2127                 int64_t pos = lexer.GetPos();
2128                 soulng::lexer::Span span = lexer.GetSpan();
2129                 soulng::parser::Match match(true);
2130                 soulng::parser::Match* parentMatch10 = &match;
2131                 {
2132                     soulng::lexer::Span span = lexer.GetSpan();
2133                     soulng::parser::Match match(false);
2134                     if (*lexer == SEMICOLON)
2135                     {
2136                         ++lexer;
2137                         match.hit = true;
2138                     }
2139                     if (match.hit)
2140                     {
2141                         *parentMatch10 = match;
2142                     }
2143                     else
2144                     {
2145                         lexer.ThrowExpectationFailure(spanToUtf32(GetTokenInfo(SEMICOLON)));
2146                     }
2147                 }
2148                 if (match.hit)
2149                 {
2150                     s.end = span.end;
2151                     {
2152                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2153 
2154                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
2155                         return soulng::parser::Match(truenew sngcpp::ast::TypedefNode(stypeExpr.release()declarator.release()));
2156                     }
2157                 }
2158                 *parentMatch9 = match;
2159             }
2160             *parentMatch8 = match;
2161         }
2162         *parentMatch0 = match;
2163     }
2164     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2165 
2166 
2167 
2168 
2169 
2170     #endif // SOULNG_PARSER_DEBUG_SUPPORT
2171     if (!match.hit)
2172     {
2173         match.value = nullptr;
2174     }
2175     return match;
2176 }
2177 
2178 soulng::parser::Match DeclarationParser::LinkageSpecification(CppLexer& lexersngcpp::cppparser::ParsingContext* ctx)
2179 {
2180     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2181 
2182 
2183 
2184 
2185 
2186 
2187 
2188     #endif // SOULNG_PARSER_DEBUG_SUPPORT
2189     std::unique_ptr<sngcpp::ast::LinkageSpecificationNode> ls = std::unique_ptr<sngcpp::ast::LinkageSpecificationNode>();
2190     Span s = Span();
2191     std::unique_ptr<sngcpp::ast::StringLiteralNode> language;
2192     std::unique_ptr<sngcpp::ast::Node> d1;
2193     std::unique_ptr<sngcpp::ast::Node> d2;
2194     soulng::parser::Match match(false);
2195     soulng::parser::Match* parentMatch0 = &match;
2196     {
2197         soulng::parser::Match match(false);
2198         soulng::parser::Match* parentMatch1 = &match;
2199         {
2200             soulng::parser::Match match(false);
2201             soulng::parser::Match* parentMatch2 = &match;
2202             {
2203                 int64_t pos = lexer.GetPos();
2204                 soulng::lexer::Span span = lexer.GetSpan();
2205                 soulng::parser::Match match(false);
2206                 if (*lexer == EXTERN)
2207                 {
2208                     ++lexer;
2209                     match.hit = true;
2210                 }
2211                 if (match.hit)
2212                 {
2213                     s = span;
2214                 }
2215                 *parentMatch2 = match;
2216             }
2217             *parentMatch1 = match;
2218         }
2219         if (match.hit)
2220         {
2221             soulng::parser::Match match(false);
2222             soulng::parser::Match* parentMatch3 = &match;
2223             {
2224                 soulng::parser::Match match(false);
2225                 soulng::parser::Match* parentMatch4 = &match;
2226                 {
2227                     int64_t pos = lexer.GetPos();
2228                     soulng::lexer::Span span = lexer.GetSpan();
2229                     soulng::parser::Match match = LiteralParser::StringLiteral(lexer);
2230                     language.reset(static_cast<sngcpp::ast::StringLiteralNode*>(match.value));
2231                     if (match.hit)
2232                     {
2233                         s.end = span.end;
2234                         ls.reset(new sngcpp::ast::LinkageSpecificationNode(slanguage.release()));
2235                     }
2236                     *parentMatch4 = match;
2237                 }
2238                 *parentMatch3 = match;
2239             }
2240             *parentMatch1 = match;
2241         }
2242         *parentMatch0 = match;
2243     }
2244     if (match.hit)
2245     {
2246         soulng::parser::Match match(false);
2247         soulng::parser::Match* parentMatch5 = &match;
2248         {
2249             soulng::parser::Match match(false);
2250             soulng::parser::Match* parentMatch6 = &match;
2251             {
2252                 int64_t pos = lexer.GetPos();
2253                 soulng::parser::Match match(false);
2254                 soulng::parser::Match* parentMatch7 = &match;
2255                 {
2256                     soulng::parser::Match match(false);
2257                     soulng::parser::Match* parentMatch8 = &match;
2258                     {
2259                         int64_t save = lexer.GetPos();
2260                         soulng::parser::Match match(false);
2261                         soulng::parser::Match* parentMatch9 = &match;
2262                         {
2263                             soulng::parser::Match match(false);
2264                             soulng::parser::Match* parentMatch10 = &match;
2265                             {
2266                                 soulng::parser::Match match(false);
2267                                 if (*lexer == LBRACE)
2268                                 {
2269                                     ++lexer;
2270                                     match.hit = true;
2271                                 }
2272                                 *parentMatch10 = match;
2273                             }
2274                             if (match.hit)
2275                             {
2276                                 soulng::parser::Match match(false);
2277                                 soulng::parser::Match* parentMatch11 = &match;
2278                                 {
2279                                     soulng::parser::Match match(true);
2280                                     soulng::parser::Match* parentMatch12 = &match;
2281                                     {
2282                                         while (true)
2283                                         {
2284                                             int64_t save = lexer.GetPos();
2285                                             {
2286                                                 soulng::parser::Match match(false);
2287                                                 soulng::parser::Match* parentMatch13 = &match;
2288                                                 {
2289                                                     soulng::parser::Match match(false);
2290                                                     soulng::parser::Match* parentMatch14 = &match;
2291                                                     {
2292                                                         int64_t pos = lexer.GetPos();
2293                                                         soulng::lexer::Span span = lexer.GetSpan();
2294                                                         soulng::parser::Match match = DeclarationParser::Declaration(lexerctx);
2295                                                         d1.reset(static_cast<sngcpp::ast::Node*>(match.value));
2296                                                         if (match.hit)
2297                                                         {
2298                                                             ls->AddDeclaration(spand1.release());
2299                                                         }
2300                                                         *parentMatch14 = match;
2301                                                     }
2302                                                     *parentMatch13 = match;
2303                                                 }
2304                                                 if (match.hit)
2305                                                 {
2306                                                     *parentMatch12 = match;
2307                                                 }
2308                                                 else
2309                                                 {
2310                                                     lexer.SetPos(save);
2311                                                     break;
2312                                                 }
2313                                             }
2314                                         }
2315                                     }
2316                                     *parentMatch11 = match;
2317                                 }
2318                                 *parentMatch10 = match;
2319                             }
2320                             *parentMatch9 = match;
2321                         }
2322                         if (match.hit)
2323                         {
2324                             soulng::parser::Match match(false);
2325                             soulng::parser::Match* parentMatch15 = &match;
2326                             {
2327                                 soulng::parser::Match match(true);
2328                                 soulng::parser::Match* parentMatch16 = &match;
2329                                 {
2330                                     soulng::lexer::Span span = lexer.GetSpan();
2331                                     soulng::parser::Match match(false);
2332                                     if (*lexer == RBRACE)
2333                                     {
2334                                         ++lexer;
2335                                         match.hit = true;
2336                                     }
2337                                     if (match.hit)
2338                                     {
2339                                         *parentMatch16 = match;
2340                                     }
2341                                     else
2342                                     {
2343                                         lexer.ThrowExpectationFailure(spanToUtf32(GetTokenInfo(RBRACE)));
2344                                     }
2345                                 }
2346                                 *parentMatch15 = match;
2347                             }
2348                             *parentMatch9 = match;
2349                         }
2350                         *parentMatch8 = match;
2351                         if (!match.hit)
2352                         {
2353                             soulng::parser::Match match(false);
2354                             soulng::parser::Match* parentMatch17 = &match;
2355                             lexer.SetPos(save);
2356                             {
2357                                 soulng::parser::Match match(false);
2358                                 soulng::parser::Match* parentMatch18 = &match;
2359                                 {
2360                                     int64_t pos = lexer.GetPos();
2361                                     soulng::lexer::Span span = lexer.GetSpan();
2362                                     soulng::parser::Match match = DeclarationParser::Declaration(lexerctx);
2363                                     d2.reset(static_cast<sngcpp::ast::Node*>(match.value));
2364                                     if (match.hit)
2365                                     {
2366                                         ls->AddDeclaration(spand2.release());
2367                                     }
2368                                     *parentMatch18 = match;
2369                                 }
2370                                 *parentMatch17 = match;
2371                             }
2372                             *parentMatch8 = match;
2373                         }
2374                     }
2375                     *parentMatch7 = match;
2376                 }
2377                 if (match.hit)
2378                 {
2379                     {
2380                         #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2381 
2382                         #endif // SOULNG_PARSER_DEBUG_SUPPORT
2383                         return soulng::parser::Match(truels.release());
2384                     }
2385                 }
2386                 *parentMatch6 = match;
2387             }
2388             *parentMatch5 = match;
2389         }
2390         *parentMatch0 = match;
2391     }
2392     #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2393 
2394 
2395 
2396 
2397 
2398     #endif // SOULNG_PARSER_DEBUG_SUPPORT
2399     if (!match.hit)
2400     {
2401         match.value = nullptr;
2402     }
2403     return match;
2404 }