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