1 #include "Class.hpp"
2 #include <soulng/util/Unicode.hpp>
3 #include <sngcpp/parser/Declaration.hpp>
4 #include <sngcpp/parser/Declarator.hpp>
5 #include <sngcpp/parser/Enumeration.hpp>
6 #include <sngcpp/parser/Expression.hpp>
7 #include <sngcpp/parser/Function.hpp>
8 #include <sngcpp/parser/Identifier.hpp>
9 #include <sngcpp/parser/Literal.hpp>
10 #include <sngcpp/parser/Template.hpp>
11 #include <sngcpp/parser/TypeExpr.hpp>
12 #include <sngcpp/lexer/CppLexer.hpp>
13 #include <sngcpp/lexer/CppTokens.hpp>
14
15
16
17 using namespace soulng::unicode;
18 using namespace CppTokens;
19 using namespace soulng::lexer;
20
21 soulng::parser::Match ClassParser::ClassDeclaration(CppLexer& lexer, sngcpp::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> classSpecifier;
33 soulng::parser::Match match(false);
34 soulng::parser::Match* parentMatch0 = &match;
35 {
36 soulng::parser::Match match = ClassParser::ClassSpecifier(lexer, ctx);
37 classSpecifier.reset(static_cast<sngcpp::ast::Node*>(match.value));
38 *parentMatch0 = match;
39 }
40 if (match.hit)
41 {
42 soulng::parser::Match match(false);
43 soulng::parser::Match* parentMatch1 = &match;
44 {
45 soulng::parser::Match match(false);
46 soulng::parser::Match* parentMatch2 = &match;
47 {
48 int64_t pos = lexer.GetPos();
49 soulng::parser::Match match(false);
50 if (*lexer == SEMICOLON)
51 {
52 ++lexer;
53 match.hit = true;
54 }
55 if (match.hit)
56 {
57 {
58 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
59
60 #endif // SOULNG_PARSER_DEBUG_SUPPORT
61 return soulng::parser::Match(true, classSpecifier.release());
62 }
63 }
64 *parentMatch2 = match;
65 }
66 *parentMatch1 = match;
67 }
68 *parentMatch0 = match;
69 }
70 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
71
72
73
74
75
76 #endif // SOULNG_PARSER_DEBUG_SUPPORT
77 if (!match.hit)
78 {
79 match.value = nullptr;
80 }
81 return match;
82 }
83
84 soulng::parser::Match ClassParser::ClassSpecifier(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
85 {
86 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
87
88
89
90
91
92
93
94 #endif // SOULNG_PARSER_DEBUG_SUPPORT
95 std::unique_ptr<sngcpp::ast::ClassNode> classNode = std::unique_ptr<sngcpp::ast::ClassNode>();
96 std::unique_ptr<sngcpp::ast::ClassNode> classHead;
97 soulng::parser::Match match(false);
98 soulng::parser::Match* parentMatch0 = &match;
99 {
100 int64_t pos = lexer.GetPos();
101 soulng::parser::Match match(false);
102 soulng::parser::Match* parentMatch1 = &match;
103 {
104 soulng::parser::Match match(false);
105 soulng::parser::Match* parentMatch2 = &match;
106 {
107 soulng::parser::Match match(false);
108 soulng::parser::Match* parentMatch3 = &match;
109 {
110 soulng::parser::Match match(false);
111 soulng::parser::Match* parentMatch4 = &match;
112 {
113 soulng::parser::Match match(false);
114 soulng::parser::Match* parentMatch5 = &match;
115 {
116 int64_t pos = lexer.GetPos();
117 soulng::parser::Match match = ClassParser::ClassHead(lexer, ctx);
118 classHead.reset(static_cast<sngcpp::ast::ClassNode*>(match.value));
119 if (match.hit)
120 {
121 classNode.reset(classHead.release());
122 }
123 *parentMatch5 = match;
124 }
125 *parentMatch4 = match;
126 }
127 if (match.hit)
128 {
129 soulng::parser::Match match(false);
130 soulng::parser::Match* parentMatch6 = &match;
131 {
132 soulng::parser::Match match(false);
133 soulng::parser::Match* parentMatch7 = &match;
134 {
135 int64_t pos = lexer.GetPos();
136 soulng::lexer::Span span = lexer.GetSpan();
137 soulng::parser::Match match(false);
138 if (*lexer == LBRACE)
139 {
140 ++lexer;
141 match.hit = true;
142 }
143 if (match.hit)
144 {
145 classNode->SetOpenBraceSpan(span);
146 }
147 *parentMatch7 = match;
148 }
149 *parentMatch6 = match;
150 }
151 *parentMatch4 = match;
152 }
153 *parentMatch3 = match;
154 }
155 if (match.hit)
156 {
157 soulng::parser::Match match(false);
158 soulng::parser::Match* parentMatch8 = &match;
159 {
160 soulng::parser::Match match = ClassParser::MemberSpecifications(lexer, ctx, classNode.get());
161 *parentMatch8 = match;
162 }
163 *parentMatch3 = match;
164 }
165 *parentMatch2 = match;
166 }
167 if (match.hit)
168 {
169 soulng::parser::Match match(false);
170 soulng::parser::Match* parentMatch9 = &match;
171 {
172 soulng::parser::Match match(false);
173 soulng::parser::Match* parentMatch10 = &match;
174 {
175 int64_t pos = lexer.GetPos();
176 soulng::lexer::Span span = lexer.GetSpan();
177 soulng::parser::Match match(false);
178 if (*lexer == RBRACE)
179 {
180 ++lexer;
181 match.hit = true;
182 }
183 if (match.hit)
184 {
185 classNode->SetCloseBraceSpan(span);
186 }
187 *parentMatch10 = match;
188 }
189 *parentMatch9 = match;
190 }
191 *parentMatch2 = match;
192 }
193 *parentMatch1 = match;
194 }
195 if (match.hit)
196 {
197 {
198 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
199
200 #endif // SOULNG_PARSER_DEBUG_SUPPORT
201 return soulng::parser::Match(true, classNode.release());
202 }
203 }
204 *parentMatch0 = match;
205 }
206 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
207
208
209
210
211
212 #endif // SOULNG_PARSER_DEBUG_SUPPORT
213 if (!match.hit)
214 {
215 match.value = nullptr;
216 }
217 return match;
218 }
219
220 soulng::parser::Match ClassParser::MemberSpecifications(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx, sngcpp::ast::ClassNode* classNode)
221 {
222 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
223
224
225
226
227
228
229
230 #endif // SOULNG_PARSER_DEBUG_SUPPORT
231 soulng::parser::Match match(true);
232 soulng::parser::Match* parentMatch0 = &match;
233 {
234 while (true)
235 {
236 int64_t save = lexer.GetPos();
237 {
238 soulng::parser::Match match = ClassParser::MemberSpecification(lexer, ctx, classNode);
239 if (match.hit)
240 {
241 *parentMatch0 = match;
242 }
243 else
244 {
245 lexer.SetPos(save);
246 break;
247 }
248 }
249 }
250 }
251 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
252
253
254
255
256
257 #endif // SOULNG_PARSER_DEBUG_SUPPORT
258 if (!match.hit)
259 {
260 match.value = nullptr;
261 }
262 return match;
263 }
264
265 soulng::parser::Match ClassParser::MemberSpecification(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx, sngcpp::ast::ClassNode* classNode)
266 {
267 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
268
269
270
271
272
273
274
275 #endif // SOULNG_PARSER_DEBUG_SUPPORT
276 Span s = Span();
277 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>accessSpecifier;
278 std::unique_ptr<sngcpp::ast::Node> m1;
279 std::unique_ptr<sngcpp::ast::Node> m2;
280 soulng::parser::Match match(false);
281 soulng::parser::Match* parentMatch0 = &match;
282 {
283 soulng::parser::Match match(false);
284 soulng::parser::Match* parentMatch1 = &match;
285 {
286 int64_t save = lexer.GetPos();
287 soulng::parser::Match match(false);
288 soulng::parser::Match* parentMatch2 = &match;
289 {
290 soulng::parser::Match match(false);
291 soulng::parser::Match* parentMatch3 = &match;
292 {
293 soulng::parser::Match match(false);
294 soulng::parser::Match* parentMatch4 = &match;
295 {
296 int64_t pos = lexer.GetPos();
297 soulng::lexer::Span span = lexer.GetSpan();
298 soulng::parser::Match match = ClassParser::AccessSpecifier(lexer);
299 accessSpecifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
300 if (match.hit)
301 {
302 s = span;
303 }
304 *parentMatch4 = match;
305 }
306 *parentMatch3 = match;
307 }
308 if (match.hit)
309 {
310 soulng::parser::Match match(false);
311 soulng::parser::Match* parentMatch5 = &match;
312 {
313 soulng::parser::Match match(false);
314 if (*lexer == COLON)
315 {
316 ++lexer;
317 match.hit = true;
318 }
319 *parentMatch5 = match;
320 }
321 *parentMatch3 = match;
322 }
323 *parentMatch2 = match;
324 }
325 if (match.hit)
326 {
327 soulng::parser::Match match(false);
328 soulng::parser::Match* parentMatch6 = &match;
329 {
330 soulng::parser::Match match(true);
331 soulng::parser::Match* parentMatch7 = &match;
332 {
333 while (true)
334 {
335 int64_t save = lexer.GetPos();
336 {
337 soulng::parser::Match match(false);
338 soulng::parser::Match* parentMatch8 = &match;
339 {
340 soulng::parser::Match match(false);
341 soulng::parser::Match* parentMatch9 = &match;
342 {
343 int64_t pos = lexer.GetPos();
344 soulng::lexer::Span span = lexer.GetSpan();
345 soulng::parser::Match match = ClassParser::MemberDeclaration(lexer, ctx);
346 m1.reset(static_cast<sngcpp::ast::Node*>(match.value));
347 if (match.hit)
348 {
349 s.end = span.end;
350 classNode->AddDeclaration(s, new sngcpp::ast::MemberAccessDeclarationNode(s, accessSpecifier->value, m1.release(), true));
351 }
352 *parentMatch9 = match;
353 }
354 *parentMatch8 = match;
355 }
356 if (match.hit)
357 {
358 *parentMatch7 = match;
359 }
360 else
361 {
362 lexer.SetPos(save);
363 break;
364 }
365 }
366 }
367 }
368 *parentMatch6 = match;
369 }
370 *parentMatch2 = match;
371 }
372 *parentMatch1 = match;
373 if (!match.hit)
374 {
375 soulng::parser::Match match(false);
376 soulng::parser::Match* parentMatch10 = &match;
377 lexer.SetPos(save);
378 {
379 soulng::parser::Match match(false);
380 soulng::parser::Match* parentMatch11 = &match;
381 {
382 soulng::parser::Match match(false);
383 soulng::parser::Match* parentMatch12 = &match;
384 {
385 soulng::parser::Match match(false);
386 soulng::parser::Match* parentMatch13 = &match;
387 {
388 int64_t pos = lexer.GetPos();
389 soulng::lexer::Span span = lexer.GetSpan();
390 soulng::parser::Match match = ClassParser::MemberDeclaration(lexer, ctx);
391 m2.reset(static_cast<sngcpp::ast::Node*>(match.value));
392 if (match.hit)
393 {
394 s = span;
395 classNode->AddDeclaration(s, new sngcpp::ast::MemberAccessDeclarationNode(s, classNode->DefaultAccess(), m2.release(), false));
396 }
397 *parentMatch13 = match;
398 }
399 *parentMatch12 = match;
400 }
401 *parentMatch11 = match;
402 }
403 if (match.hit)
404 {
405 soulng::parser::Match match(true);
406 soulng::parser::Match* parentMatch14 = &match;
407 while (true)
408 {
409 int64_t save = lexer.GetPos();
410 {
411 soulng::parser::Match match(false);
412 soulng::parser::Match* parentMatch15 = &match;
413 {
414 soulng::parser::Match match(false);
415 soulng::parser::Match* parentMatch16 = &match;
416 {
417 int64_t pos = lexer.GetPos();
418 soulng::lexer::Span span = lexer.GetSpan();
419 soulng::parser::Match match = ClassParser::MemberDeclaration(lexer, ctx);
420 m2.reset(static_cast<sngcpp::ast::Node*>(match.value));
421 if (match.hit)
422 {
423 s = span;
424 classNode->AddDeclaration(s, new sngcpp::ast::MemberAccessDeclarationNode(s, classNode->DefaultAccess(), m2.release(), false));
425 }
426 *parentMatch16 = match;
427 }
428 *parentMatch15 = match;
429 }
430 if (match.hit)
431 {
432 *parentMatch14 = match;
433 }
434 else
435 {
436 lexer.SetPos(save);
437 break;
438 }
439 }
440 }
441 }
442 *parentMatch10 = match;
443 }
444 *parentMatch1 = match;
445 }
446 }
447 *parentMatch0 = match;
448 }
449 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
450
451
452
453
454
455 #endif // SOULNG_PARSER_DEBUG_SUPPORT
456 if (!match.hit)
457 {
458 match.value = nullptr;
459 }
460 return match;
461 }
462
463 soulng::parser::Match ClassParser::MemberDeclaration(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
464 {
465 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
466
467
468
469
470
471
472
473 #endif // SOULNG_PARSER_DEBUG_SUPPORT
474 std::unique_ptr<sngcpp::ast::Node> declarator = std::unique_ptr<sngcpp::ast::Node>();
475 Span s = Span();
476 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>declSpecifiers;
477 std::unique_ptr<sngcpp::ast::Node> typeExpr;
478 std::unique_ptr<sngcpp::ast::Node> d;
479 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>virtPureSpecifiers;
480 std::unique_ptr<sngcpp::ast::Node> initializer;
481 std::unique_ptr<sngcpp::ast::Node> specialMemberFunctionDeclaration;
482 std::unique_ptr<sngcpp::ast::Node> functionDefinition;
483 std::unique_ptr<sngcpp::ast::Node> specialMemberFunctionDefition;
484 std::unique_ptr<sngcpp::ast::Node> usingDeclaration;
485 std::unique_ptr<sngcpp::ast::Node> typedefDeclaration;
486 std::unique_ptr<sngcpp::ast::Node> templateDeclaration;
487 std::unique_ptr<sngcpp::ast::Node> classDeclaration;
488 std::unique_ptr<sngcpp::ast::Node> enumDeclaration;
489 std::unique_ptr<sngcpp::ast::Node> aliasDeclaration;
490 std::unique_ptr<sngcpp::ast::Node> forwardClassDeclaration;
491 soulng::parser::Match match(false);
492 soulng::parser::Match* parentMatch0 = &match;
493 {
494 int64_t save = lexer.GetPos();
495 soulng::parser::Match match(false);
496 soulng::parser::Match* parentMatch1 = &match;
497 {
498 int64_t save = lexer.GetPos();
499 soulng::parser::Match match(false);
500 soulng::parser::Match* parentMatch2 = &match;
501 {
502 int64_t save = lexer.GetPos();
503 soulng::parser::Match match(false);
504 soulng::parser::Match* parentMatch3 = &match;
505 {
506 int64_t save = lexer.GetPos();
507 soulng::parser::Match match(false);
508 soulng::parser::Match* parentMatch4 = &match;
509 {
510 int64_t save = lexer.GetPos();
511 soulng::parser::Match match(false);
512 soulng::parser::Match* parentMatch5 = &match;
513 {
514 int64_t save = lexer.GetPos();
515 soulng::parser::Match match(false);
516 soulng::parser::Match* parentMatch6 = &match;
517 {
518 int64_t save = lexer.GetPos();
519 soulng::parser::Match match(false);
520 soulng::parser::Match* parentMatch7 = &match;
521 {
522 int64_t save = lexer.GetPos();
523 soulng::parser::Match match(false);
524 soulng::parser::Match* parentMatch8 = &match;
525 {
526 int64_t save = lexer.GetPos();
527 soulng::parser::Match match(false);
528 soulng::parser::Match* parentMatch9 = &match;
529 {
530 int64_t save = lexer.GetPos();
531 soulng::parser::Match match(false);
532 soulng::parser::Match* parentMatch10 = &match;
533 {
534 soulng::parser::Match match(false);
535 soulng::parser::Match* parentMatch11 = &match;
536 {
537 soulng::parser::Match match(false);
538 soulng::parser::Match* parentMatch12 = &match;
539 {
540 soulng::parser::Match match(false);
541 soulng::parser::Match* parentMatch13 = &match;
542 {
543 soulng::parser::Match match(false);
544 soulng::parser::Match* parentMatch14 = &match;
545 {
546 soulng::parser::Match match(false);
547 soulng::parser::Match* parentMatch15 = &match;
548 {
549 int64_t pos = lexer.GetPos();
550 soulng::lexer::Span span = lexer.GetSpan();
551 soulng::parser::Match match = DeclarationParser::DeclSpecifiers(lexer);
552 declSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
553 if (match.hit)
554 {
555 s = span;
556 }
557 *parentMatch15 = match;
558 }
559 *parentMatch14 = match;
560 }
561 if (match.hit)
562 {
563 soulng::parser::Match match(false);
564 soulng::parser::Match* parentMatch16 = &match;
565 {
566 soulng::parser::Match match = TypeExprParser::TypeExpr(lexer, ctx);
567 typeExpr.reset(static_cast<sngcpp::ast::Node*>(match.value));
568 *parentMatch16 = match;
569 }
570 *parentMatch14 = match;
571 }
572 *parentMatch13 = match;
573 }
574 if (match.hit)
575 {
576 soulng::parser::Match match(false);
577 soulng::parser::Match* parentMatch17 = &match;
578 {
579 soulng::parser::Match match(false);
580 soulng::parser::Match* parentMatch18 = &match;
581 {
582 int64_t pos = lexer.GetPos();
583 soulng::parser::Match match = DeclaratorParser::Declarator(lexer, ctx);
584 d.reset(static_cast<sngcpp::ast::Node*>(match.value));
585 if (match.hit)
586 {
587 declarator.reset(d.release());
588 }
589 *parentMatch18 = match;
590 }
591 *parentMatch17 = match;
592 }
593 *parentMatch13 = match;
594 }
595 *parentMatch12 = match;
596 }
597 if (match.hit)
598 {
599 soulng::parser::Match match(false);
600 soulng::parser::Match* parentMatch19 = &match;
601 {
602 soulng::parser::Match match = ClassParser::VirtPureSpecifiers(lexer, sngcpp::ast::IsFunctionDeclarator(declarator.get()));
603 virtPureSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
604 *parentMatch19 = match;
605 }
606 *parentMatch12 = match;
607 }
608 *parentMatch11 = match;
609 }
610 if (match.hit)
611 {
612 soulng::parser::Match match(false);
613 soulng::parser::Match* parentMatch20 = &match;
614 {
615 soulng::parser::Match match(true);
616 int64_t save = lexer.GetPos();
617 soulng::parser::Match* parentMatch21 = &match;
618 {
619 soulng::parser::Match match = DeclaratorParser::BraceOrEqualInitializer(lexer, ctx);
620 initializer.reset(static_cast<sngcpp::ast::Node*>(match.value));
621 if (match.hit)
622 {
623 *parentMatch21 = match;
624 }
625 else
626 {
627 lexer.SetPos(save);
628 }
629 }
630 *parentMatch20 = match;
631 }
632 *parentMatch11 = match;
633 }
634 *parentMatch10 = match;
635 }
636 if (match.hit)
637 {
638 soulng::parser::Match match(false);
639 soulng::parser::Match* parentMatch22 = &match;
640 {
641 soulng::parser::Match match(false);
642 soulng::parser::Match* parentMatch23 = &match;
643 {
644 int64_t pos = lexer.GetPos();
645 soulng::lexer::Span span = lexer.GetSpan();
646 soulng::parser::Match match(false);
647 if (*lexer == SEMICOLON)
648 {
649 ++lexer;
650 match.hit = true;
651 }
652 if (match.hit)
653 {
654 s.end = span.end;
655 {
656 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
657
658 #endif // SOULNG_PARSER_DEBUG_SUPPORT
659 return soulng::parser::Match(true, new sngcpp::ast::MemberDeclarationNode(s, declSpecifiers->value | virtPureSpecifiers->value, typeExpr.release(), declarator.release(), initializer.release()));
660 }
661 }
662 *parentMatch23 = match;
663 }
664 *parentMatch22 = match;
665 }
666 *parentMatch10 = match;
667 }
668 *parentMatch9 = match;
669 if (!match.hit)
670 {
671 soulng::parser::Match match(false);
672 soulng::parser::Match* parentMatch24 = &match;
673 lexer.SetPos(save);
674 {
675 soulng::parser::Match match(false);
676 soulng::parser::Match* parentMatch25 = &match;
677 {
678 int64_t pos = lexer.GetPos();
679 soulng::parser::Match match = ClassParser::SpecialMemberFunctionDeclaration(lexer, ctx);
680 specialMemberFunctionDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
681 if (match.hit)
682 {
683 {
684 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
685
686 #endif // SOULNG_PARSER_DEBUG_SUPPORT
687 return soulng::parser::Match(true, specialMemberFunctionDeclaration.release());
688 }
689 }
690 *parentMatch25 = match;
691 }
692 *parentMatch24 = match;
693 }
694 *parentMatch9 = match;
695 }
696 }
697 *parentMatch8 = match;
698 if (!match.hit)
699 {
700 soulng::parser::Match match(false);
701 soulng::parser::Match* parentMatch26 = &match;
702 lexer.SetPos(save);
703 {
704 soulng::parser::Match match(false);
705 soulng::parser::Match* parentMatch27 = &match;
706 {
707 int64_t pos = lexer.GetPos();
708 soulng::parser::Match match(false);
709 soulng::parser::Match* parentMatch28 = &match;
710 {
711 soulng::parser::Match match(false);
712 soulng::parser::Match* parentMatch29 = &match;
713 {
714 soulng::parser::Match match = FunctionParser::FunctionDefinition(lexer, ctx);
715 functionDefinition.reset(static_cast<sngcpp::ast::Node*>(match.value));
716 *parentMatch29 = match;
717 }
718 if (match.hit)
719 {
720 soulng::parser::Match match(false);
721 soulng::parser::Match* parentMatch30 = &match;
722 {
723 soulng::parser::Match match(true);
724 int64_t save = lexer.GetPos();
725 soulng::parser::Match* parentMatch31 = &match;
726 {
727 soulng::parser::Match match(false);
728 if (*lexer == SEMICOLON)
729 {
730 ++lexer;
731 match.hit = true;
732 }
733 if (match.hit)
734 {
735 *parentMatch31 = match;
736 }
737 else
738 {
739 lexer.SetPos(save);
740 }
741 }
742 *parentMatch30 = match;
743 }
744 *parentMatch29 = match;
745 }
746 *parentMatch28 = match;
747 }
748 if (match.hit)
749 {
750 {
751 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
752
753 #endif // SOULNG_PARSER_DEBUG_SUPPORT
754 return soulng::parser::Match(true, functionDefinition.release());
755 }
756 }
757 *parentMatch27 = match;
758 }
759 *parentMatch26 = match;
760 }
761 *parentMatch8 = match;
762 }
763 }
764 *parentMatch7 = match;
765 if (!match.hit)
766 {
767 soulng::parser::Match match(false);
768 soulng::parser::Match* parentMatch32 = &match;
769 lexer.SetPos(save);
770 {
771 soulng::parser::Match match(false);
772 soulng::parser::Match* parentMatch33 = &match;
773 {
774 int64_t pos = lexer.GetPos();
775 soulng::parser::Match match(false);
776 soulng::parser::Match* parentMatch34 = &match;
777 {
778 soulng::parser::Match match(false);
779 soulng::parser::Match* parentMatch35 = &match;
780 {
781 soulng::parser::Match match = ClassParser::SpecialMemberFunctionDefinition(lexer, ctx);
782 specialMemberFunctionDefition.reset(static_cast<sngcpp::ast::Node*>(match.value));
783 *parentMatch35 = match;
784 }
785 if (match.hit)
786 {
787 soulng::parser::Match match(false);
788 soulng::parser::Match* parentMatch36 = &match;
789 {
790 soulng::parser::Match match(true);
791 int64_t save = lexer.GetPos();
792 soulng::parser::Match* parentMatch37 = &match;
793 {
794 soulng::parser::Match match(false);
795 if (*lexer == SEMICOLON)
796 {
797 ++lexer;
798 match.hit = true;
799 }
800 if (match.hit)
801 {
802 *parentMatch37 = match;
803 }
804 else
805 {
806 lexer.SetPos(save);
807 }
808 }
809 *parentMatch36 = match;
810 }
811 *parentMatch35 = match;
812 }
813 *parentMatch34 = match;
814 }
815 if (match.hit)
816 {
817 {
818 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
819
820 #endif // SOULNG_PARSER_DEBUG_SUPPORT
821 return soulng::parser::Match(true, specialMemberFunctionDefition.release());
822 }
823 }
824 *parentMatch33 = match;
825 }
826 *parentMatch32 = match;
827 }
828 *parentMatch7 = match;
829 }
830 }
831 *parentMatch6 = match;
832 if (!match.hit)
833 {
834 soulng::parser::Match match(false);
835 soulng::parser::Match* parentMatch38 = &match;
836 lexer.SetPos(save);
837 {
838 soulng::parser::Match match(false);
839 soulng::parser::Match* parentMatch39 = &match;
840 {
841 int64_t pos = lexer.GetPos();
842 soulng::parser::Match match = DeclarationParser::UsingDeclaration(lexer, ctx);
843 usingDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
844 if (match.hit)
845 {
846 {
847 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
848
849 #endif // SOULNG_PARSER_DEBUG_SUPPORT
850 return soulng::parser::Match(true, usingDeclaration.release());
851 }
852 }
853 *parentMatch39 = match;
854 }
855 *parentMatch38 = match;
856 }
857 *parentMatch6 = match;
858 }
859 }
860 *parentMatch5 = match;
861 if (!match.hit)
862 {
863 soulng::parser::Match match(false);
864 soulng::parser::Match* parentMatch40 = &match;
865 lexer.SetPos(save);
866 {
867 soulng::parser::Match match(false);
868 soulng::parser::Match* parentMatch41 = &match;
869 {
870 int64_t pos = lexer.GetPos();
871 soulng::parser::Match match = DeclarationParser::TypedefDeclaration(lexer, ctx);
872 typedefDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
873 if (match.hit)
874 {
875 {
876 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
877
878 #endif // SOULNG_PARSER_DEBUG_SUPPORT
879 return soulng::parser::Match(true, typedefDeclaration.release());
880 }
881 }
882 *parentMatch41 = match;
883 }
884 *parentMatch40 = match;
885 }
886 *parentMatch5 = match;
887 }
888 }
889 *parentMatch4 = match;
890 if (!match.hit)
891 {
892 soulng::parser::Match match(false);
893 soulng::parser::Match* parentMatch42 = &match;
894 lexer.SetPos(save);
895 {
896 soulng::parser::Match match(false);
897 soulng::parser::Match* parentMatch43 = &match;
898 {
899 int64_t pos = lexer.GetPos();
900 soulng::parser::Match match = TemplateParser::TemplateDeclaration(lexer, ctx);
901 templateDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
902 if (match.hit)
903 {
904 {
905 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
906
907 #endif // SOULNG_PARSER_DEBUG_SUPPORT
908 return soulng::parser::Match(true, templateDeclaration.release());
909 }
910 }
911 *parentMatch43 = match;
912 }
913 *parentMatch42 = match;
914 }
915 *parentMatch4 = match;
916 }
917 }
918 *parentMatch3 = match;
919 if (!match.hit)
920 {
921 soulng::parser::Match match(false);
922 soulng::parser::Match* parentMatch44 = &match;
923 lexer.SetPos(save);
924 {
925 soulng::parser::Match match(false);
926 soulng::parser::Match* parentMatch45 = &match;
927 {
928 int64_t pos = lexer.GetPos();
929 soulng::parser::Match match = ClassParser::ClassDeclaration(lexer, ctx);
930 classDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
931 if (match.hit)
932 {
933 {
934 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
935
936 #endif // SOULNG_PARSER_DEBUG_SUPPORT
937 return soulng::parser::Match(true, classDeclaration.release());
938 }
939 }
940 *parentMatch45 = match;
941 }
942 *parentMatch44 = match;
943 }
944 *parentMatch3 = match;
945 }
946 }
947 *parentMatch2 = match;
948 if (!match.hit)
949 {
950 soulng::parser::Match match(false);
951 soulng::parser::Match* parentMatch46 = &match;
952 lexer.SetPos(save);
953 {
954 soulng::parser::Match match(false);
955 soulng::parser::Match* parentMatch47 = &match;
956 {
957 int64_t pos = lexer.GetPos();
958 soulng::parser::Match match = EnumerationParser::EnumDeclaration(lexer, ctx);
959 enumDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
960 if (match.hit)
961 {
962 {
963 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
964
965 #endif // SOULNG_PARSER_DEBUG_SUPPORT
966 return soulng::parser::Match(true, enumDeclaration.release());
967 }
968 }
969 *parentMatch47 = match;
970 }
971 *parentMatch46 = match;
972 }
973 *parentMatch2 = match;
974 }
975 }
976 *parentMatch1 = match;
977 if (!match.hit)
978 {
979 soulng::parser::Match match(false);
980 soulng::parser::Match* parentMatch48 = &match;
981 lexer.SetPos(save);
982 {
983 soulng::parser::Match match(false);
984 soulng::parser::Match* parentMatch49 = &match;
985 {
986 int64_t pos = lexer.GetPos();
987 soulng::parser::Match match = DeclarationParser::AliasDeclaration(lexer, ctx);
988 aliasDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
989 if (match.hit)
990 {
991 {
992 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
993
994 #endif // SOULNG_PARSER_DEBUG_SUPPORT
995 return soulng::parser::Match(true, aliasDeclaration.release());
996 }
997 }
998 *parentMatch49 = match;
999 }
1000 *parentMatch48 = match;
1001 }
1002 *parentMatch1 = match;
1003 }
1004 }
1005 *parentMatch0 = match;
1006 if (!match.hit)
1007 {
1008 soulng::parser::Match match(false);
1009 soulng::parser::Match* parentMatch50 = &match;
1010 lexer.SetPos(save);
1011 {
1012 soulng::parser::Match match(false);
1013 soulng::parser::Match* parentMatch51 = &match;
1014 {
1015 int64_t pos = lexer.GetPos();
1016 soulng::parser::Match match = ClassParser::ForwardClassDeclaration(lexer, ctx);
1017 forwardClassDeclaration.reset(static_cast<sngcpp::ast::Node*>(match.value));
1018 if (match.hit)
1019 {
1020 {
1021 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1022
1023 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1024 return soulng::parser::Match(true, forwardClassDeclaration.release());
1025 }
1026 }
1027 *parentMatch51 = match;
1028 }
1029 *parentMatch50 = match;
1030 }
1031 *parentMatch0 = match;
1032 }
1033 }
1034 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1035
1036
1037
1038
1039
1040 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1041 if (!match.hit)
1042 {
1043 match.value = nullptr;
1044 }
1045 return match;
1046 }
1047
1048 soulng::parser::Match ClassParser::SpecialMemberFunctionDeclaration(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
1049 {
1050 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1051
1052
1053
1054
1055
1056
1057
1058 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1059 std::unique_ptr<sngcpp::ast::Node> declarator = std::unique_ptr<sngcpp::ast::Node>();
1060 Span s = Span();
1061 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>declSpecifiers;
1062 std::unique_ptr<sngcpp::ast::Node> d;
1063 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>virtPureSpecifiers;
1064 soulng::parser::Match match(false);
1065 soulng::parser::Match* parentMatch0 = &match;
1066 {
1067 soulng::parser::Match match(false);
1068 soulng::parser::Match* parentMatch1 = &match;
1069 {
1070 soulng::parser::Match match(false);
1071 soulng::parser::Match* parentMatch2 = &match;
1072 {
1073 soulng::parser::Match match(false);
1074 soulng::parser::Match* parentMatch3 = &match;
1075 {
1076 int64_t pos = lexer.GetPos();
1077 soulng::lexer::Span span = lexer.GetSpan();
1078 soulng::parser::Match match = DeclarationParser::DeclSpecifiers(lexer);
1079 declSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1080 if (match.hit)
1081 {
1082 s = span;
1083 }
1084 *parentMatch3 = match;
1085 }
1086 *parentMatch2 = match;
1087 }
1088 if (match.hit)
1089 {
1090 soulng::parser::Match match(false);
1091 soulng::parser::Match* parentMatch4 = &match;
1092 {
1093 soulng::parser::Match match(false);
1094 soulng::parser::Match* parentMatch5 = &match;
1095 {
1096 int64_t pos = lexer.GetPos();
1097 bool pass = true;
1098 soulng::parser::Match match = DeclaratorParser::Declarator(lexer, ctx);
1099 d.reset(static_cast<sngcpp::ast::Node*>(match.value));
1100 if (match.hit)
1101 {
1102 declarator.reset(d.release());
1103 pass = sngcpp::ast::IsFunctionDeclarator(declarator.get());
1104 }
1105 if (match.hit && !pass)
1106 {
1107 match = soulng::parser::Match(false);
1108 }
1109 *parentMatch5 = match;
1110 }
1111 *parentMatch4 = match;
1112 }
1113 *parentMatch2 = match;
1114 }
1115 *parentMatch1 = match;
1116 }
1117 if (match.hit)
1118 {
1119 soulng::parser::Match match(false);
1120 soulng::parser::Match* parentMatch6 = &match;
1121 {
1122 soulng::parser::Match match = ClassParser::VirtPureSpecifiers(lexer, true);
1123 virtPureSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1124 *parentMatch6 = match;
1125 }
1126 *parentMatch1 = match;
1127 }
1128 *parentMatch0 = match;
1129 }
1130 if (match.hit)
1131 {
1132 soulng::parser::Match match(false);
1133 soulng::parser::Match* parentMatch7 = &match;
1134 {
1135 soulng::parser::Match match(false);
1136 soulng::parser::Match* parentMatch8 = &match;
1137 {
1138 int64_t pos = lexer.GetPos();
1139 soulng::lexer::Span span = lexer.GetSpan();
1140 soulng::parser::Match match(false);
1141 if (*lexer == SEMICOLON)
1142 {
1143 ++lexer;
1144 match.hit = true;
1145 }
1146 if (match.hit)
1147 {
1148 s.end = span.end;
1149 {
1150 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1151
1152 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1153 return soulng::parser::Match(true, new sngcpp::ast::MemberDeclarationNode(s, declSpecifiers->value | virtPureSpecifiers->value, nullptr, declarator.release(), nullptr));
1154 }
1155 }
1156 *parentMatch8 = match;
1157 }
1158 *parentMatch7 = match;
1159 }
1160 *parentMatch0 = match;
1161 }
1162 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1163
1164
1165
1166
1167
1168 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1169 if (!match.hit)
1170 {
1171 match.value = nullptr;
1172 }
1173 return match;
1174 }
1175
1176 soulng::parser::Match ClassParser::ClassHead(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
1177 {
1178 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1179
1180
1181
1182
1183
1184
1185
1186 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1187 Span s = Span();
1188 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::ClassKey>>classKey;
1189 std::unique_ptr<sngcpp::ast::Node> className;
1190 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>classVirtSpecifiers;
1191 std::unique_ptr<sngcpp::ast::Node> baseClause;
1192 soulng::parser::Match match(false);
1193 soulng::parser::Match* parentMatch0 = &match;
1194 {
1195 int64_t pos = lexer.GetPos();
1196 soulng::parser::Match match(false);
1197 soulng::parser::Match* parentMatch1 = &match;
1198 {
1199 soulng::parser::Match match(false);
1200 soulng::parser::Match* parentMatch2 = &match;
1201 {
1202 soulng::parser::Match match(false);
1203 soulng::parser::Match* parentMatch3 = &match;
1204 {
1205 soulng::parser::Match match(false);
1206 soulng::parser::Match* parentMatch4 = &match;
1207 {
1208 soulng::parser::Match match(false);
1209 soulng::parser::Match* parentMatch5 = &match;
1210 {
1211 int64_t pos = lexer.GetPos();
1212 soulng::lexer::Span span = lexer.GetSpan();
1213 soulng::parser::Match match = ClassParser::ClassKey(lexer);
1214 classKey.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::ClassKey>*>(match.value));
1215 if (match.hit)
1216 {
1217 s = span;
1218 }
1219 *parentMatch5 = match;
1220 }
1221 *parentMatch4 = match;
1222 }
1223 if (match.hit)
1224 {
1225 soulng::parser::Match match(false);
1226 soulng::parser::Match* parentMatch6 = &match;
1227 {
1228 soulng::parser::Match match = ClassParser::ClassName(lexer, ctx);
1229 className.reset(static_cast<sngcpp::ast::Node*>(match.value));
1230 *parentMatch6 = match;
1231 }
1232 *parentMatch4 = match;
1233 }
1234 *parentMatch3 = match;
1235 }
1236 if (match.hit)
1237 {
1238 soulng::parser::Match match(false);
1239 soulng::parser::Match* parentMatch7 = &match;
1240 {
1241 soulng::parser::Match match(false);
1242 soulng::parser::Match* parentMatch8 = &match;
1243 {
1244 int64_t pos = lexer.GetPos();
1245 soulng::lexer::Span span = lexer.GetSpan();
1246 soulng::parser::Match match = ClassParser::ClassVirtSpecifiers(lexer);
1247 classVirtSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1248 if (match.hit)
1249 {
1250 s.end = span.end;
1251 }
1252 *parentMatch8 = match;
1253 }
1254 *parentMatch7 = match;
1255 }
1256 *parentMatch3 = match;
1257 }
1258 *parentMatch2 = match;
1259 }
1260 if (match.hit)
1261 {
1262 soulng::parser::Match match(false);
1263 soulng::parser::Match* parentMatch9 = &match;
1264 {
1265 soulng::parser::Match match(true);
1266 int64_t save = lexer.GetPos();
1267 soulng::parser::Match* parentMatch10 = &match;
1268 {
1269 soulng::parser::Match match(false);
1270 soulng::parser::Match* parentMatch11 = &match;
1271 {
1272 soulng::parser::Match match(false);
1273 soulng::parser::Match* parentMatch12 = &match;
1274 {
1275 int64_t pos = lexer.GetPos();
1276 soulng::lexer::Span span = lexer.GetSpan();
1277 soulng::parser::Match match = ClassParser::BaseClause(lexer, ctx);
1278 baseClause.reset(static_cast<sngcpp::ast::Node*>(match.value));
1279 if (match.hit)
1280 {
1281 s.end = span.end;
1282 }
1283 *parentMatch12 = match;
1284 }
1285 *parentMatch11 = match;
1286 }
1287 if (match.hit)
1288 {
1289 *parentMatch10 = match;
1290 }
1291 else
1292 {
1293 lexer.SetPos(save);
1294 }
1295 }
1296 *parentMatch9 = match;
1297 }
1298 *parentMatch2 = match;
1299 }
1300 *parentMatch1 = match;
1301 }
1302 if (match.hit)
1303 {
1304 {
1305 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1306
1307 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1308 return soulng::parser::Match(true, new sngcpp::ast::ClassNode(s, classKey->value, className.release(), classVirtSpecifiers->value, baseClause.release()));
1309 }
1310 }
1311 *parentMatch0 = match;
1312 }
1313 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1314
1315
1316
1317
1318
1319 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1320 if (!match.hit)
1321 {
1322 match.value = nullptr;
1323 }
1324 return match;
1325 }
1326
1327 soulng::parser::Match ClassParser::ForwardClassDeclaration(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
1328 {
1329 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1330
1331
1332
1333
1334
1335
1336
1337 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1338 Span s = Span();
1339 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::ClassKey>>classKey;
1340 std::unique_ptr<sngcpp::ast::Node> className;
1341 soulng::parser::Match match(false);
1342 soulng::parser::Match* parentMatch0 = &match;
1343 {
1344 soulng::parser::Match match(false);
1345 soulng::parser::Match* parentMatch1 = &match;
1346 {
1347 soulng::parser::Match match(false);
1348 soulng::parser::Match* parentMatch2 = &match;
1349 {
1350 int64_t pos = lexer.GetPos();
1351 soulng::lexer::Span span = lexer.GetSpan();
1352 soulng::parser::Match match = ClassParser::ClassKey(lexer);
1353 classKey.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::ClassKey>*>(match.value));
1354 if (match.hit)
1355 {
1356 s = span;
1357 }
1358 *parentMatch2 = match;
1359 }
1360 *parentMatch1 = match;
1361 }
1362 if (match.hit)
1363 {
1364 soulng::parser::Match match(false);
1365 soulng::parser::Match* parentMatch3 = &match;
1366 {
1367 soulng::parser::Match match = ClassParser::ClassName(lexer, ctx);
1368 className.reset(static_cast<sngcpp::ast::Node*>(match.value));
1369 *parentMatch3 = match;
1370 }
1371 *parentMatch1 = match;
1372 }
1373 *parentMatch0 = match;
1374 }
1375 if (match.hit)
1376 {
1377 soulng::parser::Match match(false);
1378 soulng::parser::Match* parentMatch4 = &match;
1379 {
1380 soulng::parser::Match match(false);
1381 soulng::parser::Match* parentMatch5 = &match;
1382 {
1383 int64_t pos = lexer.GetPos();
1384 soulng::lexer::Span span = lexer.GetSpan();
1385 soulng::parser::Match match(false);
1386 if (*lexer == SEMICOLON)
1387 {
1388 ++lexer;
1389 match.hit = true;
1390 }
1391 if (match.hit)
1392 {
1393 s.end = span.end;
1394 {
1395 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1396
1397 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1398 return soulng::parser::Match(true, new sngcpp::ast::ForwardClassDeclarationNode(s, classKey->value, className.release()));
1399 }
1400 }
1401 *parentMatch5 = match;
1402 }
1403 *parentMatch4 = match;
1404 }
1405 *parentMatch0 = match;
1406 }
1407 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1408
1409
1410
1411
1412
1413 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1414 if (!match.hit)
1415 {
1416 match.value = nullptr;
1417 }
1418 return match;
1419 }
1420
1421 soulng::parser::Match ClassParser::ClassKey(CppLexer& lexer)
1422 {
1423 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1424
1425
1426
1427
1428
1429
1430
1431 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1432 soulng::parser::Match match(false);
1433 int64_t pos = lexer.GetPos();
1434 soulng::lexer::Span span = lexer.GetSpan();
1435 switch (*lexer)
1436 {
1437 case CLASS:
1438 {
1439 ++lexer;
1440 {
1441 {
1442 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1443
1444 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1445 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::ClassKey>(sngcpp::ast::ClassKey::class_));
1446 }
1447 }
1448 break;
1449 }
1450 case STRUCT:
1451 {
1452 ++lexer;
1453 {
1454 {
1455 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1456
1457 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1458 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::ClassKey>(sngcpp::ast::ClassKey::struct_));
1459 }
1460 }
1461 break;
1462 }
1463 case UNION:
1464 {
1465 ++lexer;
1466 {
1467 {
1468 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1469
1470 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1471 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::ClassKey>(sngcpp::ast::ClassKey::union_));
1472 }
1473 }
1474 break;
1475 }
1476 }
1477 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1478
1479
1480
1481
1482
1483 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1484 if (!match.hit)
1485 {
1486 match.value = nullptr;
1487 }
1488 return match;
1489 }
1490
1491 soulng::parser::Match ClassParser::ClassName(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
1492 {
1493 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1494
1495
1496
1497
1498
1499
1500
1501 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1502 std::unique_ptr<sngcpp::ast::Node> className;
1503 soulng::parser::Match match(false);
1504 soulng::parser::Match* parentMatch0 = &match;
1505 {
1506 int64_t pos = lexer.GetPos();
1507 soulng::parser::Match match = IdentifierParser::QualifiedIdNode(lexer, ctx);
1508 className.reset(static_cast<sngcpp::ast::Node*>(match.value));
1509 if (match.hit)
1510 {
1511 {
1512 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1513
1514 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1515 return soulng::parser::Match(true, className.release());
1516 }
1517 }
1518 *parentMatch0 = match;
1519 }
1520 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1521
1522
1523
1524
1525
1526 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1527 if (!match.hit)
1528 {
1529 match.value = nullptr;
1530 }
1531 return match;
1532 }
1533
1534 soulng::parser::Match ClassParser::ClassVirtSpecifiers(CppLexer& lexer)
1535 {
1536 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1537
1538
1539
1540
1541
1542
1543
1544 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1545 sngcpp::ast::Specifier specifiers = sngcpp::ast::Specifier();
1546 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>specifier;
1547 soulng::parser::Match match(false);
1548 soulng::parser::Match* parentMatch0 = &match;
1549 {
1550 int64_t pos = lexer.GetPos();
1551 soulng::parser::Match match(false);
1552 soulng::parser::Match* parentMatch1 = &match;
1553 {
1554 soulng::parser::Match match(true);
1555 soulng::parser::Match* parentMatch2 = &match;
1556 {
1557 while (true)
1558 {
1559 int64_t save = lexer.GetPos();
1560 {
1561 soulng::parser::Match match(false);
1562 soulng::parser::Match* parentMatch3 = &match;
1563 {
1564 soulng::parser::Match match(false);
1565 soulng::parser::Match* parentMatch4 = &match;
1566 {
1567 int64_t pos = lexer.GetPos();
1568 soulng::parser::Match match = ClassParser::ClassVirtSpecifier(lexer);
1569 specifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1570 if (match.hit)
1571 {
1572 specifiers = specifiers | specifier->value;
1573 }
1574 *parentMatch4 = match;
1575 }
1576 *parentMatch3 = match;
1577 }
1578 if (match.hit)
1579 {
1580 *parentMatch2 = match;
1581 }
1582 else
1583 {
1584 lexer.SetPos(save);
1585 break;
1586 }
1587 }
1588 }
1589 }
1590 *parentMatch1 = match;
1591 }
1592 if (match.hit)
1593 {
1594 {
1595 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1596
1597 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1598 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(specifiers));
1599 }
1600 }
1601 *parentMatch0 = match;
1602 }
1603 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1604
1605
1606
1607
1608
1609 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1610 if (!match.hit)
1611 {
1612 match.value = nullptr;
1613 }
1614 return match;
1615 }
1616
1617 soulng::parser::Match ClassParser::ClassVirtSpecifier(CppLexer& lexer)
1618 {
1619 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1620
1621
1622
1623
1624
1625
1626
1627 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1628 soulng::parser::Match match(false);
1629 int64_t pos = lexer.GetPos();
1630 soulng::lexer::Span span = lexer.GetSpan();
1631 switch (*lexer)
1632 {
1633 case FINAL:
1634 {
1635 ++lexer;
1636 {
1637 {
1638 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1639
1640 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1641 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::final_));
1642 }
1643 }
1644 break;
1645 }
1646 case EXPLICIT:
1647 {
1648 ++lexer;
1649 {
1650 {
1651 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1652
1653 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1654 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::explicit_));
1655 }
1656 }
1657 break;
1658 }
1659 }
1660 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1661
1662
1663
1664
1665
1666 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1667 if (!match.hit)
1668 {
1669 match.value = nullptr;
1670 }
1671 return match;
1672 }
1673
1674 soulng::parser::Match ClassParser::BaseClause(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
1675 {
1676 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1677
1678
1679
1680
1681
1682
1683
1684 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1685 std::unique_ptr<sngcpp::ast::Node> bc;
1686 soulng::parser::Match match(false);
1687 soulng::parser::Match* parentMatch0 = &match;
1688 {
1689 soulng::parser::Match match(false);
1690 if (*lexer == COLON)
1691 {
1692 ++lexer;
1693 match.hit = true;
1694 }
1695 *parentMatch0 = match;
1696 }
1697 if (match.hit)
1698 {
1699 soulng::parser::Match match(false);
1700 soulng::parser::Match* parentMatch1 = &match;
1701 {
1702 soulng::parser::Match match(false);
1703 soulng::parser::Match* parentMatch2 = &match;
1704 {
1705 int64_t pos = lexer.GetPos();
1706 soulng::parser::Match match = ClassParser::BaseClassSpecifierList(lexer, ctx);
1707 bc.reset(static_cast<sngcpp::ast::Node*>(match.value));
1708 if (match.hit)
1709 {
1710 {
1711 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1712
1713 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1714 return soulng::parser::Match(true, bc.release());
1715 }
1716 }
1717 *parentMatch2 = match;
1718 }
1719 *parentMatch1 = match;
1720 }
1721 *parentMatch0 = match;
1722 }
1723 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1724
1725
1726
1727
1728
1729 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1730 if (!match.hit)
1731 {
1732 match.value = nullptr;
1733 }
1734 return match;
1735 }
1736
1737 soulng::parser::Match ClassParser::BaseClassSpecifierList(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
1738 {
1739 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1740
1741
1742
1743
1744
1745
1746
1747 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1748 std::unique_ptr<sngcpp::ast::Node> node = std::unique_ptr<sngcpp::ast::Node>();
1749 Span s = Span();
1750 std::unique_ptr<sngcpp::ast::Node> b1;
1751 std::unique_ptr<sngcpp::ast::Node> b2;
1752 soulng::parser::Match match(false);
1753 soulng::parser::Match* parentMatch0 = &match;
1754 {
1755 int64_t pos = lexer.GetPos();
1756 soulng::parser::Match match(false);
1757 soulng::parser::Match* parentMatch1 = &match;
1758 {
1759 soulng::parser::Match match(false);
1760 soulng::parser::Match* parentMatch2 = &match;
1761 {
1762 soulng::parser::Match match(false);
1763 soulng::parser::Match* parentMatch3 = &match;
1764 {
1765 int64_t pos = lexer.GetPos();
1766 soulng::lexer::Span span = lexer.GetSpan();
1767 soulng::parser::Match match = ClassParser::BaseClassSpecifier(lexer, ctx);
1768 b1.reset(static_cast<sngcpp::ast::Node*>(match.value));
1769 if (match.hit)
1770 {
1771 s = span;
1772 node.reset(b1.release());
1773 }
1774 *parentMatch3 = match;
1775 }
1776 *parentMatch2 = match;
1777 }
1778 if (match.hit)
1779 {
1780 soulng::parser::Match match(false);
1781 soulng::parser::Match* parentMatch4 = &match;
1782 {
1783 soulng::parser::Match match(true);
1784 soulng::parser::Match* parentMatch5 = &match;
1785 {
1786 while (true)
1787 {
1788 int64_t save = lexer.GetPos();
1789 {
1790 soulng::parser::Match match(false);
1791 soulng::parser::Match* parentMatch6 = &match;
1792 {
1793 soulng::parser::Match match(false);
1794 soulng::parser::Match* parentMatch7 = &match;
1795 {
1796 soulng::parser::Match match(false);
1797 if (*lexer == COMMA)
1798 {
1799 ++lexer;
1800 match.hit = true;
1801 }
1802 *parentMatch7 = match;
1803 }
1804 if (match.hit)
1805 {
1806 soulng::parser::Match match(false);
1807 soulng::parser::Match* parentMatch8 = &match;
1808 {
1809 soulng::parser::Match match(false);
1810 soulng::parser::Match* parentMatch9 = &match;
1811 {
1812 int64_t pos = lexer.GetPos();
1813 soulng::lexer::Span span = lexer.GetSpan();
1814 soulng::parser::Match match = ClassParser::BaseClassSpecifier(lexer, ctx);
1815 b2.reset(static_cast<sngcpp::ast::Node*>(match.value));
1816 if (match.hit)
1817 {
1818 s.end = span.end;
1819 node.reset(new sngcpp::ast::BaseClassSpecifierSequenceNode(s, node.release(), b2.release()));
1820 }
1821 *parentMatch9 = match;
1822 }
1823 *parentMatch8 = match;
1824 }
1825 *parentMatch7 = match;
1826 }
1827 *parentMatch6 = match;
1828 }
1829 if (match.hit)
1830 {
1831 *parentMatch5 = match;
1832 }
1833 else
1834 {
1835 lexer.SetPos(save);
1836 break;
1837 }
1838 }
1839 }
1840 }
1841 *parentMatch4 = match;
1842 }
1843 *parentMatch2 = match;
1844 }
1845 *parentMatch1 = match;
1846 }
1847 if (match.hit)
1848 {
1849 {
1850 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1851
1852 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1853 return soulng::parser::Match(true, node.release());
1854 }
1855 }
1856 *parentMatch0 = match;
1857 }
1858 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1859
1860
1861
1862
1863
1864 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1865 if (!match.hit)
1866 {
1867 match.value = nullptr;
1868 }
1869 return match;
1870 }
1871
1872 soulng::parser::Match ClassParser::BaseClassSpecifier(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
1873 {
1874 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1875
1876
1877
1878
1879
1880
1881
1882 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1883 Span s = Span();
1884 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>baseSpecifiers;
1885 std::unique_ptr<sngcpp::ast::Node> className;
1886 soulng::parser::Match match(false);
1887 soulng::parser::Match* parentMatch0 = &match;
1888 {
1889 soulng::parser::Match match(false);
1890 soulng::parser::Match* parentMatch1 = &match;
1891 {
1892 int64_t pos = lexer.GetPos();
1893 soulng::lexer::Span span = lexer.GetSpan();
1894 soulng::parser::Match match = ClassParser::BaseSpecifiers(lexer);
1895 baseSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1896 if (match.hit)
1897 {
1898 s = span;
1899 }
1900 *parentMatch1 = match;
1901 }
1902 *parentMatch0 = match;
1903 }
1904 if (match.hit)
1905 {
1906 soulng::parser::Match match(false);
1907 soulng::parser::Match* parentMatch2 = &match;
1908 {
1909 soulng::parser::Match match(false);
1910 soulng::parser::Match* parentMatch3 = &match;
1911 {
1912 int64_t pos = lexer.GetPos();
1913 soulng::lexer::Span span = lexer.GetSpan();
1914 soulng::parser::Match match = ClassParser::ClassName(lexer, ctx);
1915 className.reset(static_cast<sngcpp::ast::Node*>(match.value));
1916 if (match.hit)
1917 {
1918 s.end = span.end;
1919 {
1920 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1921
1922 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1923 return soulng::parser::Match(true, new sngcpp::ast::BaseClassSpecifierNode(s, baseSpecifiers->value, className.release()));
1924 }
1925 }
1926 *parentMatch3 = match;
1927 }
1928 *parentMatch2 = match;
1929 }
1930 *parentMatch0 = match;
1931 }
1932 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1933
1934
1935
1936
1937
1938 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1939 if (!match.hit)
1940 {
1941 match.value = nullptr;
1942 }
1943 return match;
1944 }
1945
1946 soulng::parser::Match ClassParser::BaseSpecifiers(CppLexer& lexer)
1947 {
1948 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
1949
1950
1951
1952
1953
1954
1955
1956 #endif // SOULNG_PARSER_DEBUG_SUPPORT
1957 sngcpp::ast::Specifier specifiers = sngcpp::ast::Specifier();
1958 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>specifier;
1959 soulng::parser::Match match(false);
1960 soulng::parser::Match* parentMatch0 = &match;
1961 {
1962 int64_t pos = lexer.GetPos();
1963 soulng::parser::Match match(false);
1964 soulng::parser::Match* parentMatch1 = &match;
1965 {
1966 soulng::parser::Match match(true);
1967 soulng::parser::Match* parentMatch2 = &match;
1968 {
1969 while (true)
1970 {
1971 int64_t save = lexer.GetPos();
1972 {
1973 soulng::parser::Match match(false);
1974 soulng::parser::Match* parentMatch3 = &match;
1975 {
1976 soulng::parser::Match match(false);
1977 soulng::parser::Match* parentMatch4 = &match;
1978 {
1979 int64_t pos = lexer.GetPos();
1980 soulng::parser::Match match = ClassParser::BaseSpecifier(lexer);
1981 specifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
1982 if (match.hit)
1983 {
1984 specifiers = specifiers | specifier->value;
1985 }
1986 *parentMatch4 = match;
1987 }
1988 *parentMatch3 = match;
1989 }
1990 if (match.hit)
1991 {
1992 *parentMatch2 = match;
1993 }
1994 else
1995 {
1996 lexer.SetPos(save);
1997 break;
1998 }
1999 }
2000 }
2001 }
2002 *parentMatch1 = match;
2003 }
2004 if (match.hit)
2005 {
2006 {
2007 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2008
2009 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2010 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(specifiers));
2011 }
2012 }
2013 *parentMatch0 = match;
2014 }
2015 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2016
2017
2018
2019
2020
2021 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2022 if (!match.hit)
2023 {
2024 match.value = nullptr;
2025 }
2026 return match;
2027 }
2028
2029 soulng::parser::Match ClassParser::BaseSpecifier(CppLexer& lexer)
2030 {
2031 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2032
2033
2034
2035
2036
2037
2038
2039 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2040 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>accessSpecifier;
2041 soulng::parser::Match match(false);
2042 soulng::parser::Match* parentMatch0 = &match;
2043 {
2044 int64_t save = lexer.GetPos();
2045 soulng::parser::Match match(false);
2046 soulng::parser::Match* parentMatch1 = &match;
2047 {
2048 int64_t pos = lexer.GetPos();
2049 soulng::parser::Match match(false);
2050 if (*lexer == VIRTUAL)
2051 {
2052 ++lexer;
2053 match.hit = true;
2054 }
2055 if (match.hit)
2056 {
2057 {
2058 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2059
2060 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2061 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::virtual_));
2062 }
2063 }
2064 *parentMatch1 = match;
2065 }
2066 *parentMatch0 = match;
2067 if (!match.hit)
2068 {
2069 soulng::parser::Match match(false);
2070 soulng::parser::Match* parentMatch2 = &match;
2071 lexer.SetPos(save);
2072 {
2073 soulng::parser::Match match(false);
2074 soulng::parser::Match* parentMatch3 = &match;
2075 {
2076 int64_t pos = lexer.GetPos();
2077 soulng::parser::Match match = ClassParser::AccessSpecifier(lexer);
2078 accessSpecifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
2079 if (match.hit)
2080 {
2081 {
2082 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2083
2084 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2085 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(accessSpecifier->value));
2086 }
2087 }
2088 *parentMatch3 = match;
2089 }
2090 *parentMatch2 = match;
2091 }
2092 *parentMatch0 = match;
2093 }
2094 }
2095 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2096
2097
2098
2099
2100
2101 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2102 if (!match.hit)
2103 {
2104 match.value = nullptr;
2105 }
2106 return match;
2107 }
2108
2109 soulng::parser::Match ClassParser::AccessSpecifier(CppLexer& lexer)
2110 {
2111 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2112
2113
2114
2115
2116
2117
2118
2119 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2120 soulng::parser::Match match(false);
2121 int64_t pos = lexer.GetPos();
2122 soulng::lexer::Span span = lexer.GetSpan();
2123 switch (*lexer)
2124 {
2125 case PUBLIC:
2126 {
2127 ++lexer;
2128 {
2129 {
2130 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2131
2132 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2133 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::public_));
2134 }
2135 }
2136 break;
2137 }
2138 case PROTECTED:
2139 {
2140 ++lexer;
2141 {
2142 {
2143 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2144
2145 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2146 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::protected_));
2147 }
2148 }
2149 break;
2150 }
2151 case PRIVATE:
2152 {
2153 ++lexer;
2154 {
2155 {
2156 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2157
2158 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2159 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::private_));
2160 }
2161 }
2162 break;
2163 }
2164 }
2165 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2166
2167
2168
2169
2170
2171 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2172 if (!match.hit)
2173 {
2174 match.value = nullptr;
2175 }
2176 return match;
2177 }
2178
2179 soulng::parser::Match ClassParser::VirtPureSpecifiers(CppLexer& lexer, bool functionMember)
2180 {
2181 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2182
2183
2184
2185
2186
2187
2188
2189 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2190 sngcpp::ast::Specifier specifiers = sngcpp::ast::Specifier();
2191 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>virtSpecifier;
2192 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>pureSpecifier;
2193 soulng::parser::Match match(false);
2194 soulng::parser::Match* parentMatch0 = &match;
2195 {
2196 int64_t pos = lexer.GetPos();
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 soulng::parser::Match match(true);
2204 soulng::parser::Match* parentMatch3 = &match;
2205 {
2206 while (true)
2207 {
2208 int64_t save = lexer.GetPos();
2209 {
2210 soulng::parser::Match match(false);
2211 soulng::parser::Match* parentMatch4 = &match;
2212 {
2213 soulng::parser::Match match(false);
2214 soulng::parser::Match* parentMatch5 = &match;
2215 {
2216 int64_t pos = lexer.GetPos();
2217 soulng::parser::Match match = ClassParser::VirtSpecifier(lexer, functionMember);
2218 virtSpecifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
2219 if (match.hit)
2220 {
2221 specifiers = specifiers | virtSpecifier->value;
2222 }
2223 *parentMatch5 = match;
2224 }
2225 *parentMatch4 = match;
2226 }
2227 if (match.hit)
2228 {
2229 *parentMatch3 = match;
2230 }
2231 else
2232 {
2233 lexer.SetPos(save);
2234 break;
2235 }
2236 }
2237 }
2238 }
2239 *parentMatch2 = match;
2240 }
2241 if (match.hit)
2242 {
2243 soulng::parser::Match match(false);
2244 soulng::parser::Match* parentMatch6 = &match;
2245 {
2246 soulng::parser::Match match(true);
2247 int64_t save = lexer.GetPos();
2248 soulng::parser::Match* parentMatch7 = &match;
2249 {
2250 soulng::parser::Match match(false);
2251 soulng::parser::Match* parentMatch8 = &match;
2252 {
2253 soulng::parser::Match match(false);
2254 soulng::parser::Match* parentMatch9 = &match;
2255 {
2256 int64_t pos = lexer.GetPos();
2257 soulng::parser::Match match = ClassParser::PureSpecifier(lexer, functionMember);
2258 pureSpecifier.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
2259 if (match.hit)
2260 {
2261 specifiers = specifiers | pureSpecifier->value;
2262 }
2263 *parentMatch9 = match;
2264 }
2265 *parentMatch8 = match;
2266 }
2267 if (match.hit)
2268 {
2269 *parentMatch7 = match;
2270 }
2271 else
2272 {
2273 lexer.SetPos(save);
2274 }
2275 }
2276 *parentMatch6 = match;
2277 }
2278 *parentMatch2 = match;
2279 }
2280 *parentMatch1 = match;
2281 }
2282 if (match.hit)
2283 {
2284 {
2285 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2286
2287 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2288 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(specifiers));
2289 }
2290 }
2291 *parentMatch0 = match;
2292 }
2293 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2294
2295
2296
2297
2298
2299 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2300 if (!match.hit)
2301 {
2302 match.value = nullptr;
2303 }
2304 return match;
2305 }
2306
2307 soulng::parser::Match ClassParser::VirtSpecifier(CppLexer& lexer, bool functionMember)
2308 {
2309 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2310
2311
2312
2313
2314
2315
2316
2317 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2318 sngcpp::ast::Specifier specifier = sngcpp::ast::Specifier();
2319 soulng::parser::Match match(false);
2320 soulng::parser::Match* parentMatch0 = &match;
2321 {
2322 int64_t pos = lexer.GetPos();
2323 soulng::parser::Match match(false);
2324 soulng::parser::Match* parentMatch1 = &match;
2325 {
2326 soulng::parser::Match match(false);
2327 soulng::parser::Match* parentMatch2 = &match;
2328 {
2329 int64_t save = lexer.GetPos();
2330 soulng::parser::Match match(false);
2331 soulng::parser::Match* parentMatch3 = &match;
2332 {
2333 int64_t save = lexer.GetPos();
2334 soulng::parser::Match match(false);
2335 soulng::parser::Match* parentMatch4 = &match;
2336 {
2337 int64_t pos = lexer.GetPos();
2338 bool pass = true;
2339 soulng::parser::Match match(false);
2340 if (*lexer == OVERRIDE)
2341 {
2342 ++lexer;
2343 match.hit = true;
2344 }
2345 if (match.hit)
2346 {
2347 pass = functionMember;
2348 specifier = sngcpp::ast::Specifier::override_;
2349 }
2350 if (match.hit && !pass)
2351 {
2352 match = soulng::parser::Match(false);
2353 }
2354 *parentMatch4 = match;
2355 }
2356 *parentMatch3 = match;
2357 if (!match.hit)
2358 {
2359 soulng::parser::Match match(false);
2360 soulng::parser::Match* parentMatch5 = &match;
2361 lexer.SetPos(save);
2362 {
2363 soulng::parser::Match match(false);
2364 soulng::parser::Match* parentMatch6 = &match;
2365 {
2366 int64_t pos = lexer.GetPos();
2367 bool pass = true;
2368 soulng::parser::Match match(false);
2369 if (*lexer == FINAL)
2370 {
2371 ++lexer;
2372 match.hit = true;
2373 }
2374 if (match.hit)
2375 {
2376 pass = functionMember;
2377 specifier = sngcpp::ast::Specifier::final_;
2378 }
2379 if (match.hit && !pass)
2380 {
2381 match = soulng::parser::Match(false);
2382 }
2383 *parentMatch6 = match;
2384 }
2385 *parentMatch5 = match;
2386 }
2387 *parentMatch3 = match;
2388 }
2389 }
2390 *parentMatch2 = match;
2391 if (!match.hit)
2392 {
2393 soulng::parser::Match match(false);
2394 soulng::parser::Match* parentMatch7 = &match;
2395 lexer.SetPos(save);
2396 {
2397 soulng::parser::Match match(false);
2398 soulng::parser::Match* parentMatch8 = &match;
2399 {
2400 int64_t pos = lexer.GetPos();
2401 bool pass = true;
2402 soulng::parser::Match match(false);
2403 if (*lexer == NEW)
2404 {
2405 ++lexer;
2406 match.hit = true;
2407 }
2408 if (match.hit)
2409 {
2410 pass = functionMember;
2411 specifier = sngcpp::ast::Specifier::new_;
2412 }
2413 if (match.hit && !pass)
2414 {
2415 match = soulng::parser::Match(false);
2416 }
2417 *parentMatch8 = match;
2418 }
2419 *parentMatch7 = match;
2420 }
2421 *parentMatch2 = match;
2422 }
2423 }
2424 *parentMatch1 = match;
2425 }
2426 if (match.hit)
2427 {
2428 {
2429 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2430
2431 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2432 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(specifier));
2433 }
2434 }
2435 *parentMatch0 = match;
2436 }
2437 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2438
2439
2440
2441
2442
2443 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2444 if (!match.hit)
2445 {
2446 match.value = nullptr;
2447 }
2448 return match;
2449 }
2450
2451 soulng::parser::Match ClassParser::PureSpecifier(CppLexer& lexer, bool functionMember)
2452 {
2453 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2454
2455
2456
2457
2458
2459
2460
2461 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2462 std::unique_ptr<sngcpp::ast::IntegerLiteralNode> integerLiteral;
2463 soulng::parser::Match match(false);
2464 soulng::parser::Match* parentMatch0 = &match;
2465 {
2466 int64_t pos = lexer.GetPos();
2467 soulng::parser::Match match(false);
2468 soulng::parser::Match* parentMatch1 = &match;
2469 {
2470 soulng::parser::Match match(false);
2471 soulng::parser::Match* parentMatch2 = &match;
2472 {
2473 soulng::parser::Match match(false);
2474 if (*lexer == ASSIGN)
2475 {
2476 ++lexer;
2477 match.hit = true;
2478 }
2479 *parentMatch2 = match;
2480 }
2481 if (match.hit)
2482 {
2483 soulng::parser::Match match(false);
2484 soulng::parser::Match* parentMatch3 = &match;
2485 {
2486 soulng::parser::Match match(false);
2487 soulng::parser::Match* parentMatch4 = &match;
2488 {
2489 int64_t pos = lexer.GetPos();
2490 bool pass = true;
2491 soulng::parser::Match match = LiteralParser::IntegerLiteral(lexer);
2492 integerLiteral.reset(static_cast<sngcpp::ast::IntegerLiteralNode*>(match.value));
2493 if (match.hit)
2494 {
2495 pass = functionMember && integerLiteral.release()->Value() == 0;
2496 }
2497 if (match.hit && !pass)
2498 {
2499 match = soulng::parser::Match(false);
2500 }
2501 *parentMatch4 = match;
2502 }
2503 *parentMatch3 = match;
2504 }
2505 *parentMatch2 = match;
2506 }
2507 *parentMatch1 = match;
2508 }
2509 if (match.hit)
2510 {
2511 {
2512 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2513
2514 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2515 return soulng::parser::Match(true, new soulng::parser::Value<sngcpp::ast::Specifier>(sngcpp::ast::Specifier::pure_));
2516 }
2517 }
2518 *parentMatch0 = match;
2519 }
2520 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2521
2522
2523
2524
2525
2526 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2527 if (!match.hit)
2528 {
2529 match.value = nullptr;
2530 }
2531 return match;
2532 }
2533
2534 soulng::parser::Match ClassParser::SpecialMemberFunctionDefinition(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
2535 {
2536 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2537
2538
2539
2540
2541
2542
2543
2544 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2545 std::unique_ptr<sngcpp::ast::Node> declarator = std::unique_ptr<sngcpp::ast::Node>();
2546 sngcpp::ast::Specifier defaultOrDeleteSpecifier = sngcpp::ast::Specifier();
2547 Span s = Span();
2548 std::unique_ptr<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>>declSpecifiers;
2549 std::unique_ptr<sngcpp::ast::Node> d;
2550 std::unique_ptr<sngcpp::ast::Node> ctorInitializer;
2551 std::unique_ptr<sngcpp::ast::CompoundStatementNode> body;
2552 soulng::parser::Match match(false);
2553 soulng::parser::Match* parentMatch0 = &match;
2554 {
2555 soulng::parser::Match match(false);
2556 soulng::parser::Match* parentMatch1 = &match;
2557 {
2558 soulng::parser::Match match(false);
2559 soulng::parser::Match* parentMatch2 = &match;
2560 {
2561 soulng::parser::Match match(false);
2562 soulng::parser::Match* parentMatch3 = &match;
2563 {
2564 int64_t pos = lexer.GetPos();
2565 soulng::lexer::Span span = lexer.GetSpan();
2566 soulng::parser::Match match = DeclarationParser::DeclSpecifiers(lexer);
2567 declSpecifiers.reset(static_cast<soulng::parser::soulng::parser::Value<sngcpp::ast::Specifier>*>(match.value));
2568 if (match.hit)
2569 {
2570 s = span;
2571 }
2572 *parentMatch3 = match;
2573 }
2574 *parentMatch2 = match;
2575 }
2576 if (match.hit)
2577 {
2578 soulng::parser::Match match(false);
2579 soulng::parser::Match* parentMatch4 = &match;
2580 {
2581 soulng::parser::Match match(false);
2582 soulng::parser::Match* parentMatch5 = &match;
2583 {
2584 int64_t pos = lexer.GetPos();
2585 bool pass = true;
2586 soulng::parser::Match match = DeclaratorParser::Declarator(lexer, ctx);
2587 d.reset(static_cast<sngcpp::ast::Node*>(match.value));
2588 if (match.hit)
2589 {
2590 declarator.reset(d.release());
2591 pass = sngcpp::ast::IsFunctionDeclarator(declarator.get());
2592 }
2593 if (match.hit && !pass)
2594 {
2595 match = soulng::parser::Match(false);
2596 }
2597 *parentMatch5 = match;
2598 }
2599 *parentMatch4 = match;
2600 }
2601 *parentMatch2 = match;
2602 }
2603 *parentMatch1 = match;
2604 }
2605 if (match.hit)
2606 {
2607 soulng::parser::Match match(false);
2608 soulng::parser::Match* parentMatch6 = &match;
2609 {
2610 soulng::parser::Match match(true);
2611 int64_t save = lexer.GetPos();
2612 soulng::parser::Match* parentMatch7 = &match;
2613 {
2614 soulng::parser::Match match = ClassParser::CtorInitializer(lexer, ctx);
2615 ctorInitializer.reset(static_cast<sngcpp::ast::Node*>(match.value));
2616 if (match.hit)
2617 {
2618 *parentMatch7 = match;
2619 }
2620 else
2621 {
2622 lexer.SetPos(save);
2623 }
2624 }
2625 *parentMatch6 = match;
2626 }
2627 *parentMatch1 = match;
2628 }
2629 *parentMatch0 = match;
2630 }
2631 if (match.hit)
2632 {
2633 soulng::parser::Match match(false);
2634 soulng::parser::Match* parentMatch8 = &match;
2635 {
2636 soulng::parser::Match match(false);
2637 soulng::parser::Match* parentMatch9 = &match;
2638 {
2639 int64_t pos = lexer.GetPos();
2640 soulng::parser::Match match(false);
2641 soulng::parser::Match* parentMatch10 = &match;
2642 {
2643 soulng::parser::Match match(false);
2644 soulng::parser::Match* parentMatch11 = &match;
2645 {
2646 int64_t save = lexer.GetPos();
2647 soulng::parser::Match match(false);
2648 soulng::parser::Match* parentMatch12 = &match;
2649 {
2650 int64_t pos = lexer.GetPos();
2651 soulng::lexer::Span span = lexer.GetSpan();
2652 soulng::parser::Match match = FunctionParser::FunctionBody(lexer, ctx);
2653 body.reset(static_cast<sngcpp::ast::CompoundStatementNode*>(match.value));
2654 if (match.hit)
2655 {
2656 s.end = span.end;
2657 }
2658 *parentMatch12 = match;
2659 }
2660 *parentMatch11 = match;
2661 if (!match.hit)
2662 {
2663 soulng::parser::Match match(false);
2664 soulng::parser::Match* parentMatch13 = &match;
2665 lexer.SetPos(save);
2666 {
2667 soulng::parser::Match match(false);
2668 soulng::parser::Match* parentMatch14 = &match;
2669 {
2670 soulng::parser::Match match(false);
2671 soulng::parser::Match* parentMatch15 = &match;
2672 {
2673 soulng::parser::Match match(false);
2674 if (*lexer == ASSIGN)
2675 {
2676 ++lexer;
2677 match.hit = true;
2678 }
2679 *parentMatch15 = match;
2680 }
2681 if (match.hit)
2682 {
2683 soulng::parser::Match match(false);
2684 soulng::parser::Match* parentMatch16 = &match;
2685 {
2686 soulng::parser::Match match(false);
2687 soulng::parser::Match* parentMatch17 = &match;
2688 {
2689 soulng::parser::Match match(false);
2690 soulng::parser::Match* parentMatch18 = &match;
2691 {
2692 int64_t save = lexer.GetPos();
2693 soulng::parser::Match match(false);
2694 soulng::parser::Match* parentMatch19 = &match;
2695 {
2696 int64_t pos = lexer.GetPos();
2697 soulng::parser::Match match(false);
2698 if (*lexer == DEFAULT)
2699 {
2700 ++lexer;
2701 match.hit = true;
2702 }
2703 if (match.hit)
2704 {
2705 defaultOrDeleteSpecifier = sngcpp::ast::Specifier::default_;
2706 }
2707 *parentMatch19 = match;
2708 }
2709 *parentMatch18 = match;
2710 if (!match.hit)
2711 {
2712 soulng::parser::Match match(false);
2713 soulng::parser::Match* parentMatch20 = &match;
2714 lexer.SetPos(save);
2715 {
2716 soulng::parser::Match match(false);
2717 soulng::parser::Match* parentMatch21 = &match;
2718 {
2719 int64_t pos = lexer.GetPos();
2720 soulng::parser::Match match(false);
2721 if (*lexer == DELETE)
2722 {
2723 ++lexer;
2724 match.hit = true;
2725 }
2726 if (match.hit)
2727 {
2728 defaultOrDeleteSpecifier = sngcpp::ast::Specifier::delete_;
2729 }
2730 *parentMatch21 = match;
2731 }
2732 *parentMatch20 = match;
2733 }
2734 *parentMatch18 = match;
2735 }
2736 }
2737 *parentMatch17 = match;
2738 }
2739 *parentMatch16 = match;
2740 }
2741 *parentMatch15 = match;
2742 }
2743 *parentMatch14 = match;
2744 }
2745 if (match.hit)
2746 {
2747 soulng::parser::Match match(false);
2748 soulng::parser::Match* parentMatch22 = &match;
2749 {
2750 soulng::parser::Match match(false);
2751 soulng::parser::Match* parentMatch23 = &match;
2752 {
2753 int64_t pos = lexer.GetPos();
2754 soulng::lexer::Span span = lexer.GetSpan();
2755 soulng::parser::Match match(false);
2756 if (*lexer == SEMICOLON)
2757 {
2758 ++lexer;
2759 match.hit = true;
2760 }
2761 if (match.hit)
2762 {
2763 s.end = span.end;
2764 }
2765 *parentMatch23 = match;
2766 }
2767 *parentMatch22 = match;
2768 }
2769 *parentMatch14 = match;
2770 }
2771 *parentMatch13 = match;
2772 }
2773 *parentMatch11 = match;
2774 }
2775 }
2776 *parentMatch10 = match;
2777 }
2778 if (match.hit)
2779 {
2780 {
2781 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2782
2783 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2784 return soulng::parser::Match(true, new sngcpp::ast::SpecialMemberFunctionNode(s, declSpecifiers->value | defaultOrDeleteSpecifier, declarator.release(), ctorInitializer.release(), body.release()));
2785 }
2786 }
2787 *parentMatch9 = match;
2788 }
2789 *parentMatch8 = match;
2790 }
2791 *parentMatch0 = match;
2792 }
2793 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2794
2795
2796
2797
2798
2799 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2800 if (!match.hit)
2801 {
2802 match.value = nullptr;
2803 }
2804 return match;
2805 }
2806
2807 soulng::parser::Match ClassParser::CtorInitializer(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
2808 {
2809 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2810
2811
2812
2813
2814
2815
2816
2817 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2818 Span s = Span();
2819 std::unique_ptr<sngcpp::ast::Node> mil;
2820 soulng::parser::Match match(false);
2821 soulng::parser::Match* parentMatch0 = &match;
2822 {
2823 soulng::parser::Match match(false);
2824 soulng::parser::Match* parentMatch1 = &match;
2825 {
2826 int64_t pos = lexer.GetPos();
2827 soulng::lexer::Span span = lexer.GetSpan();
2828 soulng::parser::Match match(false);
2829 if (*lexer == COLON)
2830 {
2831 ++lexer;
2832 match.hit = true;
2833 }
2834 if (match.hit)
2835 {
2836 s = span;
2837 }
2838 *parentMatch1 = match;
2839 }
2840 *parentMatch0 = match;
2841 }
2842 if (match.hit)
2843 {
2844 soulng::parser::Match match(false);
2845 soulng::parser::Match* parentMatch2 = &match;
2846 {
2847 soulng::parser::Match match(false);
2848 soulng::parser::Match* parentMatch3 = &match;
2849 {
2850 int64_t pos = lexer.GetPos();
2851 soulng::lexer::Span span = lexer.GetSpan();
2852 soulng::parser::Match match = ClassParser::MemberInitializerList(lexer, ctx);
2853 mil.reset(static_cast<sngcpp::ast::Node*>(match.value));
2854 if (match.hit)
2855 {
2856 s.end = span.end;
2857 {
2858 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2859
2860 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2861 return soulng::parser::Match(true, new sngcpp::ast::CtorInitializerNode(s, mil.release()));
2862 }
2863 }
2864 *parentMatch3 = match;
2865 }
2866 *parentMatch2 = match;
2867 }
2868 *parentMatch0 = match;
2869 }
2870 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2871
2872
2873
2874
2875
2876 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2877 if (!match.hit)
2878 {
2879 match.value = nullptr;
2880 }
2881 return match;
2882 }
2883
2884 soulng::parser::Match ClassParser::MemberInitializerList(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
2885 {
2886 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2887
2888
2889
2890
2891
2892
2893
2894 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2895 std::unique_ptr<sngcpp::ast::Node> list = std::unique_ptr<sngcpp::ast::Node>();
2896 std::unique_ptr<sngcpp::ast::Node> left;
2897 std::unique_ptr<sngcpp::ast::Node> right;
2898 soulng::parser::Match match(false);
2899 soulng::parser::Match* parentMatch0 = &match;
2900 {
2901 int64_t pos = lexer.GetPos();
2902 soulng::parser::Match match(false);
2903 soulng::parser::Match* parentMatch1 = &match;
2904 {
2905 soulng::parser::Match match(false);
2906 soulng::parser::Match* parentMatch2 = &match;
2907 {
2908 soulng::parser::Match match(false);
2909 soulng::parser::Match* parentMatch3 = &match;
2910 {
2911 int64_t pos = lexer.GetPos();
2912 soulng::parser::Match match = ClassParser::MemberInitializer(lexer, ctx);
2913 left.reset(static_cast<sngcpp::ast::Node*>(match.value));
2914 if (match.hit)
2915 {
2916 list.reset(left.release());
2917 }
2918 *parentMatch3 = match;
2919 }
2920 *parentMatch2 = match;
2921 }
2922 if (match.hit)
2923 {
2924 soulng::parser::Match match(false);
2925 soulng::parser::Match* parentMatch4 = &match;
2926 {
2927 soulng::parser::Match match(true);
2928 soulng::parser::Match* parentMatch5 = &match;
2929 {
2930 while (true)
2931 {
2932 int64_t save = lexer.GetPos();
2933 {
2934 soulng::parser::Match match(false);
2935 soulng::parser::Match* parentMatch6 = &match;
2936 {
2937 soulng::parser::Match match(false);
2938 soulng::parser::Match* parentMatch7 = &match;
2939 {
2940 soulng::parser::Match match(false);
2941 if (*lexer == COMMA)
2942 {
2943 ++lexer;
2944 match.hit = true;
2945 }
2946 *parentMatch7 = match;
2947 }
2948 if (match.hit)
2949 {
2950 soulng::parser::Match match(false);
2951 soulng::parser::Match* parentMatch8 = &match;
2952 {
2953 soulng::parser::Match match(false);
2954 soulng::parser::Match* parentMatch9 = &match;
2955 {
2956 int64_t pos = lexer.GetPos();
2957 soulng::lexer::Span span = lexer.GetSpan();
2958 soulng::parser::Match match = ClassParser::MemberInitializer(lexer, ctx);
2959 right.reset(static_cast<sngcpp::ast::Node*>(match.value));
2960 if (match.hit)
2961 {
2962 list.reset(new sngcpp::ast::MemberInitializerSequenceNode(span, list.release(), right.release()));
2963 }
2964 *parentMatch9 = match;
2965 }
2966 *parentMatch8 = match;
2967 }
2968 *parentMatch7 = match;
2969 }
2970 *parentMatch6 = match;
2971 }
2972 if (match.hit)
2973 {
2974 *parentMatch5 = match;
2975 }
2976 else
2977 {
2978 lexer.SetPos(save);
2979 break;
2980 }
2981 }
2982 }
2983 }
2984 *parentMatch4 = match;
2985 }
2986 *parentMatch2 = match;
2987 }
2988 *parentMatch1 = match;
2989 }
2990 if (match.hit)
2991 {
2992 {
2993 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
2994
2995 #endif // SOULNG_PARSER_DEBUG_SUPPORT
2996 return soulng::parser::Match(true, list.release());
2997 }
2998 }
2999 *parentMatch0 = match;
3000 }
3001 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3002
3003
3004
3005
3006
3007 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3008 if (!match.hit)
3009 {
3010 match.value = nullptr;
3011 }
3012 return match;
3013 }
3014
3015 soulng::parser::Match ClassParser::MemberInitializer(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
3016 {
3017 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3018
3019
3020
3021
3022
3023
3024
3025 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3026 Span s = Span();
3027 Span argsSpan = Span();
3028 std::unique_ptr<sngcpp::ast::Node> id1;
3029 std::unique_ptr<sngcpp::ast::Node> args;
3030 std::unique_ptr<sngcpp::ast::Node> id2;
3031 std::unique_ptr<sngcpp::ast::Node> bi;
3032 soulng::parser::Match match(false);
3033 soulng::parser::Match* parentMatch0 = &match;
3034 {
3035 int64_t save = lexer.GetPos();
3036 soulng::parser::Match match(false);
3037 soulng::parser::Match* parentMatch1 = &match;
3038 {
3039 int64_t pos = lexer.GetPos();
3040 soulng::lexer::Span span = lexer.GetSpan();
3041 soulng::parser::Match match(false);
3042 soulng::parser::Match* parentMatch2 = &match;
3043 {
3044 soulng::parser::Match match(false);
3045 soulng::parser::Match* parentMatch3 = &match;
3046 {
3047 soulng::parser::Match match(false);
3048 soulng::parser::Match* parentMatch4 = &match;
3049 {
3050 soulng::parser::Match match(false);
3051 soulng::parser::Match* parentMatch5 = &match;
3052 {
3053 soulng::parser::Match match(false);
3054 soulng::parser::Match* parentMatch6 = &match;
3055 {
3056 int64_t pos = lexer.GetPos();
3057 soulng::lexer::Span span = lexer.GetSpan();
3058 soulng::parser::Match match = ClassParser::MemberInitializerId(lexer, ctx);
3059 id1.reset(static_cast<sngcpp::ast::Node*>(match.value));
3060 if (match.hit)
3061 {
3062 s = span;
3063 }
3064 *parentMatch6 = match;
3065 }
3066 *parentMatch5 = match;
3067 }
3068 if (match.hit)
3069 {
3070 soulng::parser::Match match(false);
3071 soulng::parser::Match* parentMatch7 = &match;
3072 {
3073 soulng::parser::Match match(false);
3074 soulng::parser::Match* parentMatch8 = &match;
3075 {
3076 int64_t pos = lexer.GetPos();
3077 soulng::lexer::Span span = lexer.GetSpan();
3078 soulng::parser::Match match(false);
3079 if (*lexer == LPAREN)
3080 {
3081 ++lexer;
3082 match.hit = true;
3083 }
3084 if (match.hit)
3085 {
3086 argsSpan = span;
3087 }
3088 *parentMatch8 = match;
3089 }
3090 *parentMatch7 = match;
3091 }
3092 *parentMatch5 = match;
3093 }
3094 *parentMatch4 = match;
3095 }
3096 if (match.hit)
3097 {
3098 soulng::parser::Match match(false);
3099 soulng::parser::Match* parentMatch9 = &match;
3100 {
3101 soulng::parser::Match match = ExpressionParser::ArgumentList(lexer, ctx);
3102 args.reset(static_cast<sngcpp::ast::Node*>(match.value));
3103 *parentMatch9 = match;
3104 }
3105 *parentMatch4 = match;
3106 }
3107 *parentMatch3 = match;
3108 }
3109 if (match.hit)
3110 {
3111 soulng::parser::Match match(false);
3112 soulng::parser::Match* parentMatch10 = &match;
3113 {
3114 soulng::parser::Match match(false);
3115 soulng::parser::Match* parentMatch11 = &match;
3116 {
3117 int64_t pos = lexer.GetPos();
3118 soulng::lexer::Span span = lexer.GetSpan();
3119 soulng::parser::Match match(false);
3120 if (*lexer == RPAREN)
3121 {
3122 ++lexer;
3123 match.hit = true;
3124 }
3125 if (match.hit)
3126 {
3127 argsSpan.end = span.end;
3128 }
3129 *parentMatch11 = match;
3130 }
3131 *parentMatch10 = match;
3132 }
3133 *parentMatch3 = match;
3134 }
3135 *parentMatch2 = match;
3136 }
3137 if (match.hit)
3138 {
3139 s.end = span.end;
3140 {
3141 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3142
3143 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3144 return soulng::parser::Match(true, new sngcpp::ast::MemberInitializerNode(s, id1.release(), new sngcpp::ast::ExpressionListInitializerNode(argsSpan, args.release())));
3145 }
3146 }
3147 *parentMatch1 = match;
3148 }
3149 *parentMatch0 = match;
3150 if (!match.hit)
3151 {
3152 soulng::parser::Match match(false);
3153 soulng::parser::Match* parentMatch12 = &match;
3154 lexer.SetPos(save);
3155 {
3156 soulng::parser::Match match(false);
3157 soulng::parser::Match* parentMatch13 = &match;
3158 {
3159 soulng::parser::Match match(false);
3160 soulng::parser::Match* parentMatch14 = &match;
3161 {
3162 int64_t pos = lexer.GetPos();
3163 soulng::lexer::Span span = lexer.GetSpan();
3164 soulng::parser::Match match = ClassParser::MemberInitializerId(lexer, ctx);
3165 id2.reset(static_cast<sngcpp::ast::Node*>(match.value));
3166 if (match.hit)
3167 {
3168 s = span;
3169 }
3170 *parentMatch14 = match;
3171 }
3172 *parentMatch13 = match;
3173 }
3174 if (match.hit)
3175 {
3176 soulng::parser::Match match(false);
3177 soulng::parser::Match* parentMatch15 = &match;
3178 {
3179 soulng::parser::Match match(false);
3180 soulng::parser::Match* parentMatch16 = &match;
3181 {
3182 int64_t pos = lexer.GetPos();
3183 soulng::lexer::Span span = lexer.GetSpan();
3184 soulng::parser::Match match = DeclaratorParser::BracedInitializerList(lexer, ctx);
3185 bi.reset(static_cast<sngcpp::ast::Node*>(match.value));
3186 if (match.hit)
3187 {
3188 s.end = span.end;
3189 {
3190 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3191
3192 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3193 return soulng::parser::Match(true, new sngcpp::ast::MemberInitializerNode(s, id2.release(), bi.release()));
3194 }
3195 }
3196 *parentMatch16 = match;
3197 }
3198 *parentMatch15 = match;
3199 }
3200 *parentMatch13 = match;
3201 }
3202 *parentMatch12 = match;
3203 }
3204 *parentMatch0 = match;
3205 }
3206 }
3207 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3208
3209
3210
3211
3212
3213 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3214 if (!match.hit)
3215 {
3216 match.value = nullptr;
3217 }
3218 return match;
3219 }
3220
3221 soulng::parser::Match ClassParser::MemberInitializerId(CppLexer& lexer, sngcpp::cppparser::ParsingContext* ctx)
3222 {
3223 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3224
3225
3226
3227
3228
3229
3230
3231 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3232 std::unique_ptr<sngcpp::ast::Node> qid;
3233 soulng::parser::Match match(false);
3234 soulng::parser::Match* parentMatch0 = &match;
3235 {
3236 int64_t pos = lexer.GetPos();
3237 soulng::parser::Match match = IdentifierParser::QualifiedIdNode(lexer, ctx);
3238 qid.reset(static_cast<sngcpp::ast::Node*>(match.value));
3239 if (match.hit)
3240 {
3241 {
3242 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3243
3244 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3245 return soulng::parser::Match(true, qid.release());
3246 }
3247 }
3248 *parentMatch0 = match;
3249 }
3250 #ifdef SOULNG_PARSER_DEBUG_SUPPORT
3251
3252
3253
3254
3255
3256 #endif // SOULNG_PARSER_DEBUG_SUPPORT
3257 if (!match.hit)
3258 {
3259 match.value = nullptr;
3260 }
3261 return match;
3262 }