1 using System;
2 using System.Collections;
3 using System.Lex;
4 using System.Parsing;
5 using Cm.Ast;
6 using LexerFileTokens;
7
8
9
10 public static class StatementParser
11 {
12 public static Match Statement(LexerFileLexer& lexer, ParsingContext* ctx)
13 {
14 #if (DEBUG)
15 Span debugSpan;
16 bool writeToLog = lexer.Log() != null;
17 if (writeToLog)
18 {
19 debugSpan = lexer.GetSpan();
20 System.Lex.WriteBeginRuleToLog(lexer, u"Statement");
21 }
22 #endif
23 UniquePtr<StatementNode> labeledStatement;
24 UniquePtr<StatementNode> controlStatement;
25 UniquePtr<StatementNode> expressionStatement;
26 UniquePtr<StatementNode> assignmentStatement;
27 UniquePtr<ConstructionStatementNode> constructionStatement;
28 UniquePtr<StatementNode> deleteStatement;
29 UniquePtr<StatementNode> destroyStatement;
30 UniquePtr<StatementNode> emptyStatement;
31 UniquePtr<StatementNode> throwStatement;
32 UniquePtr<TryStatementNode> tryStatement;
33 UniquePtr<StatementNode> assertStatement;
34 UniquePtr<ConditionalCompilationStatementNode> condCompStatement;
35 Match match(false);
36 Match* parentMatch0 = &match;
37 {
38 long save = lexer.GetPos();
39 Match match(false);
40 Match* parentMatch1 = &match;
41 {
42 long save = lexer.GetPos();
43 Match match(false);
44 Match* parentMatch2 = &match;
45 {
46 long save = lexer.GetPos();
47 Match match(false);
48 Match* parentMatch3 = &match;
49 {
50 long save = lexer.GetPos();
51 Match match(false);
52 Match* parentMatch4 = &match;
53 {
54 long save = lexer.GetPos();
55 Match match(false);
56 Match* parentMatch5 = &match;
57 {
58 long save = lexer.GetPos();
59 Match match(false);
60 Match* parentMatch6 = &match;
61 {
62 long save = lexer.GetPos();
63 Match match(false);
64 Match* parentMatch7 = &match;
65 {
66 long save = lexer.GetPos();
67 Match match(false);
68 Match* parentMatch8 = &match;
69 {
70 long save = lexer.GetPos();
71 Match match(false);
72 Match* parentMatch9 = &match;
73 {
74 long save = lexer.GetPos();
75 Match match(false);
76 Match* parentMatch10 = &match;
77 {
78 long save = lexer.GetPos();
79 Match match(false);
80 Match* parentMatch11 = &match;
81 {
82 long pos = lexer.GetPos();
83 Match match = StatementParser.LabeledStatement(lexer, ctx);
84 labeledStatement.Reset(cast<StatementNode*>(match.value));
85 if (match.hit)
86 {
87 {
88 #if (DEBUG)
89 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
90 #endif
91 return Match(true, labeledStatement.Release());
92 }
93 }
94 *parentMatch11 = match;
95 }
96 *parentMatch10 = match;
97 if (!match.hit)
98 {
99 Match match(false);
100 Match* parentMatch12 = &match;
101 lexer.SetPos(save);
102 {
103 Match match(false);
104 Match* parentMatch13 = &match;
105 {
106 long pos = lexer.GetPos();
107 Match match = StatementParser.ControlStatement(lexer, ctx);
108 controlStatement.Reset(cast<StatementNode*>(match.value));
109 if (match.hit)
110 {
111 {
112 #if (DEBUG)
113 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
114 #endif
115 return Match(true, controlStatement.Release());
116 }
117 }
118 *parentMatch13 = match;
119 }
120 *parentMatch12 = match;
121 }
122 *parentMatch10 = match;
123 }
124 }
125 *parentMatch9 = match;
126 if (!match.hit)
127 {
128 Match match(false);
129 Match* parentMatch14 = &match;
130 lexer.SetPos(save);
131 {
132 Match match(false);
133 Match* parentMatch15 = &match;
134 {
135 long pos = lexer.GetPos();
136 Match match = StatementParser.ExpressionStatement(lexer, ctx);
137 expressionStatement.Reset(cast<StatementNode*>(match.value));
138 if (match.hit)
139 {
140 {
141 #if (DEBUG)
142 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
143 #endif
144 return Match(true, expressionStatement.Release());
145 }
146 }
147 *parentMatch15 = match;
148 }
149 *parentMatch14 = match;
150 }
151 *parentMatch9 = match;
152 }
153 }
154 *parentMatch8 = match;
155 if (!match.hit)
156 {
157 Match match(false);
158 Match* parentMatch16 = &match;
159 lexer.SetPos(save);
160 {
161 Match match(false);
162 Match* parentMatch17 = &match;
163 {
164 long pos = lexer.GetPos();
165 Match match = StatementParser.AssignmentStatement(lexer, ctx);
166 assignmentStatement.Reset(cast<StatementNode*>(match.value));
167 if (match.hit)
168 {
169 {
170 #if (DEBUG)
171 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
172 #endif
173 return Match(true, assignmentStatement.Release());
174 }
175 }
176 *parentMatch17 = match;
177 }
178 *parentMatch16 = match;
179 }
180 *parentMatch8 = match;
181 }
182 }
183 *parentMatch7 = match;
184 if (!match.hit)
185 {
186 Match match(false);
187 Match* parentMatch18 = &match;
188 lexer.SetPos(save);
189 {
190 Match match(false);
191 Match* parentMatch19 = &match;
192 {
193 long pos = lexer.GetPos();
194 Match match = StatementParser.ConstructionStatement(lexer, ctx);
195 constructionStatement.Reset(cast<ConstructionStatementNode*>(match.value));
196 if (match.hit)
197 {
198 {
199 #if (DEBUG)
200 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
201 #endif
202 return Match(true, constructionStatement.Release());
203 }
204 }
205 *parentMatch19 = match;
206 }
207 *parentMatch18 = match;
208 }
209 *parentMatch7 = match;
210 }
211 }
212 *parentMatch6 = match;
213 if (!match.hit)
214 {
215 Match match(false);
216 Match* parentMatch20 = &match;
217 lexer.SetPos(save);
218 {
219 Match match(false);
220 Match* parentMatch21 = &match;
221 {
222 long pos = lexer.GetPos();
223 Match match = StatementParser.DeleteStatement(lexer, ctx);
224 deleteStatement.Reset(cast<StatementNode*>(match.value));
225 if (match.hit)
226 {
227 {
228 #if (DEBUG)
229 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
230 #endif
231 return Match(true, deleteStatement.Release());
232 }
233 }
234 *parentMatch21 = match;
235 }
236 *parentMatch20 = match;
237 }
238 *parentMatch6 = match;
239 }
240 }
241 *parentMatch5 = match;
242 if (!match.hit)
243 {
244 Match match(false);
245 Match* parentMatch22 = &match;
246 lexer.SetPos(save);
247 {
248 Match match(false);
249 Match* parentMatch23 = &match;
250 {
251 long pos = lexer.GetPos();
252 Match match = StatementParser.DestroyStatement(lexer, ctx);
253 destroyStatement.Reset(cast<StatementNode*>(match.value));
254 if (match.hit)
255 {
256 {
257 #if (DEBUG)
258 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
259 #endif
260 return Match(true, destroyStatement.Release());
261 }
262 }
263 *parentMatch23 = match;
264 }
265 *parentMatch22 = match;
266 }
267 *parentMatch5 = match;
268 }
269 }
270 *parentMatch4 = match;
271 if (!match.hit)
272 {
273 Match match(false);
274 Match* parentMatch24 = &match;
275 lexer.SetPos(save);
276 {
277 Match match(false);
278 Match* parentMatch25 = &match;
279 {
280 long pos = lexer.GetPos();
281 Match match = StatementParser.EmptyStatement(lexer, ctx);
282 emptyStatement.Reset(cast<StatementNode*>(match.value));
283 if (match.hit)
284 {
285 {
286 #if (DEBUG)
287 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
288 #endif
289 return Match(true, emptyStatement.Release());
290 }
291 }
292 *parentMatch25 = match;
293 }
294 *parentMatch24 = match;
295 }
296 *parentMatch4 = match;
297 }
298 }
299 *parentMatch3 = match;
300 if (!match.hit)
301 {
302 Match match(false);
303 Match* parentMatch26 = &match;
304 lexer.SetPos(save);
305 {
306 Match match(false);
307 Match* parentMatch27 = &match;
308 {
309 long pos = lexer.GetPos();
310 Match match = StatementParser.ThrowStatement(lexer, ctx);
311 throwStatement.Reset(cast<StatementNode*>(match.value));
312 if (match.hit)
313 {
314 {
315 #if (DEBUG)
316 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
317 #endif
318 return Match(true, throwStatement.Release());
319 }
320 }
321 *parentMatch27 = match;
322 }
323 *parentMatch26 = match;
324 }
325 *parentMatch3 = match;
326 }
327 }
328 *parentMatch2 = match;
329 if (!match.hit)
330 {
331 Match match(false);
332 Match* parentMatch28 = &match;
333 lexer.SetPos(save);
334 {
335 Match match(false);
336 Match* parentMatch29 = &match;
337 {
338 long pos = lexer.GetPos();
339 Match match = StatementParser.TryStatement(lexer, ctx);
340 tryStatement.Reset(cast<TryStatementNode*>(match.value));
341 if (match.hit)
342 {
343 {
344 #if (DEBUG)
345 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
346 #endif
347 return Match(true, tryStatement.Release());
348 }
349 }
350 *parentMatch29 = match;
351 }
352 *parentMatch28 = match;
353 }
354 *parentMatch2 = match;
355 }
356 }
357 *parentMatch1 = match;
358 if (!match.hit)
359 {
360 Match match(false);
361 Match* parentMatch30 = &match;
362 lexer.SetPos(save);
363 {
364 Match match(false);
365 Match* parentMatch31 = &match;
366 {
367 long pos = lexer.GetPos();
368 Match match = StatementParser.AssertStatement(lexer, ctx);
369 assertStatement.Reset(cast<StatementNode*>(match.value));
370 if (match.hit)
371 {
372 {
373 #if (DEBUG)
374 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
375 #endif
376 return Match(true, assertStatement.Release());
377 }
378 }
379 *parentMatch31 = match;
380 }
381 *parentMatch30 = match;
382 }
383 *parentMatch1 = match;
384 }
385 }
386 *parentMatch0 = match;
387 if (!match.hit)
388 {
389 Match match(false);
390 Match* parentMatch32 = &match;
391 lexer.SetPos(save);
392 {
393 Match match(false);
394 Match* parentMatch33 = &match;
395 {
396 long pos = lexer.GetPos();
397 Match match = StatementParser.ConditionalCompilationStatement(lexer, ctx);
398 condCompStatement.Reset(cast<ConditionalCompilationStatementNode*>(match.value));
399 if (match.hit)
400 {
401 {
402 #if (DEBUG)
403 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
404 #endif
405 return Match(true, condCompStatement.Release());
406 }
407 }
408 *parentMatch33 = match;
409 }
410 *parentMatch32 = match;
411 }
412 *parentMatch0 = match;
413 }
414 }
415 #if (DEBUG)
416 if (writeToLog)
417 {
418 if (match.hit)
419 {
420 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Statement");
421 }
422 else
423 {
424 System.Lex.WriteFailureToLog(lexer, u"Statement");
425 }
426 }
427 #endif
428 if (!match.hit)
429 {
430 match.value = null;
431 }
432 return match;
433 }
434 public static Match Label(LexerFileLexer& lexer, ParsingContext* ctx)
435 {
436 #if (DEBUG)
437 Span debugSpan;
438 bool writeToLog = lexer.Log() != null;
439 if (writeToLog)
440 {
441 debugSpan = lexer.GetSpan();
442 System.Lex.WriteBeginRuleToLog(lexer, u"Label");
443 }
444 #endif
445 Span s;
446 ustring label;
447 Match match(false);
448 Match* parentMatch0 = &match;
449 {
450 long pos = lexer.GetPos();
451 Match match(false);
452 Match* parentMatch1 = &match;
453 {
454 Match match(false);
455 Match* parentMatch2 = &match;
456 {
457 Match match(false);
458 Match* parentMatch3 = &match;
459 {
460 long pos = lexer.GetPos();
461 Span span = lexer.GetSpan();
462 Match match(false);
463 if (*lexer == ID)
464 {
465 ++lexer;
466 match.hit = true;
467 }
468 if (match.hit)
469 {
470 s = span;
471 label = lexer.GetMatch(span);
472 }
473 *parentMatch3 = match;
474 }
475 *parentMatch2 = match;
476 }
477 if (match.hit)
478 {
479 Match match(false);
480 Match* parentMatch4 = &match;
481 {
482 Match match(false);
483 Match* parentMatch5 = &match;
484 {
485 long pos = lexer.GetPos();
486 Span span = lexer.GetSpan();
487 Match match(false);
488 if (*lexer == COLON)
489 {
490 ++lexer;
491 match.hit = true;
492 }
493 if (match.hit)
494 {
495 s.end = span.end;
496 }
497 *parentMatch5 = match;
498 }
499 *parentMatch4 = match;
500 }
501 *parentMatch2 = match;
502 }
503 *parentMatch1 = match;
504 }
505 if (match.hit)
506 {
507 {
508 #if (DEBUG)
509 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Label");
510 #endif
511 return Match(true, new LabelNode(s, ctx->ModuleId(), label));
512 }
513 }
514 *parentMatch0 = match;
515 }
516 #if (DEBUG)
517 if (writeToLog)
518 {
519 if (match.hit)
520 {
521 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Label");
522 }
523 else
524 {
525 System.Lex.WriteFailureToLog(lexer, u"Label");
526 }
527 }
528 #endif
529 if (!match.hit)
530 {
531 match.value = null;
532 }
533 return match;
534 }
535 public static Match LabeledStatement(LexerFileLexer& lexer, ParsingContext* ctx)
536 {
537 #if (DEBUG)
538 Span debugSpan;
539 bool writeToLog = lexer.Log() != null;
540 if (writeToLog)
541 {
542 debugSpan = lexer.GetSpan();
543 System.Lex.WriteBeginRuleToLog(lexer, u"LabeledStatement");
544 }
545 #endif
546 UniquePtr<LabeledStatementNode> stmt;
547 UniquePtr<LabelNode> lbl;
548 UniquePtr<StatementNode> s;
549 Match match(false);
550 Match* parentMatch0 = &match;
551 {
552 Match match = StatementParser.Label(lexer, ctx);
553 lbl.Reset(cast<LabelNode*>(match.value));
554 *parentMatch0 = match;
555 }
556 if (match.hit)
557 {
558 Match match(false);
559 Match* parentMatch1 = &match;
560 {
561 Match match(false);
562 Match* parentMatch2 = &match;
563 {
564 long pos = lexer.GetPos();
565 Span span = lexer.GetSpan();
566 Match match = StatementParser.Statement(lexer, ctx);
567 s.Reset(cast<StatementNode*>(match.value));
568 if (match.hit)
569 {
570 stmt.Reset(new LabeledStatementNode(span, ctx->ModuleId(), s.Release()));
571 stmt->SetLabelNode(lbl.Release());
572 {
573 #if (DEBUG)
574 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"LabeledStatement");
575 #endif
576 return Match(true, stmt.Release());
577 }
578 }
579 *parentMatch2 = match;
580 }
581 *parentMatch1 = match;
582 }
583 *parentMatch0 = match;
584 }
585 #if (DEBUG)
586 if (writeToLog)
587 {
588 if (match.hit)
589 {
590 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"LabeledStatement");
591 }
592 else
593 {
594 System.Lex.WriteFailureToLog(lexer, u"LabeledStatement");
595 }
596 }
597 #endif
598 if (!match.hit)
599 {
600 match.value = null;
601 }
602 return match;
603 }
604 public static Match ControlStatement(LexerFileLexer& lexer, ParsingContext* ctx)
605 {
606 #if (DEBUG)
607 Span debugSpan;
608 bool writeToLog = lexer.Log() != null;
609 if (writeToLog)
610 {
611 debugSpan = lexer.GetSpan();
612 System.Lex.WriteBeginRuleToLog(lexer, u"ControlStatement");
613 }
614 #endif
615 UniquePtr<CompoundStatementNode> compoundStatement;
616 UniquePtr<StatementNode> returnStatement;
617 UniquePtr<IfStatementNode> ifStatement;
618 UniquePtr<WhileStatementNode> whileStatement;
619 UniquePtr<DoStatementNode> doStatement;
620 UniquePtr<RangeForStatementNode> rangeForStatement;
621 UniquePtr<ForStatementNode> forStatement;
622 UniquePtr<StatementNode> breakStatement;
623 UniquePtr<StatementNode> continueStatement;
624 UniquePtr<StatementNode> gotoStatement;
625 UniquePtr<SwitchStatementNode> switchStatement;
626 UniquePtr<StatementNode> gotoCaseStatement;
627 UniquePtr<StatementNode> gotoDefaultStatement;
628 Match match(false);
629 Match* parentMatch0 = &match;
630 {
631 long save = lexer.GetPos();
632 Match match(false);
633 Match* parentMatch1 = &match;
634 {
635 long save = lexer.GetPos();
636 Match match(false);
637 Match* parentMatch2 = &match;
638 {
639 long save = lexer.GetPos();
640 Match match(false);
641 Match* parentMatch3 = &match;
642 {
643 long save = lexer.GetPos();
644 Match match(false);
645 Match* parentMatch4 = &match;
646 {
647 long save = lexer.GetPos();
648 Match match(false);
649 Match* parentMatch5 = &match;
650 {
651 long save = lexer.GetPos();
652 Match match(false);
653 Match* parentMatch6 = &match;
654 {
655 long save = lexer.GetPos();
656 Match match(false);
657 Match* parentMatch7 = &match;
658 {
659 long save = lexer.GetPos();
660 Match match(false);
661 Match* parentMatch8 = &match;
662 {
663 long save = lexer.GetPos();
664 Match match(false);
665 Match* parentMatch9 = &match;
666 {
667 long save = lexer.GetPos();
668 Match match(false);
669 Match* parentMatch10 = &match;
670 {
671 long save = lexer.GetPos();
672 Match match(false);
673 Match* parentMatch11 = &match;
674 {
675 long save = lexer.GetPos();
676 Match match(false);
677 Match* parentMatch12 = &match;
678 {
679 long pos = lexer.GetPos();
680 Match match = StatementParser.CompoundStatement(lexer, ctx);
681 compoundStatement.Reset(cast<CompoundStatementNode*>(match.value));
682 if (match.hit)
683 {
684 {
685 #if (DEBUG)
686 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
687 #endif
688 return Match(true, compoundStatement.Release());
689 }
690 }
691 *parentMatch12 = match;
692 }
693 *parentMatch11 = match;
694 if (!match.hit)
695 {
696 Match match(false);
697 Match* parentMatch13 = &match;
698 lexer.SetPos(save);
699 {
700 Match match(false);
701 Match* parentMatch14 = &match;
702 {
703 long pos = lexer.GetPos();
704 Match match = StatementParser.ReturnStatement(lexer, ctx);
705 returnStatement.Reset(cast<StatementNode*>(match.value));
706 if (match.hit)
707 {
708 {
709 #if (DEBUG)
710 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
711 #endif
712 return Match(true, returnStatement.Release());
713 }
714 }
715 *parentMatch14 = match;
716 }
717 *parentMatch13 = match;
718 }
719 *parentMatch11 = match;
720 }
721 }
722 *parentMatch10 = match;
723 if (!match.hit)
724 {
725 Match match(false);
726 Match* parentMatch15 = &match;
727 lexer.SetPos(save);
728 {
729 Match match(false);
730 Match* parentMatch16 = &match;
731 {
732 long pos = lexer.GetPos();
733 Match match = StatementParser.IfStatement(lexer, ctx);
734 ifStatement.Reset(cast<IfStatementNode*>(match.value));
735 if (match.hit)
736 {
737 {
738 #if (DEBUG)
739 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
740 #endif
741 return Match(true, ifStatement.Release());
742 }
743 }
744 *parentMatch16 = match;
745 }
746 *parentMatch15 = match;
747 }
748 *parentMatch10 = match;
749 }
750 }
751 *parentMatch9 = match;
752 if (!match.hit)
753 {
754 Match match(false);
755 Match* parentMatch17 = &match;
756 lexer.SetPos(save);
757 {
758 Match match(false);
759 Match* parentMatch18 = &match;
760 {
761 long pos = lexer.GetPos();
762 Match match = StatementParser.WhileStatement(lexer, ctx);
763 whileStatement.Reset(cast<WhileStatementNode*>(match.value));
764 if (match.hit)
765 {
766 {
767 #if (DEBUG)
768 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
769 #endif
770 return Match(true, whileStatement.Release());
771 }
772 }
773 *parentMatch18 = match;
774 }
775 *parentMatch17 = match;
776 }
777 *parentMatch9 = match;
778 }
779 }
780 *parentMatch8 = match;
781 if (!match.hit)
782 {
783 Match match(false);
784 Match* parentMatch19 = &match;
785 lexer.SetPos(save);
786 {
787 Match match(false);
788 Match* parentMatch20 = &match;
789 {
790 long pos = lexer.GetPos();
791 Match match = StatementParser.DoStatement(lexer, ctx);
792 doStatement.Reset(cast<DoStatementNode*>(match.value));
793 if (match.hit)
794 {
795 {
796 #if (DEBUG)
797 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
798 #endif
799 return Match(true, doStatement.Release());
800 }
801 }
802 *parentMatch20 = match;
803 }
804 *parentMatch19 = match;
805 }
806 *parentMatch8 = match;
807 }
808 }
809 *parentMatch7 = match;
810 if (!match.hit)
811 {
812 Match match(false);
813 Match* parentMatch21 = &match;
814 lexer.SetPos(save);
815 {
816 Match match(false);
817 Match* parentMatch22 = &match;
818 {
819 long pos = lexer.GetPos();
820 Match match = StatementParser.RangeForStatement(lexer, ctx);
821 rangeForStatement.Reset(cast<RangeForStatementNode*>(match.value));
822 if (match.hit)
823 {
824 {
825 #if (DEBUG)
826 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
827 #endif
828 return Match(true, rangeForStatement.Release());
829 }
830 }
831 *parentMatch22 = match;
832 }
833 *parentMatch21 = match;
834 }
835 *parentMatch7 = match;
836 }
837 }
838 *parentMatch6 = match;
839 if (!match.hit)
840 {
841 Match match(false);
842 Match* parentMatch23 = &match;
843 lexer.SetPos(save);
844 {
845 Match match(false);
846 Match* parentMatch24 = &match;
847 {
848 long pos = lexer.GetPos();
849 Match match = StatementParser.ForStatement(lexer, ctx);
850 forStatement.Reset(cast<ForStatementNode*>(match.value));
851 if (match.hit)
852 {
853 {
854 #if (DEBUG)
855 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
856 #endif
857 return Match(true, forStatement.Release());
858 }
859 }
860 *parentMatch24 = match;
861 }
862 *parentMatch23 = match;
863 }
864 *parentMatch6 = match;
865 }
866 }
867 *parentMatch5 = match;
868 if (!match.hit)
869 {
870 Match match(false);
871 Match* parentMatch25 = &match;
872 lexer.SetPos(save);
873 {
874 Match match(false);
875 Match* parentMatch26 = &match;
876 {
877 long pos = lexer.GetPos();
878 Match match = StatementParser.BreakStatement(lexer, ctx);
879 breakStatement.Reset(cast<StatementNode*>(match.value));
880 if (match.hit)
881 {
882 {
883 #if (DEBUG)
884 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
885 #endif
886 return Match(true, breakStatement.Release());
887 }
888 }
889 *parentMatch26 = match;
890 }
891 *parentMatch25 = match;
892 }
893 *parentMatch5 = match;
894 }
895 }
896 *parentMatch4 = match;
897 if (!match.hit)
898 {
899 Match match(false);
900 Match* parentMatch27 = &match;
901 lexer.SetPos(save);
902 {
903 Match match(false);
904 Match* parentMatch28 = &match;
905 {
906 long pos = lexer.GetPos();
907 Match match = StatementParser.ContinueStatement(lexer, ctx);
908 continueStatement.Reset(cast<StatementNode*>(match.value));
909 if (match.hit)
910 {
911 {
912 #if (DEBUG)
913 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
914 #endif
915 return Match(true, continueStatement.Release());
916 }
917 }
918 *parentMatch28 = match;
919 }
920 *parentMatch27 = match;
921 }
922 *parentMatch4 = match;
923 }
924 }
925 *parentMatch3 = match;
926 if (!match.hit)
927 {
928 Match match(false);
929 Match* parentMatch29 = &match;
930 lexer.SetPos(save);
931 {
932 Match match(false);
933 Match* parentMatch30 = &match;
934 {
935 long pos = lexer.GetPos();
936 Match match = StatementParser.GotoStatement(lexer, ctx);
937 gotoStatement.Reset(cast<StatementNode*>(match.value));
938 if (match.hit)
939 {
940 {
941 #if (DEBUG)
942 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
943 #endif
944 return Match(true, gotoStatement.Release());
945 }
946 }
947 *parentMatch30 = match;
948 }
949 *parentMatch29 = match;
950 }
951 *parentMatch3 = match;
952 }
953 }
954 *parentMatch2 = match;
955 if (!match.hit)
956 {
957 Match match(false);
958 Match* parentMatch31 = &match;
959 lexer.SetPos(save);
960 {
961 Match match(false);
962 Match* parentMatch32 = &match;
963 {
964 long pos = lexer.GetPos();
965 Match match = StatementParser.SwitchStatement(lexer, ctx);
966 switchStatement.Reset(cast<SwitchStatementNode*>(match.value));
967 if (match.hit)
968 {
969 {
970 #if (DEBUG)
971 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
972 #endif
973 return Match(true, switchStatement.Release());
974 }
975 }
976 *parentMatch32 = match;
977 }
978 *parentMatch31 = match;
979 }
980 *parentMatch2 = match;
981 }
982 }
983 *parentMatch1 = match;
984 if (!match.hit)
985 {
986 Match match(false);
987 Match* parentMatch33 = &match;
988 lexer.SetPos(save);
989 {
990 Match match(false);
991 Match* parentMatch34 = &match;
992 {
993 long pos = lexer.GetPos();
994 Match match = StatementParser.GotoCaseStatement(lexer, ctx);
995 gotoCaseStatement.Reset(cast<StatementNode*>(match.value));
996 if (match.hit)
997 {
998 {
999 #if (DEBUG)
1000 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
1001 #endif
1002 return Match(true, gotoCaseStatement.Release());
1003 }
1004 }
1005 *parentMatch34 = match;
1006 }
1007 *parentMatch33 = match;
1008 }
1009 *parentMatch1 = match;
1010 }
1011 }
1012 *parentMatch0 = match;
1013 if (!match.hit)
1014 {
1015 Match match(false);
1016 Match* parentMatch35 = &match;
1017 lexer.SetPos(save);
1018 {
1019 Match match(false);
1020 Match* parentMatch36 = &match;
1021 {
1022 long pos = lexer.GetPos();
1023 Match match = StatementParser.GotoDefaultStatement(lexer, ctx);
1024 gotoDefaultStatement.Reset(cast<StatementNode*>(match.value));
1025 if (match.hit)
1026 {
1027 {
1028 #if (DEBUG)
1029 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
1030 #endif
1031 return Match(true, gotoDefaultStatement.Release());
1032 }
1033 }
1034 *parentMatch36 = match;
1035 }
1036 *parentMatch35 = match;
1037 }
1038 *parentMatch0 = match;
1039 }
1040 }
1041 #if (DEBUG)
1042 if (writeToLog)
1043 {
1044 if (match.hit)
1045 {
1046 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ControlStatement");
1047 }
1048 else
1049 {
1050 System.Lex.WriteFailureToLog(lexer, u"ControlStatement");
1051 }
1052 }
1053 #endif
1054 if (!match.hit)
1055 {
1056 match.value = null;
1057 }
1058 return match;
1059 }
1060 public static Match CompoundStatement(LexerFileLexer& lexer, ParsingContext* ctx)
1061 {
1062 #if (DEBUG)
1063 Span debugSpan;
1064 bool writeToLog = lexer.Log() != null;
1065 if (writeToLog)
1066 {
1067 debugSpan = lexer.GetSpan();
1068 System.Lex.WriteBeginRuleToLog(lexer, u"CompoundStatement");
1069 }
1070 #endif
1071 UniquePtr<CompoundStatementNode> compoundStatement;
1072 UniquePtr<StatementNode> stmt;
1073 Match match(false);
1074 Match* parentMatch0 = &match;
1075 {
1076 Match match(false);
1077 Match* parentMatch1 = &match;
1078 {
1079 Match match(false);
1080 Match* parentMatch2 = &match;
1081 {
1082 long pos = lexer.GetPos();
1083 Span span = lexer.GetSpan();
1084 Match match(false);
1085 if (*lexer == LBRACE)
1086 {
1087 ++lexer;
1088 match.hit = true;
1089 }
1090 if (match.hit)
1091 {
1092 compoundStatement.Reset(new CompoundStatementNode(span, ctx->ModuleId()));
1093 }
1094 *parentMatch2 = match;
1095 }
1096 *parentMatch1 = match;
1097 }
1098 if (match.hit)
1099 {
1100 Match match(false);
1101 Match* parentMatch3 = &match;
1102 {
1103 Match match(true);
1104 Match* parentMatch4 = &match;
1105 {
1106 while (true)
1107 {
1108 long save = lexer.GetPos();
1109 {
1110 Match match(false);
1111 Match* parentMatch5 = &match;
1112 {
1113 Match match(false);
1114 Match* parentMatch6 = &match;
1115 {
1116 long pos = lexer.GetPos();
1117 Match match = StatementParser.Statement(lexer, ctx);
1118 stmt.Reset(cast<StatementNode*>(match.value));
1119 if (match.hit)
1120 {
1121 compoundStatement->AddStatement(stmt.Release());
1122 }
1123 *parentMatch6 = match;
1124 }
1125 *parentMatch5 = match;
1126 }
1127 if (match.hit)
1128 {
1129 *parentMatch4 = match;
1130 }
1131 else
1132 {
1133 lexer.SetPos(save);
1134 break;
1135 }
1136 }
1137 }
1138 }
1139 *parentMatch3 = match;
1140 }
1141 *parentMatch1 = match;
1142 }
1143 *parentMatch0 = match;
1144 }
1145 if (match.hit)
1146 {
1147 Match match(false);
1148 Match* parentMatch7 = &match;
1149 {
1150 Match match(false);
1151 Match* parentMatch8 = &match;
1152 {
1153 long pos = lexer.GetPos();
1154 Span span = lexer.GetSpan();
1155 Match match(true);
1156 Match* parentMatch9 = &match;
1157 {
1158 System.Lex.Span span = lexer.GetSpan();
1159 Match match(false);
1160 if (*lexer == RBRACE)
1161 {
1162 ++lexer;
1163 match.hit = true;
1164 }
1165 if (match.hit)
1166 {
1167 *parentMatch9 = match;
1168 }
1169 else
1170 {
1171 lexer.ThrowExpectationFailure(span, GetTokenName(RBRACE));
1172 }
1173 }
1174 if (match.hit)
1175 {
1176 compoundStatement->SetSpanEnd(span.end);
1177 {
1178 #if (DEBUG)
1179 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"CompoundStatement");
1180 #endif
1181 return Match(true, compoundStatement.Release());
1182 }
1183 }
1184 *parentMatch8 = match;
1185 }
1186 *parentMatch7 = match;
1187 }
1188 *parentMatch0 = match;
1189 }
1190 #if (DEBUG)
1191 if (writeToLog)
1192 {
1193 if (match.hit)
1194 {
1195 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"CompoundStatement");
1196 }
1197 else
1198 {
1199 System.Lex.WriteFailureToLog(lexer, u"CompoundStatement");
1200 }
1201 }
1202 #endif
1203 if (!match.hit)
1204 {
1205 match.value = null;
1206 }
1207 return match;
1208 }
1209 public static Match ReturnStatement(LexerFileLexer& lexer, ParsingContext* ctx)
1210 {
1211 #if (DEBUG)
1212 Span debugSpan;
1213 bool writeToLog = lexer.Log() != null;
1214 if (writeToLog)
1215 {
1216 debugSpan = lexer.GetSpan();
1217 System.Lex.WriteBeginRuleToLog(lexer, u"ReturnStatement");
1218 }
1219 #endif
1220 Span s;
1221 UniquePtr<Node> expr;
1222 Match match(false);
1223 Match* parentMatch0 = &match;
1224 {
1225 Match match(false);
1226 Match* parentMatch1 = &match;
1227 {
1228 Match match(false);
1229 Match* parentMatch2 = &match;
1230 {
1231 long pos = lexer.GetPos();
1232 Span span = lexer.GetSpan();
1233 Match match(false);
1234 if (*lexer == RETURN)
1235 {
1236 ++lexer;
1237 match.hit = true;
1238 }
1239 if (match.hit)
1240 {
1241 s = span;
1242 }
1243 *parentMatch2 = match;
1244 }
1245 *parentMatch1 = match;
1246 }
1247 if (match.hit)
1248 {
1249 Match match(false);
1250 Match* parentMatch3 = &match;
1251 {
1252 Match match(true);
1253 long save = lexer.GetPos();
1254 Match* parentMatch4 = &match;
1255 {
1256 Match match = ExpressionParser.Expression(lexer, ctx);
1257 expr.Reset(cast<Node*>(match.value));
1258 if (match.hit)
1259 {
1260 *parentMatch4 = match;
1261 }
1262 else
1263 {
1264 lexer.SetPos(save);
1265 }
1266 }
1267 *parentMatch3 = match;
1268 }
1269 *parentMatch1 = match;
1270 }
1271 *parentMatch0 = match;
1272 }
1273 if (match.hit)
1274 {
1275 Match match(false);
1276 Match* parentMatch5 = &match;
1277 {
1278 Match match(false);
1279 Match* parentMatch6 = &match;
1280 {
1281 long pos = lexer.GetPos();
1282 Span span = lexer.GetSpan();
1283 Match match(true);
1284 Match* parentMatch7 = &match;
1285 {
1286 System.Lex.Span span = lexer.GetSpan();
1287 Match match(false);
1288 if (*lexer == SEMICOLON)
1289 {
1290 ++lexer;
1291 match.hit = true;
1292 }
1293 if (match.hit)
1294 {
1295 *parentMatch7 = match;
1296 }
1297 else
1298 {
1299 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
1300 }
1301 }
1302 if (match.hit)
1303 {
1304 s.end = span.end;
1305 {
1306 #if (DEBUG)
1307 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ReturnStatement");
1308 #endif
1309 return Match(true, new ReturnStatementNode(s, ctx->ModuleId(), expr.Release()));
1310 }
1311 }
1312 *parentMatch6 = match;
1313 }
1314 *parentMatch5 = match;
1315 }
1316 *parentMatch0 = match;
1317 }
1318 #if (DEBUG)
1319 if (writeToLog)
1320 {
1321 if (match.hit)
1322 {
1323 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ReturnStatement");
1324 }
1325 else
1326 {
1327 System.Lex.WriteFailureToLog(lexer, u"ReturnStatement");
1328 }
1329 }
1330 #endif
1331 if (!match.hit)
1332 {
1333 match.value = null;
1334 }
1335 return match;
1336 }
1337 public static Match IfStatement(LexerFileLexer& lexer, ParsingContext* ctx)
1338 {
1339 #if (DEBUG)
1340 Span debugSpan;
1341 bool writeToLog = lexer.Log() != null;
1342 if (writeToLog)
1343 {
1344 debugSpan = lexer.GetSpan();
1345 System.Lex.WriteBeginRuleToLog(lexer, u"IfStatement");
1346 }
1347 #endif
1348 Span s;
1349 Span leftParenSpan;
1350 Span rightParenSpan;
1351 Span elseSpan;
1352 UniquePtr<Node> cond;
1353 UniquePtr<StatementNode> thenS;
1354 UniquePtr<StatementNode> elseS;
1355 Match match(false);
1356 Match* parentMatch0 = &match;
1357 {
1358 long pos = lexer.GetPos();
1359 Match match(false);
1360 Match* parentMatch1 = &match;
1361 {
1362 Match match(false);
1363 Match* parentMatch2 = &match;
1364 {
1365 Match match(false);
1366 Match* parentMatch3 = &match;
1367 {
1368 Match match(false);
1369 Match* parentMatch4 = &match;
1370 {
1371 Match match(false);
1372 Match* parentMatch5 = &match;
1373 {
1374 Match match(false);
1375 Match* parentMatch6 = &match;
1376 {
1377 Match match(false);
1378 Match* parentMatch7 = &match;
1379 {
1380 long pos = lexer.GetPos();
1381 Span span = lexer.GetSpan();
1382 Match match(false);
1383 if (*lexer == IF)
1384 {
1385 ++lexer;
1386 match.hit = true;
1387 }
1388 if (match.hit)
1389 {
1390 s = span;
1391 }
1392 *parentMatch7 = match;
1393 }
1394 *parentMatch6 = match;
1395 }
1396 if (match.hit)
1397 {
1398 Match match(false);
1399 Match* parentMatch8 = &match;
1400 {
1401 Match match(false);
1402 Match* parentMatch9 = &match;
1403 {
1404 long pos = lexer.GetPos();
1405 Span span = lexer.GetSpan();
1406 Match match(false);
1407 if (*lexer == LPAREN)
1408 {
1409 ++lexer;
1410 match.hit = true;
1411 }
1412 if (match.hit)
1413 {
1414 leftParenSpan = span;
1415 }
1416 *parentMatch9 = match;
1417 }
1418 *parentMatch8 = match;
1419 }
1420 *parentMatch6 = match;
1421 }
1422 *parentMatch5 = match;
1423 }
1424 if (match.hit)
1425 {
1426 Match match(false);
1427 Match* parentMatch10 = &match;
1428 {
1429 Match match = ExpressionParser.Expression(lexer, ctx);
1430 cond.Reset(cast<Node*>(match.value));
1431 *parentMatch10 = match;
1432 }
1433 *parentMatch5 = match;
1434 }
1435 *parentMatch4 = match;
1436 }
1437 if (match.hit)
1438 {
1439 Match match(false);
1440 Match* parentMatch11 = &match;
1441 {
1442 Match match(false);
1443 Match* parentMatch12 = &match;
1444 {
1445 long pos = lexer.GetPos();
1446 Span span = lexer.GetSpan();
1447 Match match(false);
1448 if (*lexer == RPAREN)
1449 {
1450 ++lexer;
1451 match.hit = true;
1452 }
1453 if (match.hit)
1454 {
1455 rightParenSpan = span;
1456 }
1457 *parentMatch12 = match;
1458 }
1459 *parentMatch11 = match;
1460 }
1461 *parentMatch4 = match;
1462 }
1463 *parentMatch3 = match;
1464 }
1465 if (match.hit)
1466 {
1467 Match match(false);
1468 Match* parentMatch13 = &match;
1469 {
1470 Match match(false);
1471 Match* parentMatch14 = &match;
1472 {
1473 long pos = lexer.GetPos();
1474 Span span = lexer.GetSpan();
1475 Match match = StatementParser.Statement(lexer, ctx);
1476 thenS.Reset(cast<StatementNode*>(match.value));
1477 if (match.hit)
1478 {
1479 s.end = span.end;
1480 }
1481 *parentMatch14 = match;
1482 }
1483 *parentMatch13 = match;
1484 }
1485 *parentMatch3 = match;
1486 }
1487 *parentMatch2 = match;
1488 }
1489 if (match.hit)
1490 {
1491 Match match(false);
1492 Match* parentMatch15 = &match;
1493 {
1494 Match match(true);
1495 long save = lexer.GetPos();
1496 Match* parentMatch16 = &match;
1497 {
1498 Match match(false);
1499 Match* parentMatch17 = &match;
1500 {
1501 Match match(false);
1502 Match* parentMatch18 = &match;
1503 {
1504 Match match(false);
1505 Match* parentMatch19 = &match;
1506 {
1507 long pos = lexer.GetPos();
1508 Span span = lexer.GetSpan();
1509 Match match(false);
1510 if (*lexer == ELSE)
1511 {
1512 ++lexer;
1513 match.hit = true;
1514 }
1515 if (match.hit)
1516 {
1517 elseSpan = span;
1518 }
1519 *parentMatch19 = match;
1520 }
1521 *parentMatch18 = match;
1522 }
1523 if (match.hit)
1524 {
1525 Match match(false);
1526 Match* parentMatch20 = &match;
1527 {
1528 Match match(false);
1529 Match* parentMatch21 = &match;
1530 {
1531 long pos = lexer.GetPos();
1532 Span span = lexer.GetSpan();
1533 Match match = StatementParser.Statement(lexer, ctx);
1534 elseS.Reset(cast<StatementNode*>(match.value));
1535 if (match.hit)
1536 {
1537 s.end = span.end;
1538 }
1539 *parentMatch21 = match;
1540 }
1541 *parentMatch20 = match;
1542 }
1543 *parentMatch18 = match;
1544 }
1545 *parentMatch17 = match;
1546 }
1547 if (match.hit)
1548 {
1549 *parentMatch16 = match;
1550 }
1551 else
1552 {
1553 lexer.SetPos(save);
1554 }
1555 }
1556 *parentMatch15 = match;
1557 }
1558 *parentMatch2 = match;
1559 }
1560 *parentMatch1 = match;
1561 }
1562 if (match.hit)
1563 {
1564 IfStatementNode* value = new IfStatementNode(s, ctx->ModuleId(), cond.Release(), thenS.Release(), elseS.Release());
1565 value->SetLeftParenSpan(leftParenSpan);
1566 value->SetRightParenSpan(rightParenSpan);
1567 value->SetElseSpan(elseSpan);
1568 {
1569 #if (DEBUG)
1570 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"IfStatement");
1571 #endif
1572 return Match(true, value);
1573 }
1574 }
1575 *parentMatch0 = match;
1576 }
1577 #if (DEBUG)
1578 if (writeToLog)
1579 {
1580 if (match.hit)
1581 {
1582 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"IfStatement");
1583 }
1584 else
1585 {
1586 System.Lex.WriteFailureToLog(lexer, u"IfStatement");
1587 }
1588 }
1589 #endif
1590 if (!match.hit)
1591 {
1592 match.value = null;
1593 }
1594 return match;
1595 }
1596 public static Match WhileStatement(LexerFileLexer& lexer, ParsingContext* ctx)
1597 {
1598 #if (DEBUG)
1599 Span debugSpan;
1600 bool writeToLog = lexer.Log() != null;
1601 if (writeToLog)
1602 {
1603 debugSpan = lexer.GetSpan();
1604 System.Lex.WriteBeginRuleToLog(lexer, u"WhileStatement");
1605 }
1606 #endif
1607 Span s;
1608 Span leftParenSpan;
1609 Span rightParenSpan;
1610 UniquePtr<Node> cond;
1611 UniquePtr<StatementNode> stmt;
1612 Match match(false);
1613 Match* parentMatch0 = &match;
1614 {
1615 long pos = lexer.GetPos();
1616 Match match(false);
1617 Match* parentMatch1 = &match;
1618 {
1619 Match match(false);
1620 Match* parentMatch2 = &match;
1621 {
1622 Match match(false);
1623 Match* parentMatch3 = &match;
1624 {
1625 Match match(false);
1626 Match* parentMatch4 = &match;
1627 {
1628 Match match(false);
1629 Match* parentMatch5 = &match;
1630 {
1631 Match match(false);
1632 Match* parentMatch6 = &match;
1633 {
1634 long pos = lexer.GetPos();
1635 Span span = lexer.GetSpan();
1636 Match match(false);
1637 if (*lexer == WHILE)
1638 {
1639 ++lexer;
1640 match.hit = true;
1641 }
1642 if (match.hit)
1643 {
1644 s = span;
1645 }
1646 *parentMatch6 = match;
1647 }
1648 *parentMatch5 = match;
1649 }
1650 if (match.hit)
1651 {
1652 Match match(false);
1653 Match* parentMatch7 = &match;
1654 {
1655 Match match(false);
1656 Match* parentMatch8 = &match;
1657 {
1658 long pos = lexer.GetPos();
1659 Span span = lexer.GetSpan();
1660 Match match(true);
1661 Match* parentMatch9 = &match;
1662 {
1663 System.Lex.Span span = lexer.GetSpan();
1664 Match match(false);
1665 if (*lexer == LPAREN)
1666 {
1667 ++lexer;
1668 match.hit = true;
1669 }
1670 if (match.hit)
1671 {
1672 *parentMatch9 = match;
1673 }
1674 else
1675 {
1676 lexer.ThrowExpectationFailure(span, GetTokenName(LPAREN));
1677 }
1678 }
1679 if (match.hit)
1680 {
1681 leftParenSpan = span;
1682 }
1683 *parentMatch8 = match;
1684 }
1685 *parentMatch7 = match;
1686 }
1687 *parentMatch5 = match;
1688 }
1689 *parentMatch4 = match;
1690 }
1691 if (match.hit)
1692 {
1693 Match match(false);
1694 Match* parentMatch10 = &match;
1695 {
1696 Match match(true);
1697 Match* parentMatch11 = &match;
1698 {
1699 System.Lex.Span span = lexer.GetSpan();
1700 Match match = ExpressionParser.Expression(lexer, ctx);
1701 cond.Reset(cast<Node*>(match.value));
1702 if (match.hit)
1703 {
1704 *parentMatch11 = match;
1705 }
1706 else
1707 {
1708 lexer.ThrowExpectationFailure(span, u"expression");
1709 }
1710 }
1711 *parentMatch10 = match;
1712 }
1713 *parentMatch4 = match;
1714 }
1715 *parentMatch3 = match;
1716 }
1717 if (match.hit)
1718 {
1719 Match match(false);
1720 Match* parentMatch12 = &match;
1721 {
1722 Match match(false);
1723 Match* parentMatch13 = &match;
1724 {
1725 long pos = lexer.GetPos();
1726 Span span = lexer.GetSpan();
1727 Match match(true);
1728 Match* parentMatch14 = &match;
1729 {
1730 System.Lex.Span span = lexer.GetSpan();
1731 Match match(false);
1732 if (*lexer == RPAREN)
1733 {
1734 ++lexer;
1735 match.hit = true;
1736 }
1737 if (match.hit)
1738 {
1739 *parentMatch14 = match;
1740 }
1741 else
1742 {
1743 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
1744 }
1745 }
1746 if (match.hit)
1747 {
1748 rightParenSpan = span;
1749 }
1750 *parentMatch13 = match;
1751 }
1752 *parentMatch12 = match;
1753 }
1754 *parentMatch3 = match;
1755 }
1756 *parentMatch2 = match;
1757 }
1758 if (match.hit)
1759 {
1760 Match match(false);
1761 Match* parentMatch15 = &match;
1762 {
1763 Match match(false);
1764 Match* parentMatch16 = &match;
1765 {
1766 long pos = lexer.GetPos();
1767 Span span = lexer.GetSpan();
1768 Match match(true);
1769 Match* parentMatch17 = &match;
1770 {
1771 System.Lex.Span span = lexer.GetSpan();
1772 Match match = StatementParser.Statement(lexer, ctx);
1773 stmt.Reset(cast<StatementNode*>(match.value));
1774 if (match.hit)
1775 {
1776 *parentMatch17 = match;
1777 }
1778 else
1779 {
1780 lexer.ThrowExpectationFailure(span, u"statement");
1781 }
1782 }
1783 if (match.hit)
1784 {
1785 s.end = span.end;
1786 }
1787 *parentMatch16 = match;
1788 }
1789 *parentMatch15 = match;
1790 }
1791 *parentMatch2 = match;
1792 }
1793 *parentMatch1 = match;
1794 }
1795 if (match.hit)
1796 {
1797 WhileStatementNode* value = new WhileStatementNode(s, ctx->ModuleId(), cond.Release(), stmt.Release());
1798 value->SetLeftParenSpan(leftParenSpan);
1799 value->SetRightParenSpan(rightParenSpan);
1800 {
1801 #if (DEBUG)
1802 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"WhileStatement");
1803 #endif
1804 return Match(true, value);
1805 }
1806 }
1807 *parentMatch0 = match;
1808 }
1809 #if (DEBUG)
1810 if (writeToLog)
1811 {
1812 if (match.hit)
1813 {
1814 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"WhileStatement");
1815 }
1816 else
1817 {
1818 System.Lex.WriteFailureToLog(lexer, u"WhileStatement");
1819 }
1820 }
1821 #endif
1822 if (!match.hit)
1823 {
1824 match.value = null;
1825 }
1826 return match;
1827 }
1828 public static Match DoStatement(LexerFileLexer& lexer, ParsingContext* ctx)
1829 {
1830 #if (DEBUG)
1831 Span debugSpan;
1832 bool writeToLog = lexer.Log() != null;
1833 if (writeToLog)
1834 {
1835 debugSpan = lexer.GetSpan();
1836 System.Lex.WriteBeginRuleToLog(lexer, u"DoStatement");
1837 }
1838 #endif
1839 Span s;
1840 Span whileSpan;
1841 Span leftParenSpan;
1842 Span rightParenSpan;
1843 UniquePtr<StatementNode> stmt;
1844 UniquePtr<Node> cond;
1845 Match match(false);
1846 Match* parentMatch0 = &match;
1847 {
1848 long pos = lexer.GetPos();
1849 Match match(false);
1850 Match* parentMatch1 = &match;
1851 {
1852 Match match(false);
1853 Match* parentMatch2 = &match;
1854 {
1855 Match match(false);
1856 Match* parentMatch3 = &match;
1857 {
1858 Match match(false);
1859 Match* parentMatch4 = &match;
1860 {
1861 Match match(false);
1862 Match* parentMatch5 = &match;
1863 {
1864 Match match(false);
1865 Match* parentMatch6 = &match;
1866 {
1867 Match match(false);
1868 Match* parentMatch7 = &match;
1869 {
1870 Match match(false);
1871 Match* parentMatch8 = &match;
1872 {
1873 long pos = lexer.GetPos();
1874 Span span = lexer.GetSpan();
1875 Match match(false);
1876 if (*lexer == DO)
1877 {
1878 ++lexer;
1879 match.hit = true;
1880 }
1881 if (match.hit)
1882 {
1883 s = span;
1884 }
1885 *parentMatch8 = match;
1886 }
1887 *parentMatch7 = match;
1888 }
1889 if (match.hit)
1890 {
1891 Match match(false);
1892 Match* parentMatch9 = &match;
1893 {
1894 Match match(true);
1895 Match* parentMatch10 = &match;
1896 {
1897 System.Lex.Span span = lexer.GetSpan();
1898 Match match = StatementParser.Statement(lexer, ctx);
1899 stmt.Reset(cast<StatementNode*>(match.value));
1900 if (match.hit)
1901 {
1902 *parentMatch10 = match;
1903 }
1904 else
1905 {
1906 lexer.ThrowExpectationFailure(span, u"statement");
1907 }
1908 }
1909 *parentMatch9 = match;
1910 }
1911 *parentMatch7 = match;
1912 }
1913 *parentMatch6 = match;
1914 }
1915 if (match.hit)
1916 {
1917 Match match(false);
1918 Match* parentMatch11 = &match;
1919 {
1920 Match match(false);
1921 Match* parentMatch12 = &match;
1922 {
1923 long pos = lexer.GetPos();
1924 Span span = lexer.GetSpan();
1925 Match match(true);
1926 Match* parentMatch13 = &match;
1927 {
1928 System.Lex.Span span = lexer.GetSpan();
1929 Match match(false);
1930 if (*lexer == WHILE)
1931 {
1932 ++lexer;
1933 match.hit = true;
1934 }
1935 if (match.hit)
1936 {
1937 *parentMatch13 = match;
1938 }
1939 else
1940 {
1941 lexer.ThrowExpectationFailure(span, GetTokenName(WHILE));
1942 }
1943 }
1944 if (match.hit)
1945 {
1946 whileSpan = span;
1947 }
1948 *parentMatch12 = match;
1949 }
1950 *parentMatch11 = match;
1951 }
1952 *parentMatch6 = match;
1953 }
1954 *parentMatch5 = match;
1955 }
1956 if (match.hit)
1957 {
1958 Match match(false);
1959 Match* parentMatch14 = &match;
1960 {
1961 Match match(false);
1962 Match* parentMatch15 = &match;
1963 {
1964 long pos = lexer.GetPos();
1965 Span span = lexer.GetSpan();
1966 Match match(true);
1967 Match* parentMatch16 = &match;
1968 {
1969 System.Lex.Span span = lexer.GetSpan();
1970 Match match(false);
1971 if (*lexer == LPAREN)
1972 {
1973 ++lexer;
1974 match.hit = true;
1975 }
1976 if (match.hit)
1977 {
1978 *parentMatch16 = match;
1979 }
1980 else
1981 {
1982 lexer.ThrowExpectationFailure(span, GetTokenName(LPAREN));
1983 }
1984 }
1985 if (match.hit)
1986 {
1987 leftParenSpan = span;
1988 }
1989 *parentMatch15 = match;
1990 }
1991 *parentMatch14 = match;
1992 }
1993 *parentMatch5 = match;
1994 }
1995 *parentMatch4 = match;
1996 }
1997 if (match.hit)
1998 {
1999 Match match(false);
2000 Match* parentMatch17 = &match;
2001 {
2002 Match match(true);
2003 Match* parentMatch18 = &match;
2004 {
2005 System.Lex.Span span = lexer.GetSpan();
2006 Match match = ExpressionParser.Expression(lexer, ctx);
2007 cond.Reset(cast<Node*>(match.value));
2008 if (match.hit)
2009 {
2010 *parentMatch18 = match;
2011 }
2012 else
2013 {
2014 lexer.ThrowExpectationFailure(span, u"expression");
2015 }
2016 }
2017 *parentMatch17 = match;
2018 }
2019 *parentMatch4 = match;
2020 }
2021 *parentMatch3 = match;
2022 }
2023 if (match.hit)
2024 {
2025 Match match(false);
2026 Match* parentMatch19 = &match;
2027 {
2028 Match match(false);
2029 Match* parentMatch20 = &match;
2030 {
2031 long pos = lexer.GetPos();
2032 Span span = lexer.GetSpan();
2033 Match match(true);
2034 Match* parentMatch21 = &match;
2035 {
2036 System.Lex.Span span = lexer.GetSpan();
2037 Match match(false);
2038 if (*lexer == RPAREN)
2039 {
2040 ++lexer;
2041 match.hit = true;
2042 }
2043 if (match.hit)
2044 {
2045 *parentMatch21 = match;
2046 }
2047 else
2048 {
2049 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
2050 }
2051 }
2052 if (match.hit)
2053 {
2054 rightParenSpan = span;
2055 }
2056 *parentMatch20 = match;
2057 }
2058 *parentMatch19 = match;
2059 }
2060 *parentMatch3 = match;
2061 }
2062 *parentMatch2 = match;
2063 }
2064 if (match.hit)
2065 {
2066 Match match(false);
2067 Match* parentMatch22 = &match;
2068 {
2069 Match match(false);
2070 Match* parentMatch23 = &match;
2071 {
2072 long pos = lexer.GetPos();
2073 Span span = lexer.GetSpan();
2074 Match match(true);
2075 Match* parentMatch24 = &match;
2076 {
2077 System.Lex.Span span = lexer.GetSpan();
2078 Match match(false);
2079 if (*lexer == SEMICOLON)
2080 {
2081 ++lexer;
2082 match.hit = true;
2083 }
2084 if (match.hit)
2085 {
2086 *parentMatch24 = match;
2087 }
2088 else
2089 {
2090 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
2091 }
2092 }
2093 if (match.hit)
2094 {
2095 s.end = span.end;
2096 }
2097 *parentMatch23 = match;
2098 }
2099 *parentMatch22 = match;
2100 }
2101 *parentMatch2 = match;
2102 }
2103 *parentMatch1 = match;
2104 }
2105 if (match.hit)
2106 {
2107 DoStatementNode* value = new DoStatementNode(s, ctx->ModuleId(), stmt.Release(), cond.Release());
2108 value->SetWhileSpan(whileSpan);
2109 value->SetLeftParenSpan(leftParenSpan);
2110 value->SetRightParenSpan(rightParenSpan);
2111 {
2112 #if (DEBUG)
2113 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DoStatement");
2114 #endif
2115 return Match(true, value);
2116 }
2117 }
2118 *parentMatch0 = match;
2119 }
2120 #if (DEBUG)
2121 if (writeToLog)
2122 {
2123 if (match.hit)
2124 {
2125 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DoStatement");
2126 }
2127 else
2128 {
2129 System.Lex.WriteFailureToLog(lexer, u"DoStatement");
2130 }
2131 }
2132 #endif
2133 if (!match.hit)
2134 {
2135 match.value = null;
2136 }
2137 return match;
2138 }
2139 public static Match ForStatement(LexerFileLexer& lexer, ParsingContext* ctx)
2140 {
2141 #if (DEBUG)
2142 Span debugSpan;
2143 bool writeToLog = lexer.Log() != null;
2144 if (writeToLog)
2145 {
2146 debugSpan = lexer.GetSpan();
2147 System.Lex.WriteBeginRuleToLog(lexer, u"ForStatement");
2148 }
2149 #endif
2150 Span s;
2151 Span leftParenSpan;
2152 Span rightParenSpan;
2153 UniquePtr<StatementNode> init;
2154 UniquePtr<Node> cond;
2155 UniquePtr<StatementNode> loop;
2156 UniquePtr<StatementNode> stmt;
2157 Match match(false);
2158 Match* parentMatch0 = &match;
2159 {
2160 long pos = lexer.GetPos();
2161 Match match(false);
2162 Match* parentMatch1 = &match;
2163 {
2164 Match match(false);
2165 Match* parentMatch2 = &match;
2166 {
2167 Match match(false);
2168 Match* parentMatch3 = &match;
2169 {
2170 Match match(false);
2171 Match* parentMatch4 = &match;
2172 {
2173 Match match(false);
2174 Match* parentMatch5 = &match;
2175 {
2176 Match match(false);
2177 Match* parentMatch6 = &match;
2178 {
2179 Match match(false);
2180 Match* parentMatch7 = &match;
2181 {
2182 Match match(false);
2183 Match* parentMatch8 = &match;
2184 {
2185 Match match(false);
2186 Match* parentMatch9 = &match;
2187 {
2188 long pos = lexer.GetPos();
2189 Span span = lexer.GetSpan();
2190 Match match(false);
2191 if (*lexer == FOR)
2192 {
2193 ++lexer;
2194 match.hit = true;
2195 }
2196 if (match.hit)
2197 {
2198 s = span;
2199 }
2200 *parentMatch9 = match;
2201 }
2202 *parentMatch8 = match;
2203 }
2204 if (match.hit)
2205 {
2206 Match match(false);
2207 Match* parentMatch10 = &match;
2208 {
2209 Match match(false);
2210 Match* parentMatch11 = &match;
2211 {
2212 long pos = lexer.GetPos();
2213 Span span = lexer.GetSpan();
2214 Match match(false);
2215 if (*lexer == LPAREN)
2216 {
2217 ++lexer;
2218 match.hit = true;
2219 }
2220 if (match.hit)
2221 {
2222 leftParenSpan = span;
2223 }
2224 *parentMatch11 = match;
2225 }
2226 *parentMatch10 = match;
2227 }
2228 *parentMatch8 = match;
2229 }
2230 *parentMatch7 = match;
2231 }
2232 if (match.hit)
2233 {
2234 Match match(false);
2235 Match* parentMatch12 = &match;
2236 {
2237 Match match(true);
2238 Match* parentMatch13 = &match;
2239 {
2240 System.Lex.Span span = lexer.GetSpan();
2241 Match match = StatementParser.ForInitStatement(lexer, ctx);
2242 init.Reset(cast<StatementNode*>(match.value));
2243 if (match.hit)
2244 {
2245 *parentMatch13 = match;
2246 }
2247 else
2248 {
2249 lexer.ThrowExpectationFailure(span, u"for initialization statement");
2250 }
2251 }
2252 *parentMatch12 = match;
2253 }
2254 *parentMatch7 = match;
2255 }
2256 *parentMatch6 = match;
2257 }
2258 if (match.hit)
2259 {
2260 Match match(false);
2261 Match* parentMatch14 = &match;
2262 {
2263 Match match(true);
2264 long save = lexer.GetPos();
2265 Match* parentMatch15 = &match;
2266 {
2267 Match match = ExpressionParser.Expression(lexer, ctx);
2268 cond.Reset(cast<Node*>(match.value));
2269 if (match.hit)
2270 {
2271 *parentMatch15 = match;
2272 }
2273 else
2274 {
2275 lexer.SetPos(save);
2276 }
2277 }
2278 *parentMatch14 = match;
2279 }
2280 *parentMatch6 = match;
2281 }
2282 *parentMatch5 = match;
2283 }
2284 if (match.hit)
2285 {
2286 Match match(false);
2287 Match* parentMatch16 = &match;
2288 {
2289 Match match(true);
2290 Match* parentMatch17 = &match;
2291 {
2292 System.Lex.Span span = lexer.GetSpan();
2293 Match match(false);
2294 if (*lexer == SEMICOLON)
2295 {
2296 ++lexer;
2297 match.hit = true;
2298 }
2299 if (match.hit)
2300 {
2301 *parentMatch17 = match;
2302 }
2303 else
2304 {
2305 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
2306 }
2307 }
2308 *parentMatch16 = match;
2309 }
2310 *parentMatch5 = match;
2311 }
2312 *parentMatch4 = match;
2313 }
2314 if (match.hit)
2315 {
2316 Match match(false);
2317 Match* parentMatch18 = &match;
2318 {
2319 Match match(true);
2320 Match* parentMatch19 = &match;
2321 {
2322 System.Lex.Span span = lexer.GetSpan();
2323 Match match = StatementParser.ForLoopStatementExpr(lexer, ctx);
2324 loop.Reset(cast<StatementNode*>(match.value));
2325 if (match.hit)
2326 {
2327 *parentMatch19 = match;
2328 }
2329 else
2330 {
2331 lexer.ThrowExpectationFailure(span, u"for loop expression");
2332 }
2333 }
2334 *parentMatch18 = match;
2335 }
2336 *parentMatch4 = match;
2337 }
2338 *parentMatch3 = match;
2339 }
2340 if (match.hit)
2341 {
2342 Match match(false);
2343 Match* parentMatch20 = &match;
2344 {
2345 Match match(false);
2346 Match* parentMatch21 = &match;
2347 {
2348 long pos = lexer.GetPos();
2349 Span span = lexer.GetSpan();
2350 Match match(true);
2351 Match* parentMatch22 = &match;
2352 {
2353 System.Lex.Span span = lexer.GetSpan();
2354 Match match(false);
2355 if (*lexer == RPAREN)
2356 {
2357 ++lexer;
2358 match.hit = true;
2359 }
2360 if (match.hit)
2361 {
2362 *parentMatch22 = match;
2363 }
2364 else
2365 {
2366 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
2367 }
2368 }
2369 if (match.hit)
2370 {
2371 rightParenSpan = span;
2372 }
2373 *parentMatch21 = match;
2374 }
2375 *parentMatch20 = match;
2376 }
2377 *parentMatch3 = match;
2378 }
2379 *parentMatch2 = match;
2380 }
2381 if (match.hit)
2382 {
2383 Match match(false);
2384 Match* parentMatch23 = &match;
2385 {
2386 Match match(false);
2387 Match* parentMatch24 = &match;
2388 {
2389 long pos = lexer.GetPos();
2390 Span span = lexer.GetSpan();
2391 Match match(true);
2392 Match* parentMatch25 = &match;
2393 {
2394 System.Lex.Span span = lexer.GetSpan();
2395 Match match = StatementParser.Statement(lexer, ctx);
2396 stmt.Reset(cast<StatementNode*>(match.value));
2397 if (match.hit)
2398 {
2399 *parentMatch25 = match;
2400 }
2401 else
2402 {
2403 lexer.ThrowExpectationFailure(span, u"statement");
2404 }
2405 }
2406 if (match.hit)
2407 {
2408 s.end = span.end;
2409 }
2410 *parentMatch24 = match;
2411 }
2412 *parentMatch23 = match;
2413 }
2414 *parentMatch2 = match;
2415 }
2416 *parentMatch1 = match;
2417 }
2418 if (match.hit)
2419 {
2420 ForStatementNode* value = new ForStatementNode(s, ctx->ModuleId(), init.Release(), cond.Release(), loop.Release(), stmt.Release());
2421 value->SetLeftParenSpan(leftParenSpan);
2422 value->SetRightParenSpan(rightParenSpan);
2423 {
2424 #if (DEBUG)
2425 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForStatement");
2426 #endif
2427 return Match(true, value);
2428 }
2429 }
2430 *parentMatch0 = match;
2431 }
2432 #if (DEBUG)
2433 if (writeToLog)
2434 {
2435 if (match.hit)
2436 {
2437 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForStatement");
2438 }
2439 else
2440 {
2441 System.Lex.WriteFailureToLog(lexer, u"ForStatement");
2442 }
2443 }
2444 #endif
2445 if (!match.hit)
2446 {
2447 match.value = null;
2448 }
2449 return match;
2450 }
2451 public static Match ForInitStatement(LexerFileLexer& lexer, ParsingContext* ctx)
2452 {
2453 #if (DEBUG)
2454 Span debugSpan;
2455 bool writeToLog = lexer.Log() != null;
2456 if (writeToLog)
2457 {
2458 debugSpan = lexer.GetSpan();
2459 System.Lex.WriteBeginRuleToLog(lexer, u"ForInitStatement");
2460 }
2461 #endif
2462 UniquePtr<StatementNode> assignmentStatement;
2463 UniquePtr<ConstructionStatementNode> constructionStatement;
2464 UniquePtr<StatementNode> emptyStatement;
2465 Match match(false);
2466 Match* parentMatch0 = &match;
2467 {
2468 long save = lexer.GetPos();
2469 Match match(false);
2470 Match* parentMatch1 = &match;
2471 {
2472 long save = lexer.GetPos();
2473 Match match(false);
2474 Match* parentMatch2 = &match;
2475 {
2476 long pos = lexer.GetPos();
2477 Match match = StatementParser.AssignmentStatement(lexer, ctx);
2478 assignmentStatement.Reset(cast<StatementNode*>(match.value));
2479 if (match.hit)
2480 {
2481 {
2482 #if (DEBUG)
2483 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForInitStatement");
2484 #endif
2485 return Match(true, assignmentStatement.Release());
2486 }
2487 }
2488 *parentMatch2 = match;
2489 }
2490 *parentMatch1 = match;
2491 if (!match.hit)
2492 {
2493 Match match(false);
2494 Match* parentMatch3 = &match;
2495 lexer.SetPos(save);
2496 {
2497 Match match(false);
2498 Match* parentMatch4 = &match;
2499 {
2500 long pos = lexer.GetPos();
2501 Match match = StatementParser.ConstructionStatement(lexer, ctx);
2502 constructionStatement.Reset(cast<ConstructionStatementNode*>(match.value));
2503 if (match.hit)
2504 {
2505 {
2506 #if (DEBUG)
2507 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForInitStatement");
2508 #endif
2509 return Match(true, constructionStatement.Release());
2510 }
2511 }
2512 *parentMatch4 = match;
2513 }
2514 *parentMatch3 = match;
2515 }
2516 *parentMatch1 = match;
2517 }
2518 }
2519 *parentMatch0 = match;
2520 if (!match.hit)
2521 {
2522 Match match(false);
2523 Match* parentMatch5 = &match;
2524 lexer.SetPos(save);
2525 {
2526 Match match(false);
2527 Match* parentMatch6 = &match;
2528 {
2529 long pos = lexer.GetPos();
2530 Match match = StatementParser.EmptyStatement(lexer, ctx);
2531 emptyStatement.Reset(cast<StatementNode*>(match.value));
2532 if (match.hit)
2533 {
2534 {
2535 #if (DEBUG)
2536 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForInitStatement");
2537 #endif
2538 return Match(true, emptyStatement.Release());
2539 }
2540 }
2541 *parentMatch6 = match;
2542 }
2543 *parentMatch5 = match;
2544 }
2545 *parentMatch0 = match;
2546 }
2547 }
2548 #if (DEBUG)
2549 if (writeToLog)
2550 {
2551 if (match.hit)
2552 {
2553 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForInitStatement");
2554 }
2555 else
2556 {
2557 System.Lex.WriteFailureToLog(lexer, u"ForInitStatement");
2558 }
2559 }
2560 #endif
2561 if (!match.hit)
2562 {
2563 match.value = null;
2564 }
2565 return match;
2566 }
2567 public static Match ForLoopStatementExpr(LexerFileLexer& lexer, ParsingContext* ctx)
2568 {
2569 #if (DEBUG)
2570 Span debugSpan;
2571 bool writeToLog = lexer.Log() != null;
2572 if (writeToLog)
2573 {
2574 debugSpan = lexer.GetSpan();
2575 System.Lex.WriteBeginRuleToLog(lexer, u"ForLoopStatementExpr");
2576 }
2577 #endif
2578 UniquePtr<StatementNode> assignmentStatementExpr;
2579 UniquePtr<Node> expr;
2580 Match match(false);
2581 Match* parentMatch0 = &match;
2582 {
2583 long save = lexer.GetPos();
2584 Match match(false);
2585 Match* parentMatch1 = &match;
2586 {
2587 long save = lexer.GetPos();
2588 Match match(false);
2589 Match* parentMatch2 = &match;
2590 {
2591 long pos = lexer.GetPos();
2592 Match match = StatementParser.AssignmentStatementExpr(lexer, ctx);
2593 assignmentStatementExpr.Reset(cast<StatementNode*>(match.value));
2594 if (match.hit)
2595 {
2596 {
2597 #if (DEBUG)
2598 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForLoopStatementExpr");
2599 #endif
2600 return Match(true, assignmentStatementExpr.Release());
2601 }
2602 }
2603 *parentMatch2 = match;
2604 }
2605 *parentMatch1 = match;
2606 if (!match.hit)
2607 {
2608 Match match(false);
2609 Match* parentMatch3 = &match;
2610 lexer.SetPos(save);
2611 {
2612 Match match(false);
2613 Match* parentMatch4 = &match;
2614 {
2615 long pos = lexer.GetPos();
2616 Span span = lexer.GetSpan();
2617 Match match = ExpressionParser.Expression(lexer, ctx);
2618 expr.Reset(cast<Node*>(match.value));
2619 if (match.hit)
2620 {
2621 {
2622 #if (DEBUG)
2623 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForLoopStatementExpr");
2624 #endif
2625 return Match(true, new ExpressionStatementNode(span, ctx->ModuleId(), expr.Release()));
2626 }
2627 }
2628 *parentMatch4 = match;
2629 }
2630 *parentMatch3 = match;
2631 }
2632 *parentMatch1 = match;
2633 }
2634 }
2635 *parentMatch0 = match;
2636 if (!match.hit)
2637 {
2638 Match match(false);
2639 Match* parentMatch5 = &match;
2640 lexer.SetPos(save);
2641 {
2642 Match match(false);
2643 Match* parentMatch6 = &match;
2644 {
2645 long pos = lexer.GetPos();
2646 Span span = lexer.GetSpan();
2647 Match match(true);
2648 if (match.hit)
2649 {
2650 {
2651 #if (DEBUG)
2652 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForLoopStatementExpr");
2653 #endif
2654 return Match(true, new EmptyStatementNode(span, ctx->ModuleId()));
2655 }
2656 }
2657 *parentMatch6 = match;
2658 }
2659 *parentMatch5 = match;
2660 }
2661 *parentMatch0 = match;
2662 }
2663 }
2664 #if (DEBUG)
2665 if (writeToLog)
2666 {
2667 if (match.hit)
2668 {
2669 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ForLoopStatementExpr");
2670 }
2671 else
2672 {
2673 System.Lex.WriteFailureToLog(lexer, u"ForLoopStatementExpr");
2674 }
2675 }
2676 #endif
2677 if (!match.hit)
2678 {
2679 match.value = null;
2680 }
2681 return match;
2682 }
2683 public static Match RangeForStatement(LexerFileLexer& lexer, ParsingContext* ctx)
2684 {
2685 #if (DEBUG)
2686 Span debugSpan;
2687 bool writeToLog = lexer.Log() != null;
2688 if (writeToLog)
2689 {
2690 debugSpan = lexer.GetSpan();
2691 System.Lex.WriteBeginRuleToLog(lexer, u"RangeForStatement");
2692 }
2693 #endif
2694 Span s;
2695 Span leftParenSpan;
2696 Span rightParenSpan;
2697 Span colonSpan;
2698 UniquePtr<Node> type;
2699 UniquePtr<IdentifierNode> id;
2700 UniquePtr<Node> container;
2701 UniquePtr<StatementNode> action;
2702 Match match(false);
2703 Match* parentMatch0 = &match;
2704 {
2705 long pos = lexer.GetPos();
2706 Match match(false);
2707 Match* parentMatch1 = &match;
2708 {
2709 Match match(false);
2710 Match* parentMatch2 = &match;
2711 {
2712 Match match(false);
2713 Match* parentMatch3 = &match;
2714 {
2715 Match match(false);
2716 Match* parentMatch4 = &match;
2717 {
2718 Match match(false);
2719 Match* parentMatch5 = &match;
2720 {
2721 Match match(false);
2722 Match* parentMatch6 = &match;
2723 {
2724 Match match(false);
2725 Match* parentMatch7 = &match;
2726 {
2727 Match match(false);
2728 Match* parentMatch8 = &match;
2729 {
2730 Match match(false);
2731 Match* parentMatch9 = &match;
2732 {
2733 long pos = lexer.GetPos();
2734 Span span = lexer.GetSpan();
2735 Match match(false);
2736 if (*lexer == FOR)
2737 {
2738 ++lexer;
2739 match.hit = true;
2740 }
2741 if (match.hit)
2742 {
2743 s = span;
2744 }
2745 *parentMatch9 = match;
2746 }
2747 *parentMatch8 = match;
2748 }
2749 if (match.hit)
2750 {
2751 Match match(false);
2752 Match* parentMatch10 = &match;
2753 {
2754 Match match(false);
2755 Match* parentMatch11 = &match;
2756 {
2757 long pos = lexer.GetPos();
2758 Span span = lexer.GetSpan();
2759 Match match(false);
2760 if (*lexer == LPAREN)
2761 {
2762 ++lexer;
2763 match.hit = true;
2764 }
2765 if (match.hit)
2766 {
2767 leftParenSpan = span;
2768 }
2769 *parentMatch11 = match;
2770 }
2771 *parentMatch10 = match;
2772 }
2773 *parentMatch8 = match;
2774 }
2775 *parentMatch7 = match;
2776 }
2777 if (match.hit)
2778 {
2779 Match match(false);
2780 Match* parentMatch12 = &match;
2781 {
2782 Match match = TypeExprParser.TypeExpr(lexer, ctx);
2783 type.Reset(cast<Node*>(match.value));
2784 *parentMatch12 = match;
2785 }
2786 *parentMatch7 = match;
2787 }
2788 *parentMatch6 = match;
2789 }
2790 if (match.hit)
2791 {
2792 Match match(false);
2793 Match* parentMatch13 = &match;
2794 {
2795 Match match = IdentifierParser.Identifier(lexer, ctx);
2796 id.Reset(cast<IdentifierNode*>(match.value));
2797 *parentMatch13 = match;
2798 }
2799 *parentMatch6 = match;
2800 }
2801 *parentMatch5 = match;
2802 }
2803 if (match.hit)
2804 {
2805 Match match(false);
2806 Match* parentMatch14 = &match;
2807 {
2808 Match match(false);
2809 Match* parentMatch15 = &match;
2810 {
2811 long pos = lexer.GetPos();
2812 Span span = lexer.GetSpan();
2813 Match match(false);
2814 if (*lexer == COLON)
2815 {
2816 ++lexer;
2817 match.hit = true;
2818 }
2819 if (match.hit)
2820 {
2821 colonSpan = span;
2822 }
2823 *parentMatch15 = match;
2824 }
2825 *parentMatch14 = match;
2826 }
2827 *parentMatch5 = match;
2828 }
2829 *parentMatch4 = match;
2830 }
2831 if (match.hit)
2832 {
2833 Match match(false);
2834 Match* parentMatch16 = &match;
2835 {
2836 Match match(true);
2837 Match* parentMatch17 = &match;
2838 {
2839 System.Lex.Span span = lexer.GetSpan();
2840 Match match = ExpressionParser.Expression(lexer, ctx);
2841 container.Reset(cast<Node*>(match.value));
2842 if (match.hit)
2843 {
2844 *parentMatch17 = match;
2845 }
2846 else
2847 {
2848 lexer.ThrowExpectationFailure(span, u"expression");
2849 }
2850 }
2851 *parentMatch16 = match;
2852 }
2853 *parentMatch4 = match;
2854 }
2855 *parentMatch3 = match;
2856 }
2857 if (match.hit)
2858 {
2859 Match match(false);
2860 Match* parentMatch18 = &match;
2861 {
2862 Match match(false);
2863 Match* parentMatch19 = &match;
2864 {
2865 long pos = lexer.GetPos();
2866 Span span = lexer.GetSpan();
2867 Match match(true);
2868 Match* parentMatch20 = &match;
2869 {
2870 System.Lex.Span span = lexer.GetSpan();
2871 Match match(false);
2872 if (*lexer == RPAREN)
2873 {
2874 ++lexer;
2875 match.hit = true;
2876 }
2877 if (match.hit)
2878 {
2879 *parentMatch20 = match;
2880 }
2881 else
2882 {
2883 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
2884 }
2885 }
2886 if (match.hit)
2887 {
2888 rightParenSpan = span;
2889 }
2890 *parentMatch19 = match;
2891 }
2892 *parentMatch18 = match;
2893 }
2894 *parentMatch3 = match;
2895 }
2896 *parentMatch2 = match;
2897 }
2898 if (match.hit)
2899 {
2900 Match match(false);
2901 Match* parentMatch21 = &match;
2902 {
2903 Match match(false);
2904 Match* parentMatch22 = &match;
2905 {
2906 long pos = lexer.GetPos();
2907 Span span = lexer.GetSpan();
2908 Match match = StatementParser.Statement(lexer, ctx);
2909 action.Reset(cast<StatementNode*>(match.value));
2910 if (match.hit)
2911 {
2912 s.end = span.end;
2913 }
2914 *parentMatch22 = match;
2915 }
2916 *parentMatch21 = match;
2917 }
2918 *parentMatch2 = match;
2919 }
2920 *parentMatch1 = match;
2921 }
2922 if (match.hit)
2923 {
2924 RangeForStatementNode* value = new RangeForStatementNode(s, ctx->ModuleId(), type.Release(), id.Release(), container.Release(), action.Release());
2925 value->SetLeftParenSpan(leftParenSpan);
2926 value->SetRightParenSpan(rightParenSpan);
2927 value->SetColonSpan(colonSpan);
2928 {
2929 #if (DEBUG)
2930 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"RangeForStatement");
2931 #endif
2932 return Match(true, value);
2933 }
2934 }
2935 *parentMatch0 = match;
2936 }
2937 #if (DEBUG)
2938 if (writeToLog)
2939 {
2940 if (match.hit)
2941 {
2942 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"RangeForStatement");
2943 }
2944 else
2945 {
2946 System.Lex.WriteFailureToLog(lexer, u"RangeForStatement");
2947 }
2948 }
2949 #endif
2950 if (!match.hit)
2951 {
2952 match.value = null;
2953 }
2954 return match;
2955 }
2956 public static Match BreakStatement(LexerFileLexer& lexer, ParsingContext* ctx)
2957 {
2958 #if (DEBUG)
2959 Span debugSpan;
2960 bool writeToLog = lexer.Log() != null;
2961 if (writeToLog)
2962 {
2963 debugSpan = lexer.GetSpan();
2964 System.Lex.WriteBeginRuleToLog(lexer, u"BreakStatement");
2965 }
2966 #endif
2967 Span s;
2968 Match match(false);
2969 Match* parentMatch0 = &match;
2970 {
2971 Match match(false);
2972 Match* parentMatch1 = &match;
2973 {
2974 long pos = lexer.GetPos();
2975 Span span = lexer.GetSpan();
2976 Match match(false);
2977 if (*lexer == BREAK)
2978 {
2979 ++lexer;
2980 match.hit = true;
2981 }
2982 if (match.hit)
2983 {
2984 s = span;
2985 }
2986 *parentMatch1 = match;
2987 }
2988 *parentMatch0 = match;
2989 }
2990 if (match.hit)
2991 {
2992 Match match(false);
2993 Match* parentMatch2 = &match;
2994 {
2995 Match match(false);
2996 Match* parentMatch3 = &match;
2997 {
2998 long pos = lexer.GetPos();
2999 Span span = lexer.GetSpan();
3000 Match match(true);
3001 Match* parentMatch4 = &match;
3002 {
3003 System.Lex.Span span = lexer.GetSpan();
3004 Match match(false);
3005 if (*lexer == SEMICOLON)
3006 {
3007 ++lexer;
3008 match.hit = true;
3009 }
3010 if (match.hit)
3011 {
3012 *parentMatch4 = match;
3013 }
3014 else
3015 {
3016 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
3017 }
3018 }
3019 if (match.hit)
3020 {
3021 s.end = span.end;
3022 {
3023 #if (DEBUG)
3024 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"BreakStatement");
3025 #endif
3026 return Match(true, new BreakStatementNode(s, ctx->ModuleId()));
3027 }
3028 }
3029 *parentMatch3 = match;
3030 }
3031 *parentMatch2 = match;
3032 }
3033 *parentMatch0 = match;
3034 }
3035 #if (DEBUG)
3036 if (writeToLog)
3037 {
3038 if (match.hit)
3039 {
3040 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"BreakStatement");
3041 }
3042 else
3043 {
3044 System.Lex.WriteFailureToLog(lexer, u"BreakStatement");
3045 }
3046 }
3047 #endif
3048 if (!match.hit)
3049 {
3050 match.value = null;
3051 }
3052 return match;
3053 }
3054 public static Match ContinueStatement(LexerFileLexer& lexer, ParsingContext* ctx)
3055 {
3056 #if (DEBUG)
3057 Span debugSpan;
3058 bool writeToLog = lexer.Log() != null;
3059 if (writeToLog)
3060 {
3061 debugSpan = lexer.GetSpan();
3062 System.Lex.WriteBeginRuleToLog(lexer, u"ContinueStatement");
3063 }
3064 #endif
3065 Span s;
3066 Match match(false);
3067 Match* parentMatch0 = &match;
3068 {
3069 Match match(false);
3070 Match* parentMatch1 = &match;
3071 {
3072 long pos = lexer.GetPos();
3073 Span span = lexer.GetSpan();
3074 Match match(false);
3075 if (*lexer == CONTINUE)
3076 {
3077 ++lexer;
3078 match.hit = true;
3079 }
3080 if (match.hit)
3081 {
3082 s = span;
3083 }
3084 *parentMatch1 = match;
3085 }
3086 *parentMatch0 = match;
3087 }
3088 if (match.hit)
3089 {
3090 Match match(false);
3091 Match* parentMatch2 = &match;
3092 {
3093 Match match(false);
3094 Match* parentMatch3 = &match;
3095 {
3096 long pos = lexer.GetPos();
3097 Span span = lexer.GetSpan();
3098 Match match(true);
3099 Match* parentMatch4 = &match;
3100 {
3101 System.Lex.Span span = lexer.GetSpan();
3102 Match match(false);
3103 if (*lexer == SEMICOLON)
3104 {
3105 ++lexer;
3106 match.hit = true;
3107 }
3108 if (match.hit)
3109 {
3110 *parentMatch4 = match;
3111 }
3112 else
3113 {
3114 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
3115 }
3116 }
3117 if (match.hit)
3118 {
3119 s.end = span.end;
3120 {
3121 #if (DEBUG)
3122 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ContinueStatement");
3123 #endif
3124 return Match(true, new ContinueStatementNode(s, ctx->ModuleId()));
3125 }
3126 }
3127 *parentMatch3 = match;
3128 }
3129 *parentMatch2 = match;
3130 }
3131 *parentMatch0 = match;
3132 }
3133 #if (DEBUG)
3134 if (writeToLog)
3135 {
3136 if (match.hit)
3137 {
3138 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ContinueStatement");
3139 }
3140 else
3141 {
3142 System.Lex.WriteFailureToLog(lexer, u"ContinueStatement");
3143 }
3144 }
3145 #endif
3146 if (!match.hit)
3147 {
3148 match.value = null;
3149 }
3150 return match;
3151 }
3152 public static Match GotoStatement(LexerFileLexer& lexer, ParsingContext* ctx)
3153 {
3154 #if (DEBUG)
3155 Span debugSpan;
3156 bool writeToLog = lexer.Log() != null;
3157 if (writeToLog)
3158 {
3159 debugSpan = lexer.GetSpan();
3160 System.Lex.WriteBeginRuleToLog(lexer, u"GotoStatement");
3161 }
3162 #endif
3163 ustring label;
3164 Span s;
3165 Match match(false);
3166 Match* parentMatch0 = &match;
3167 {
3168 Match match(false);
3169 Match* parentMatch1 = &match;
3170 {
3171 Match match(false);
3172 Match* parentMatch2 = &match;
3173 {
3174 long pos = lexer.GetPos();
3175 Span span = lexer.GetSpan();
3176 Match match(false);
3177 if (*lexer == GOTO)
3178 {
3179 ++lexer;
3180 match.hit = true;
3181 }
3182 if (match.hit)
3183 {
3184 s = span;
3185 }
3186 *parentMatch2 = match;
3187 }
3188 *parentMatch1 = match;
3189 }
3190 if (match.hit)
3191 {
3192 Match match(false);
3193 Match* parentMatch3 = &match;
3194 {
3195 Match match(false);
3196 Match* parentMatch4 = &match;
3197 {
3198 long pos = lexer.GetPos();
3199 Span span = lexer.GetSpan();
3200 Match match(false);
3201 if (*lexer == ID)
3202 {
3203 ++lexer;
3204 match.hit = true;
3205 }
3206 if (match.hit)
3207 {
3208 label = lexer.GetMatch(span);
3209 }
3210 *parentMatch4 = match;
3211 }
3212 *parentMatch3 = match;
3213 }
3214 *parentMatch1 = match;
3215 }
3216 *parentMatch0 = match;
3217 }
3218 if (match.hit)
3219 {
3220 Match match(false);
3221 Match* parentMatch5 = &match;
3222 {
3223 Match match(false);
3224 Match* parentMatch6 = &match;
3225 {
3226 long pos = lexer.GetPos();
3227 Span span = lexer.GetSpan();
3228 Match match(true);
3229 Match* parentMatch7 = &match;
3230 {
3231 System.Lex.Span span = lexer.GetSpan();
3232 Match match(false);
3233 if (*lexer == SEMICOLON)
3234 {
3235 ++lexer;
3236 match.hit = true;
3237 }
3238 if (match.hit)
3239 {
3240 *parentMatch7 = match;
3241 }
3242 else
3243 {
3244 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
3245 }
3246 }
3247 if (match.hit)
3248 {
3249 s.end = span.end;
3250 {
3251 #if (DEBUG)
3252 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"GotoStatement");
3253 #endif
3254 return Match(true, new GotoStatementNode(s, ctx->ModuleId(), label));
3255 }
3256 }
3257 *parentMatch6 = match;
3258 }
3259 *parentMatch5 = match;
3260 }
3261 *parentMatch0 = match;
3262 }
3263 #if (DEBUG)
3264 if (writeToLog)
3265 {
3266 if (match.hit)
3267 {
3268 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"GotoStatement");
3269 }
3270 else
3271 {
3272 System.Lex.WriteFailureToLog(lexer, u"GotoStatement");
3273 }
3274 }
3275 #endif
3276 if (!match.hit)
3277 {
3278 match.value = null;
3279 }
3280 return match;
3281 }
3282 public static Match SwitchStatement(LexerFileLexer& lexer, ParsingContext* ctx)
3283 {
3284 #if (DEBUG)
3285 Span debugSpan;
3286 bool writeToLog = lexer.Log() != null;
3287 if (writeToLog)
3288 {
3289 debugSpan = lexer.GetSpan();
3290 System.Lex.WriteBeginRuleToLog(lexer, u"SwitchStatement");
3291 }
3292 #endif
3293 UniquePtr<SwitchStatementNode> switchStatement;
3294 Span leftParenSpan;
3295 Span rightParenSpan;
3296 Span beginBraceSpan;
3297 Span endBraceSpan;
3298 UniquePtr<Node> cond;
3299 UniquePtr<CaseStatementNode> caseStatement;
3300 UniquePtr<DefaultStatementNode> defaultStatement;
3301 Match match(false);
3302 Match* parentMatch0 = &match;
3303 {
3304 Match match(false);
3305 Match* parentMatch1 = &match;
3306 {
3307 Match match(false);
3308 Match* parentMatch2 = &match;
3309 {
3310 Match match(false);
3311 Match* parentMatch3 = &match;
3312 {
3313 long pos = lexer.GetPos();
3314 Span span = lexer.GetSpan();
3315 Match match(false);
3316 Match* parentMatch4 = &match;
3317 {
3318 Match match(false);
3319 Match* parentMatch5 = &match;
3320 {
3321 Match match(false);
3322 Match* parentMatch6 = &match;
3323 {
3324 Match match(false);
3325 Match* parentMatch7 = &match;
3326 {
3327 Match match(false);
3328 if (*lexer == SWITCH)
3329 {
3330 ++lexer;
3331 match.hit = true;
3332 }
3333 *parentMatch7 = match;
3334 }
3335 if (match.hit)
3336 {
3337 Match match(false);
3338 Match* parentMatch8 = &match;
3339 {
3340 Match match(false);
3341 Match* parentMatch9 = &match;
3342 {
3343 long pos = lexer.GetPos();
3344 Span span = lexer.GetSpan();
3345 Match match(true);
3346 Match* parentMatch10 = &match;
3347 {
3348 System.Lex.Span span = lexer.GetSpan();
3349 Match match(false);
3350 if (*lexer == LPAREN)
3351 {
3352 ++lexer;
3353 match.hit = true;
3354 }
3355 if (match.hit)
3356 {
3357 *parentMatch10 = match;
3358 }
3359 else
3360 {
3361 lexer.ThrowExpectationFailure(span, GetTokenName(LPAREN));
3362 }
3363 }
3364 if (match.hit)
3365 {
3366 leftParenSpan = span;
3367 }
3368 *parentMatch9 = match;
3369 }
3370 *parentMatch8 = match;
3371 }
3372 *parentMatch7 = match;
3373 }
3374 *parentMatch6 = match;
3375 }
3376 if (match.hit)
3377 {
3378 Match match(false);
3379 Match* parentMatch11 = &match;
3380 {
3381 Match match(true);
3382 Match* parentMatch12 = &match;
3383 {
3384 System.Lex.Span span = lexer.GetSpan();
3385 Match match = ExpressionParser.Expression(lexer, ctx);
3386 cond.Reset(cast<Node*>(match.value));
3387 if (match.hit)
3388 {
3389 *parentMatch12 = match;
3390 }
3391 else
3392 {
3393 lexer.ThrowExpectationFailure(span, u"expression");
3394 }
3395 }
3396 *parentMatch11 = match;
3397 }
3398 *parentMatch6 = match;
3399 }
3400 *parentMatch5 = match;
3401 }
3402 if (match.hit)
3403 {
3404 Match match(false);
3405 Match* parentMatch13 = &match;
3406 {
3407 Match match(true);
3408 Match* parentMatch14 = &match;
3409 {
3410 System.Lex.Span span = lexer.GetSpan();
3411 Match match(false);
3412 if (*lexer == RPAREN)
3413 {
3414 ++lexer;
3415 match.hit = true;
3416 }
3417 if (match.hit)
3418 {
3419 *parentMatch14 = match;
3420 }
3421 else
3422 {
3423 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
3424 }
3425 }
3426 *parentMatch13 = match;
3427 }
3428 *parentMatch5 = match;
3429 }
3430 *parentMatch4 = match;
3431 }
3432 if (match.hit)
3433 {
3434 rightParenSpan = span;
3435 switchStatement.Reset(new SwitchStatementNode(span, ctx->ModuleId(), cond.Release()));
3436 switchStatement->SetLeftParenSpan(leftParenSpan);
3437 switchStatement->SetRightParenSpan(rightParenSpan);
3438 }
3439 *parentMatch3 = match;
3440 }
3441 *parentMatch2 = match;
3442 }
3443 if (match.hit)
3444 {
3445 Match match(false);
3446 Match* parentMatch15 = &match;
3447 {
3448 Match match(false);
3449 Match* parentMatch16 = &match;
3450 {
3451 long pos = lexer.GetPos();
3452 Span span = lexer.GetSpan();
3453 Match match(true);
3454 Match* parentMatch17 = &match;
3455 {
3456 System.Lex.Span span = lexer.GetSpan();
3457 Match match(false);
3458 if (*lexer == LBRACE)
3459 {
3460 ++lexer;
3461 match.hit = true;
3462 }
3463 if (match.hit)
3464 {
3465 *parentMatch17 = match;
3466 }
3467 else
3468 {
3469 lexer.ThrowExpectationFailure(span, GetTokenName(LBRACE));
3470 }
3471 }
3472 if (match.hit)
3473 {
3474 beginBraceSpan = span;
3475 }
3476 *parentMatch16 = match;
3477 }
3478 *parentMatch15 = match;
3479 }
3480 *parentMatch2 = match;
3481 }
3482 *parentMatch1 = match;
3483 }
3484 if (match.hit)
3485 {
3486 Match match(false);
3487 Match* parentMatch18 = &match;
3488 {
3489 Match match(true);
3490 Match* parentMatch19 = &match;
3491 {
3492 while (true)
3493 {
3494 long save = lexer.GetPos();
3495 {
3496 Match match(false);
3497 Match* parentMatch20 = &match;
3498 {
3499 Match match(false);
3500 Match* parentMatch21 = &match;
3501 {
3502 long save = lexer.GetPos();
3503 Match match(false);
3504 Match* parentMatch22 = &match;
3505 {
3506 long pos = lexer.GetPos();
3507 Match match = StatementParser.CaseStatement(lexer, ctx);
3508 caseStatement.Reset(cast<CaseStatementNode*>(match.value));
3509 if (match.hit)
3510 {
3511 switchStatement->AddCase(caseStatement.Release());
3512 }
3513 *parentMatch22 = match;
3514 }
3515 *parentMatch21 = match;
3516 if (!match.hit)
3517 {
3518 Match match(false);
3519 Match* parentMatch23 = &match;
3520 lexer.SetPos(save);
3521 {
3522 Match match(false);
3523 Match* parentMatch24 = &match;
3524 {
3525 long pos = lexer.GetPos();
3526 Match match = StatementParser.DefaultStatement(lexer, ctx);
3527 defaultStatement.Reset(cast<DefaultStatementNode*>(match.value));
3528 if (match.hit)
3529 {
3530 switchStatement->SetDefault(defaultStatement.Release());
3531 }
3532 *parentMatch24 = match;
3533 }
3534 *parentMatch23 = match;
3535 }
3536 *parentMatch21 = match;
3537 }
3538 }
3539 *parentMatch20 = match;
3540 }
3541 if (match.hit)
3542 {
3543 *parentMatch19 = match;
3544 }
3545 else
3546 {
3547 lexer.SetPos(save);
3548 break;
3549 }
3550 }
3551 }
3552 }
3553 *parentMatch18 = match;
3554 }
3555 *parentMatch1 = match;
3556 }
3557 *parentMatch0 = match;
3558 }
3559 if (match.hit)
3560 {
3561 Match match(false);
3562 Match* parentMatch25 = &match;
3563 {
3564 Match match(false);
3565 Match* parentMatch26 = &match;
3566 {
3567 long pos = lexer.GetPos();
3568 Span span = lexer.GetSpan();
3569 Match match(true);
3570 Match* parentMatch27 = &match;
3571 {
3572 System.Lex.Span span = lexer.GetSpan();
3573 Match match(false);
3574 if (*lexer == RBRACE)
3575 {
3576 ++lexer;
3577 match.hit = true;
3578 }
3579 if (match.hit)
3580 {
3581 *parentMatch27 = match;
3582 }
3583 else
3584 {
3585 lexer.ThrowExpectationFailure(span, GetTokenName(RBRACE));
3586 }
3587 }
3588 if (match.hit)
3589 {
3590 endBraceSpan = span;
3591 switchStatement->SetBeginBraceSpan(beginBraceSpan);
3592 switchStatement->SetEndBraceSpan(endBraceSpan);
3593 {
3594 #if (DEBUG)
3595 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"SwitchStatement");
3596 #endif
3597 return Match(true, switchStatement.Release());
3598 }
3599 }
3600 *parentMatch26 = match;
3601 }
3602 *parentMatch25 = match;
3603 }
3604 *parentMatch0 = match;
3605 }
3606 #if (DEBUG)
3607 if (writeToLog)
3608 {
3609 if (match.hit)
3610 {
3611 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"SwitchStatement");
3612 }
3613 else
3614 {
3615 System.Lex.WriteFailureToLog(lexer, u"SwitchStatement");
3616 }
3617 }
3618 #endif
3619 if (!match.hit)
3620 {
3621 match.value = null;
3622 }
3623 return match;
3624 }
3625 public static Match CaseStatement(LexerFileLexer& lexer, ParsingContext* ctx)
3626 {
3627 #if (DEBUG)
3628 Span debugSpan;
3629 bool writeToLog = lexer.Log() != null;
3630 if (writeToLog)
3631 {
3632 debugSpan = lexer.GetSpan();
3633 System.Lex.WriteBeginRuleToLog(lexer, u"CaseStatement");
3634 }
3635 #endif
3636 UniquePtr<CaseStatementNode> caseS;
3637 Span s;
3638 Span caseSpan;
3639 UniquePtr<Node> caseExpr;
3640 UniquePtr<StatementNode> stmt;
3641 Match match(false);
3642 Match* parentMatch0 = &match;
3643 {
3644 Match match(false);
3645 Match* parentMatch1 = &match;
3646 {
3647 long pos = lexer.GetPos();
3648 Span span = lexer.GetSpan();
3649 Match match(true);
3650 if (match.hit)
3651 {
3652 caseS.Reset(new CaseStatementNode(span, ctx->ModuleId()));
3653 s = span;
3654 }
3655 *parentMatch1 = match;
3656 }
3657 *parentMatch0 = match;
3658 }
3659 if (match.hit)
3660 {
3661 Match match(false);
3662 Match* parentMatch2 = &match;
3663 {
3664 Match match(false);
3665 Match* parentMatch3 = &match;
3666 {
3667 long pos = lexer.GetPos();
3668 Match match(false);
3669 Match* parentMatch4 = &match;
3670 {
3671 Match match(false);
3672 Match* parentMatch5 = &match;
3673 {
3674 Match match(false);
3675 Match* parentMatch6 = &match;
3676 {
3677 long pos = lexer.GetPos();
3678 Span span = lexer.GetSpan();
3679 Match match(false);
3680 Match* parentMatch7 = &match;
3681 {
3682 Match match(false);
3683 Match* parentMatch8 = &match;
3684 {
3685 Match match(false);
3686 Match* parentMatch9 = &match;
3687 {
3688 Match match(false);
3689 Match* parentMatch10 = &match;
3690 {
3691 Match match(false);
3692 Match* parentMatch11 = &match;
3693 {
3694 Match match(false);
3695 Match* parentMatch12 = &match;
3696 {
3697 long pos = lexer.GetPos();
3698 Span span = lexer.GetSpan();
3699 Match match(false);
3700 if (*lexer == CASE)
3701 {
3702 ++lexer;
3703 match.hit = true;
3704 }
3705 if (match.hit)
3706 {
3707 caseSpan = span;
3708 }
3709 *parentMatch12 = match;
3710 }
3711 *parentMatch11 = match;
3712 }
3713 if (match.hit)
3714 {
3715 Match match(false);
3716 Match* parentMatch13 = &match;
3717 {
3718 Match match(false);
3719 Match* parentMatch14 = &match;
3720 {
3721 long pos = lexer.GetPos();
3722 Match match = ExpressionParser.Expression(lexer, ctx);
3723 caseExpr.Reset(cast<Node*>(match.value));
3724 if (match.hit)
3725 {
3726 caseS->AddCaseSpan(caseSpan);
3727 caseS->AddCaseExpr(caseExpr.Release());
3728 }
3729 *parentMatch14 = match;
3730 }
3731 *parentMatch13 = match;
3732 }
3733 *parentMatch11 = match;
3734 }
3735 *parentMatch10 = match;
3736 }
3737 if (match.hit)
3738 {
3739 Match match(false);
3740 Match* parentMatch15 = &match;
3741 {
3742 Match match(true);
3743 Match* parentMatch16 = &match;
3744 {
3745 System.Lex.Span span = lexer.GetSpan();
3746 Match match(false);
3747 if (*lexer == COLON)
3748 {
3749 ++lexer;
3750 match.hit = true;
3751 }
3752 if (match.hit)
3753 {
3754 *parentMatch16 = match;
3755 }
3756 else
3757 {
3758 lexer.ThrowExpectationFailure(span, GetTokenName(COLON));
3759 }
3760 }
3761 *parentMatch15 = match;
3762 }
3763 *parentMatch10 = match;
3764 }
3765 *parentMatch9 = match;
3766 }
3767 *parentMatch8 = match;
3768 }
3769 if (match.hit)
3770 {
3771 Match match(true);
3772 Match* parentMatch17 = &match;
3773 while (true)
3774 {
3775 long save = lexer.GetPos();
3776 {
3777 Match match(false);
3778 Match* parentMatch18 = &match;
3779 {
3780 Match match(false);
3781 Match* parentMatch19 = &match;
3782 {
3783 Match match(false);
3784 Match* parentMatch20 = &match;
3785 {
3786 Match match(false);
3787 Match* parentMatch21 = &match;
3788 {
3789 long pos = lexer.GetPos();
3790 Span span = lexer.GetSpan();
3791 Match match(false);
3792 if (*lexer == CASE)
3793 {
3794 ++lexer;
3795 match.hit = true;
3796 }
3797 if (match.hit)
3798 {
3799 caseSpan = span;
3800 }
3801 *parentMatch21 = match;
3802 }
3803 *parentMatch20 = match;
3804 }
3805 if (match.hit)
3806 {
3807 Match match(false);
3808 Match* parentMatch22 = &match;
3809 {
3810 Match match(false);
3811 Match* parentMatch23 = &match;
3812 {
3813 long pos = lexer.GetPos();
3814 Match match = ExpressionParser.Expression(lexer, ctx);
3815 caseExpr.Reset(cast<Node*>(match.value));
3816 if (match.hit)
3817 {
3818 caseS->AddCaseSpan(caseSpan);
3819 caseS->AddCaseExpr(caseExpr.Release());
3820 }
3821 *parentMatch23 = match;
3822 }
3823 *parentMatch22 = match;
3824 }
3825 *parentMatch20 = match;
3826 }
3827 *parentMatch19 = match;
3828 }
3829 if (match.hit)
3830 {
3831 Match match(false);
3832 Match* parentMatch24 = &match;
3833 {
3834 Match match(true);
3835 Match* parentMatch25 = &match;
3836 {
3837 System.Lex.Span span = lexer.GetSpan();
3838 Match match(false);
3839 if (*lexer == COLON)
3840 {
3841 ++lexer;
3842 match.hit = true;
3843 }
3844 if (match.hit)
3845 {
3846 *parentMatch25 = match;
3847 }
3848 else
3849 {
3850 lexer.ThrowExpectationFailure(span, GetTokenName(COLON));
3851 }
3852 }
3853 *parentMatch24 = match;
3854 }
3855 *parentMatch19 = match;
3856 }
3857 *parentMatch18 = match;
3858 }
3859 if (match.hit)
3860 {
3861 *parentMatch17 = match;
3862 }
3863 else
3864 {
3865 lexer.SetPos(save);
3866 break;
3867 }
3868 }
3869 }
3870 }
3871 *parentMatch7 = match;
3872 }
3873 if (match.hit)
3874 {
3875 s.end = span.end;
3876 caseS->SetSpan(s);
3877 }
3878 *parentMatch6 = match;
3879 }
3880 *parentMatch5 = match;
3881 }
3882 if (match.hit)
3883 {
3884 Match match(false);
3885 Match* parentMatch26 = &match;
3886 {
3887 Match match(true);
3888 Match* parentMatch27 = &match;
3889 {
3890 while (true)
3891 {
3892 long save = lexer.GetPos();
3893 {
3894 Match match(false);
3895 Match* parentMatch28 = &match;
3896 {
3897 Match match(false);
3898 Match* parentMatch29 = &match;
3899 {
3900 long pos = lexer.GetPos();
3901 Match match = StatementParser.Statement(lexer, ctx);
3902 stmt.Reset(cast<StatementNode*>(match.value));
3903 if (match.hit)
3904 {
3905 caseS->AddStatement(stmt.Release());
3906 }
3907 *parentMatch29 = match;
3908 }
3909 *parentMatch28 = match;
3910 }
3911 if (match.hit)
3912 {
3913 *parentMatch27 = match;
3914 }
3915 else
3916 {
3917 lexer.SetPos(save);
3918 break;
3919 }
3920 }
3921 }
3922 }
3923 *parentMatch26 = match;
3924 }
3925 *parentMatch5 = match;
3926 }
3927 *parentMatch4 = match;
3928 }
3929 if (match.hit)
3930 {
3931 {
3932 #if (DEBUG)
3933 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"CaseStatement");
3934 #endif
3935 return Match(true, caseS.Release());
3936 }
3937 }
3938 *parentMatch3 = match;
3939 }
3940 *parentMatch2 = match;
3941 }
3942 *parentMatch0 = match;
3943 }
3944 #if (DEBUG)
3945 if (writeToLog)
3946 {
3947 if (match.hit)
3948 {
3949 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"CaseStatement");
3950 }
3951 else
3952 {
3953 System.Lex.WriteFailureToLog(lexer, u"CaseStatement");
3954 }
3955 }
3956 #endif
3957 if (!match.hit)
3958 {
3959 match.value = null;
3960 }
3961 return match;
3962 }
3963 public static Match DefaultStatement(LexerFileLexer& lexer, ParsingContext* ctx)
3964 {
3965 #if (DEBUG)
3966 Span debugSpan;
3967 bool writeToLog = lexer.Log() != null;
3968 if (writeToLog)
3969 {
3970 debugSpan = lexer.GetSpan();
3971 System.Lex.WriteBeginRuleToLog(lexer, u"DefaultStatement");
3972 }
3973 #endif
3974 UniquePtr<DefaultStatementNode> defaultS;
3975 Span s;
3976 UniquePtr<StatementNode> stmt;
3977 Match match(false);
3978 Match* parentMatch0 = &match;
3979 {
3980 long pos = lexer.GetPos();
3981 Match match(false);
3982 Match* parentMatch1 = &match;
3983 {
3984 Match match(false);
3985 Match* parentMatch2 = &match;
3986 {
3987 Match match(false);
3988 Match* parentMatch3 = &match;
3989 {
3990 Match match(false);
3991 Match* parentMatch4 = &match;
3992 {
3993 long pos = lexer.GetPos();
3994 Span span = lexer.GetSpan();
3995 Match match(false);
3996 if (*lexer == DEFAULT)
3997 {
3998 ++lexer;
3999 match.hit = true;
4000 }
4001 if (match.hit)
4002 {
4003 s = span;
4004 }
4005 *parentMatch4 = match;
4006 }
4007 *parentMatch3 = match;
4008 }
4009 if (match.hit)
4010 {
4011 Match match(false);
4012 Match* parentMatch5 = &match;
4013 {
4014 Match match(false);
4015 Match* parentMatch6 = &match;
4016 {
4017 long pos = lexer.GetPos();
4018 Span span = lexer.GetSpan();
4019 Match match(true);
4020 Match* parentMatch7 = &match;
4021 {
4022 System.Lex.Span span = lexer.GetSpan();
4023 Match match(false);
4024 if (*lexer == COLON)
4025 {
4026 ++lexer;
4027 match.hit = true;
4028 }
4029 if (match.hit)
4030 {
4031 *parentMatch7 = match;
4032 }
4033 else
4034 {
4035 lexer.ThrowExpectationFailure(span, GetTokenName(COLON));
4036 }
4037 }
4038 if (match.hit)
4039 {
4040 s.end = span.end;
4041 defaultS.Reset(new DefaultStatementNode(s, ctx->ModuleId()));
4042 }
4043 *parentMatch6 = match;
4044 }
4045 *parentMatch5 = match;
4046 }
4047 *parentMatch3 = match;
4048 }
4049 *parentMatch2 = match;
4050 }
4051 if (match.hit)
4052 {
4053 Match match(false);
4054 Match* parentMatch8 = &match;
4055 {
4056 Match match(true);
4057 Match* parentMatch9 = &match;
4058 {
4059 while (true)
4060 {
4061 long save = lexer.GetPos();
4062 {
4063 Match match(false);
4064 Match* parentMatch10 = &match;
4065 {
4066 Match match(false);
4067 Match* parentMatch11 = &match;
4068 {
4069 long pos = lexer.GetPos();
4070 Match match = StatementParser.Statement(lexer, ctx);
4071 stmt.Reset(cast<StatementNode*>(match.value));
4072 if (match.hit)
4073 {
4074 defaultS->AddStatement(stmt.Release());
4075 }
4076 *parentMatch11 = match;
4077 }
4078 *parentMatch10 = match;
4079 }
4080 if (match.hit)
4081 {
4082 *parentMatch9 = match;
4083 }
4084 else
4085 {
4086 lexer.SetPos(save);
4087 break;
4088 }
4089 }
4090 }
4091 }
4092 *parentMatch8 = match;
4093 }
4094 *parentMatch2 = match;
4095 }
4096 *parentMatch1 = match;
4097 }
4098 if (match.hit)
4099 {
4100 {
4101 #if (DEBUG)
4102 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DefaultStatement");
4103 #endif
4104 return Match(true, defaultS.Release());
4105 }
4106 }
4107 *parentMatch0 = match;
4108 }
4109 #if (DEBUG)
4110 if (writeToLog)
4111 {
4112 if (match.hit)
4113 {
4114 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DefaultStatement");
4115 }
4116 else
4117 {
4118 System.Lex.WriteFailureToLog(lexer, u"DefaultStatement");
4119 }
4120 }
4121 #endif
4122 if (!match.hit)
4123 {
4124 match.value = null;
4125 }
4126 return match;
4127 }
4128 public static Match GotoCaseStatement(LexerFileLexer& lexer, ParsingContext* ctx)
4129 {
4130 #if (DEBUG)
4131 Span debugSpan;
4132 bool writeToLog = lexer.Log() != null;
4133 if (writeToLog)
4134 {
4135 debugSpan = lexer.GetSpan();
4136 System.Lex.WriteBeginRuleToLog(lexer, u"GotoCaseStatement");
4137 }
4138 #endif
4139 Span s;
4140 UniquePtr<Node> caseExpr;
4141 Match match(false);
4142 Match* parentMatch0 = &match;
4143 {
4144 Match match(false);
4145 Match* parentMatch1 = &match;
4146 {
4147 Match match(false);
4148 Match* parentMatch2 = &match;
4149 {
4150 Match match(false);
4151 Match* parentMatch3 = &match;
4152 {
4153 long pos = lexer.GetPos();
4154 Span span = lexer.GetSpan();
4155 Match match(false);
4156 if (*lexer == GOTO)
4157 {
4158 ++lexer;
4159 match.hit = true;
4160 }
4161 if (match.hit)
4162 {
4163 s = span;
4164 }
4165 *parentMatch3 = match;
4166 }
4167 *parentMatch2 = match;
4168 }
4169 if (match.hit)
4170 {
4171 Match match(false);
4172 Match* parentMatch4 = &match;
4173 {
4174 Match match(false);
4175 if (*lexer == CASE)
4176 {
4177 ++lexer;
4178 match.hit = true;
4179 }
4180 *parentMatch4 = match;
4181 }
4182 *parentMatch2 = match;
4183 }
4184 *parentMatch1 = match;
4185 }
4186 if (match.hit)
4187 {
4188 Match match(false);
4189 Match* parentMatch5 = &match;
4190 {
4191 Match match = ExpressionParser.Expression(lexer, ctx);
4192 caseExpr.Reset(cast<Node*>(match.value));
4193 *parentMatch5 = match;
4194 }
4195 *parentMatch1 = match;
4196 }
4197 *parentMatch0 = match;
4198 }
4199 if (match.hit)
4200 {
4201 Match match(false);
4202 Match* parentMatch6 = &match;
4203 {
4204 Match match(false);
4205 Match* parentMatch7 = &match;
4206 {
4207 long pos = lexer.GetPos();
4208 Span span = lexer.GetSpan();
4209 Match match(true);
4210 Match* parentMatch8 = &match;
4211 {
4212 System.Lex.Span span = lexer.GetSpan();
4213 Match match(false);
4214 if (*lexer == SEMICOLON)
4215 {
4216 ++lexer;
4217 match.hit = true;
4218 }
4219 if (match.hit)
4220 {
4221 *parentMatch8 = match;
4222 }
4223 else
4224 {
4225 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
4226 }
4227 }
4228 if (match.hit)
4229 {
4230 s.end = span.end;
4231 {
4232 #if (DEBUG)
4233 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"GotoCaseStatement");
4234 #endif
4235 return Match(true, new GotoCaseStatementNode(s, ctx->ModuleId(), caseExpr.Release()));
4236 }
4237 }
4238 *parentMatch7 = match;
4239 }
4240 *parentMatch6 = match;
4241 }
4242 *parentMatch0 = match;
4243 }
4244 #if (DEBUG)
4245 if (writeToLog)
4246 {
4247 if (match.hit)
4248 {
4249 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"GotoCaseStatement");
4250 }
4251 else
4252 {
4253 System.Lex.WriteFailureToLog(lexer, u"GotoCaseStatement");
4254 }
4255 }
4256 #endif
4257 if (!match.hit)
4258 {
4259 match.value = null;
4260 }
4261 return match;
4262 }
4263 public static Match GotoDefaultStatement(LexerFileLexer& lexer, ParsingContext* ctx)
4264 {
4265 #if (DEBUG)
4266 Span debugSpan;
4267 bool writeToLog = lexer.Log() != null;
4268 if (writeToLog)
4269 {
4270 debugSpan = lexer.GetSpan();
4271 System.Lex.WriteBeginRuleToLog(lexer, u"GotoDefaultStatement");
4272 }
4273 #endif
4274 Span s;
4275 Match match(false);
4276 Match* parentMatch0 = &match;
4277 {
4278 Match match(false);
4279 Match* parentMatch1 = &match;
4280 {
4281 Match match(false);
4282 Match* parentMatch2 = &match;
4283 {
4284 long pos = lexer.GetPos();
4285 Span span = lexer.GetSpan();
4286 Match match(false);
4287 if (*lexer == GOTO)
4288 {
4289 ++lexer;
4290 match.hit = true;
4291 }
4292 if (match.hit)
4293 {
4294 s = span;
4295 }
4296 *parentMatch2 = match;
4297 }
4298 *parentMatch1 = match;
4299 }
4300 if (match.hit)
4301 {
4302 Match match(false);
4303 Match* parentMatch3 = &match;
4304 {
4305 Match match(false);
4306 if (*lexer == DEFAULT)
4307 {
4308 ++lexer;
4309 match.hit = true;
4310 }
4311 *parentMatch3 = match;
4312 }
4313 *parentMatch1 = match;
4314 }
4315 *parentMatch0 = match;
4316 }
4317 if (match.hit)
4318 {
4319 Match match(false);
4320 Match* parentMatch4 = &match;
4321 {
4322 Match match(false);
4323 Match* parentMatch5 = &match;
4324 {
4325 long pos = lexer.GetPos();
4326 Span span = lexer.GetSpan();
4327 Match match(true);
4328 Match* parentMatch6 = &match;
4329 {
4330 System.Lex.Span span = lexer.GetSpan();
4331 Match match(false);
4332 if (*lexer == SEMICOLON)
4333 {
4334 ++lexer;
4335 match.hit = true;
4336 }
4337 if (match.hit)
4338 {
4339 *parentMatch6 = match;
4340 }
4341 else
4342 {
4343 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
4344 }
4345 }
4346 if (match.hit)
4347 {
4348 s.end = span.end;
4349 {
4350 #if (DEBUG)
4351 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"GotoDefaultStatement");
4352 #endif
4353 return Match(true, new GotoDefaultStatementNode(s, ctx->ModuleId()));
4354 }
4355 }
4356 *parentMatch5 = match;
4357 }
4358 *parentMatch4 = match;
4359 }
4360 *parentMatch0 = match;
4361 }
4362 #if (DEBUG)
4363 if (writeToLog)
4364 {
4365 if (match.hit)
4366 {
4367 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"GotoDefaultStatement");
4368 }
4369 else
4370 {
4371 System.Lex.WriteFailureToLog(lexer, u"GotoDefaultStatement");
4372 }
4373 }
4374 #endif
4375 if (!match.hit)
4376 {
4377 match.value = null;
4378 }
4379 return match;
4380 }
4381 public static Match AssignmentStatementExpr(LexerFileLexer& lexer, ParsingContext* ctx)
4382 {
4383 #if (DEBUG)
4384 Span debugSpan;
4385 bool writeToLog = lexer.Log() != null;
4386 if (writeToLog)
4387 {
4388 debugSpan = lexer.GetSpan();
4389 System.Lex.WriteBeginRuleToLog(lexer, u"AssignmentStatementExpr");
4390 }
4391 #endif
4392 Span s;
4393 UniquePtr<Node> target;
4394 UniquePtr<Node> source;
4395 Match match(false);
4396 Match* parentMatch0 = &match;
4397 {
4398 Match match(false);
4399 Match* parentMatch1 = &match;
4400 {
4401 Match match(false);
4402 Match* parentMatch2 = &match;
4403 {
4404 Match match(false);
4405 Match* parentMatch3 = &match;
4406 {
4407 long pos = lexer.GetPos();
4408 Span span = lexer.GetSpan();
4409 Match match(true);
4410 if (match.hit)
4411 {
4412 ctx->PushParsingLvalue(true);
4413 s = span;
4414 }
4415 *parentMatch3 = match;
4416 }
4417 *parentMatch2 = match;
4418 }
4419 if (match.hit)
4420 {
4421 Match match(false);
4422 Match* parentMatch4 = &match;
4423 {
4424 Match match(false);
4425 Match* parentMatch5 = &match;
4426 {
4427 long pos = lexer.GetPos();
4428 Match match = ExpressionParser.Expression(lexer, ctx);
4429 target.Reset(cast<Node*>(match.value));
4430 if (match.hit)
4431 {
4432 ctx->PopParsingLvalue();
4433 }
4434 else
4435 {
4436 ctx->PopParsingLvalue();
4437 }
4438 *parentMatch5 = match;
4439 }
4440 *parentMatch4 = match;
4441 }
4442 *parentMatch2 = match;
4443 }
4444 *parentMatch1 = match;
4445 }
4446 if (match.hit)
4447 {
4448 Match match(false);
4449 Match* parentMatch6 = &match;
4450 {
4451 Match match(false);
4452 if (*lexer == ASSIGN)
4453 {
4454 ++lexer;
4455 match.hit = true;
4456 }
4457 *parentMatch6 = match;
4458 }
4459 *parentMatch1 = match;
4460 }
4461 *parentMatch0 = match;
4462 }
4463 if (match.hit)
4464 {
4465 Match match(false);
4466 Match* parentMatch7 = &match;
4467 {
4468 Match match(false);
4469 Match* parentMatch8 = &match;
4470 {
4471 long pos = lexer.GetPos();
4472 Span span = lexer.GetSpan();
4473 Match match = ExpressionParser.Expression(lexer, ctx);
4474 source.Reset(cast<Node*>(match.value));
4475 if (match.hit)
4476 {
4477 s.end = span.end;
4478 {
4479 #if (DEBUG)
4480 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"AssignmentStatementExpr");
4481 #endif
4482 return Match(true, new AssignmentStatementNode(s, ctx->ModuleId(), target.Release(), source.Release()));
4483 }
4484 }
4485 *parentMatch8 = match;
4486 }
4487 *parentMatch7 = match;
4488 }
4489 *parentMatch0 = match;
4490 }
4491 #if (DEBUG)
4492 if (writeToLog)
4493 {
4494 if (match.hit)
4495 {
4496 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"AssignmentStatementExpr");
4497 }
4498 else
4499 {
4500 System.Lex.WriteFailureToLog(lexer, u"AssignmentStatementExpr");
4501 }
4502 }
4503 #endif
4504 if (!match.hit)
4505 {
4506 match.value = null;
4507 }
4508 return match;
4509 }
4510 public static Match AssignmentStatement(LexerFileLexer& lexer, ParsingContext* ctx)
4511 {
4512 #if (DEBUG)
4513 Span debugSpan;
4514 bool writeToLog = lexer.Log() != null;
4515 if (writeToLog)
4516 {
4517 debugSpan = lexer.GetSpan();
4518 System.Lex.WriteBeginRuleToLog(lexer, u"AssignmentStatement");
4519 }
4520 #endif
4521 UniquePtr<StatementNode> statement;
4522 UniquePtr<StatementNode> stmt;
4523 Match match(false);
4524 Match* parentMatch0 = &match;
4525 {
4526 Match match = StatementParser.AssignmentStatementExpr(lexer, ctx);
4527 stmt.Reset(cast<StatementNode*>(match.value));
4528 *parentMatch0 = match;
4529 }
4530 if (match.hit)
4531 {
4532 Match match(false);
4533 Match* parentMatch1 = &match;
4534 {
4535 Match match(false);
4536 Match* parentMatch2 = &match;
4537 {
4538 long pos = lexer.GetPos();
4539 Span span = lexer.GetSpan();
4540 Match match(false);
4541 if (*lexer == SEMICOLON)
4542 {
4543 ++lexer;
4544 match.hit = true;
4545 }
4546 if (match.hit)
4547 {
4548 statement.Reset(stmt.Release());
4549 statement->SetSpanEnd(span.end);
4550 {
4551 #if (DEBUG)
4552 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"AssignmentStatement");
4553 #endif
4554 return Match(true, statement.Release());
4555 }
4556 }
4557 *parentMatch2 = match;
4558 }
4559 *parentMatch1 = match;
4560 }
4561 *parentMatch0 = match;
4562 }
4563 #if (DEBUG)
4564 if (writeToLog)
4565 {
4566 if (match.hit)
4567 {
4568 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"AssignmentStatement");
4569 }
4570 else
4571 {
4572 System.Lex.WriteFailureToLog(lexer, u"AssignmentStatement");
4573 }
4574 }
4575 #endif
4576 if (!match.hit)
4577 {
4578 match.value = null;
4579 }
4580 return match;
4581 }
4582 public static Match ConstructionStatement(LexerFileLexer& lexer, ParsingContext* ctx)
4583 {
4584 #if (DEBUG)
4585 Span debugSpan;
4586 bool writeToLog = lexer.Log() != null;
4587 if (writeToLog)
4588 {
4589 debugSpan = lexer.GetSpan();
4590 System.Lex.WriteBeginRuleToLog(lexer, u"ConstructionStatement");
4591 }
4592 #endif
4593 UniquePtr<ConstructionStatementNode> constructionStatement;
4594 UniquePtr<Node> type;
4595 UniquePtr<IdentifierNode> id;
4596 UniquePtr<Node> value;
4597 Match match(false);
4598 Match* parentMatch0 = &match;
4599 {
4600 Match match(false);
4601 Match* parentMatch1 = &match;
4602 {
4603 Match match(false);
4604 Match* parentMatch2 = &match;
4605 {
4606 long pos = lexer.GetPos();
4607 Span span = lexer.GetSpan();
4608 Match match(false);
4609 Match* parentMatch3 = &match;
4610 {
4611 Match match(false);
4612 Match* parentMatch4 = &match;
4613 {
4614 Match match = TypeExprParser.TypeExpr(lexer, ctx);
4615 type.Reset(cast<Node*>(match.value));
4616 *parentMatch4 = match;
4617 }
4618 if (match.hit)
4619 {
4620 Match match(false);
4621 Match* parentMatch5 = &match;
4622 {
4623 Match match(true);
4624 Match* parentMatch6 = &match;
4625 {
4626 System.Lex.Span span = lexer.GetSpan();
4627 Match match = IdentifierParser.Identifier(lexer, ctx);
4628 id.Reset(cast<IdentifierNode*>(match.value));
4629 if (match.hit)
4630 {
4631 *parentMatch6 = match;
4632 }
4633 else
4634 {
4635 lexer.ThrowExpectationFailure(span, u"identifier");
4636 }
4637 }
4638 *parentMatch5 = match;
4639 }
4640 *parentMatch4 = match;
4641 }
4642 *parentMatch3 = match;
4643 }
4644 if (match.hit)
4645 {
4646 constructionStatement.Reset(new ConstructionStatementNode(span, ctx->ModuleId(), type.Release(), id.Release()));
4647 }
4648 *parentMatch2 = match;
4649 }
4650 *parentMatch1 = match;
4651 }
4652 if (match.hit)
4653 {
4654 Match match(false);
4655 Match* parentMatch7 = &match;
4656 {
4657 Match match(false);
4658 Match* parentMatch8 = &match;
4659 {
4660 Match match(false);
4661 Match* parentMatch9 = &match;
4662 {
4663 long save = lexer.GetPos();
4664 Match match(false);
4665 Match* parentMatch10 = &match;
4666 {
4667 long save = lexer.GetPos();
4668 Match match(false);
4669 Match* parentMatch11 = &match;
4670 {
4671 Match match(false);
4672 if (*lexer == ASSIGN)
4673 {
4674 ++lexer;
4675 match.hit = true;
4676 }
4677 *parentMatch11 = match;
4678 }
4679 if (match.hit)
4680 {
4681 Match match(false);
4682 Match* parentMatch12 = &match;
4683 {
4684 Match match(false);
4685 Match* parentMatch13 = &match;
4686 {
4687 long pos = lexer.GetPos();
4688 Match match(true);
4689 Match* parentMatch14 = &match;
4690 {
4691 System.Lex.Span span = lexer.GetSpan();
4692 Match match = ExpressionParser.Expression(lexer, ctx);
4693 value.Reset(cast<Node*>(match.value));
4694 if (match.hit)
4695 {
4696 *parentMatch14 = match;
4697 }
4698 else
4699 {
4700 lexer.ThrowExpectationFailure(span, u"expression");
4701 }
4702 }
4703 if (match.hit)
4704 {
4705 constructionStatement->AddArgument(value.Release());
4706 constructionStatement->SetAssignment();
4707 }
4708 *parentMatch13 = match;
4709 }
4710 *parentMatch12 = match;
4711 }
4712 *parentMatch11 = match;
4713 }
4714 *parentMatch10 = match;
4715 if (!match.hit)
4716 {
4717 Match match(false);
4718 Match* parentMatch15 = &match;
4719 lexer.SetPos(save);
4720 {
4721 Match match(false);
4722 Match* parentMatch16 = &match;
4723 {
4724 Match match(false);
4725 Match* parentMatch17 = &match;
4726 {
4727 Match match(false);
4728 if (*lexer == LPAREN)
4729 {
4730 ++lexer;
4731 match.hit = true;
4732 }
4733 *parentMatch17 = match;
4734 }
4735 if (match.hit)
4736 {
4737 Match match(false);
4738 Match* parentMatch18 = &match;
4739 {
4740 Match match = ExpressionParser.ArgumentList(lexer, ctx, constructionStatement.Get());
4741 *parentMatch18 = match;
4742 }
4743 *parentMatch17 = match;
4744 }
4745 *parentMatch16 = match;
4746 }
4747 if (match.hit)
4748 {
4749 Match match(false);
4750 Match* parentMatch19 = &match;
4751 {
4752 Match match(true);
4753 Match* parentMatch20 = &match;
4754 {
4755 System.Lex.Span span = lexer.GetSpan();
4756 Match match(false);
4757 if (*lexer == RPAREN)
4758 {
4759 ++lexer;
4760 match.hit = true;
4761 }
4762 if (match.hit)
4763 {
4764 *parentMatch20 = match;
4765 }
4766 else
4767 {
4768 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
4769 }
4770 }
4771 *parentMatch19 = match;
4772 }
4773 *parentMatch16 = match;
4774 }
4775 *parentMatch15 = match;
4776 }
4777 *parentMatch10 = match;
4778 }
4779 }
4780 *parentMatch9 = match;
4781 if (!match.hit)
4782 {
4783 Match match(false);
4784 Match* parentMatch21 = &match;
4785 lexer.SetPos(save);
4786 {
4787 Match match(false);
4788 Match* parentMatch22 = &match;
4789 {
4790 long pos = lexer.GetPos();
4791 Match match(true);
4792 if (match.hit)
4793 {
4794 constructionStatement->SetEmpty();
4795 }
4796 *parentMatch22 = match;
4797 }
4798 *parentMatch21 = match;
4799 }
4800 *parentMatch9 = match;
4801 }
4802 }
4803 *parentMatch8 = match;
4804 }
4805 *parentMatch7 = match;
4806 }
4807 *parentMatch1 = match;
4808 }
4809 *parentMatch0 = match;
4810 }
4811 if (match.hit)
4812 {
4813 Match match(false);
4814 Match* parentMatch23 = &match;
4815 {
4816 Match match(false);
4817 Match* parentMatch24 = &match;
4818 {
4819 long pos = lexer.GetPos();
4820 Span span = lexer.GetSpan();
4821 Match match(true);
4822 Match* parentMatch25 = &match;
4823 {
4824 System.Lex.Span span = lexer.GetSpan();
4825 Match match(false);
4826 if (*lexer == SEMICOLON)
4827 {
4828 ++lexer;
4829 match.hit = true;
4830 }
4831 if (match.hit)
4832 {
4833 *parentMatch25 = match;
4834 }
4835 else
4836 {
4837 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
4838 }
4839 }
4840 if (match.hit)
4841 {
4842 constructionStatement->SetSpanEnd(span.end);
4843 {
4844 #if (DEBUG)
4845 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConstructionStatement");
4846 #endif
4847 return Match(true, constructionStatement.Release());
4848 }
4849 }
4850 *parentMatch24 = match;
4851 }
4852 *parentMatch23 = match;
4853 }
4854 *parentMatch0 = match;
4855 }
4856 #if (DEBUG)
4857 if (writeToLog)
4858 {
4859 if (match.hit)
4860 {
4861 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConstructionStatement");
4862 }
4863 else
4864 {
4865 System.Lex.WriteFailureToLog(lexer, u"ConstructionStatement");
4866 }
4867 }
4868 #endif
4869 if (!match.hit)
4870 {
4871 match.value = null;
4872 }
4873 return match;
4874 }
4875 public static Match DeleteStatement(LexerFileLexer& lexer, ParsingContext* ctx)
4876 {
4877 #if (DEBUG)
4878 Span debugSpan;
4879 bool writeToLog = lexer.Log() != null;
4880 if (writeToLog)
4881 {
4882 debugSpan = lexer.GetSpan();
4883 System.Lex.WriteBeginRuleToLog(lexer, u"DeleteStatement");
4884 }
4885 #endif
4886 Span s;
4887 UniquePtr<Node> ptr;
4888 Match match(false);
4889 Match* parentMatch0 = &match;
4890 {
4891 Match match(false);
4892 Match* parentMatch1 = &match;
4893 {
4894 Match match(false);
4895 Match* parentMatch2 = &match;
4896 {
4897 long pos = lexer.GetPos();
4898 Span span = lexer.GetSpan();
4899 Match match(false);
4900 if (*lexer == DELETE)
4901 {
4902 ++lexer;
4903 match.hit = true;
4904 }
4905 if (match.hit)
4906 {
4907 s = span;
4908 }
4909 *parentMatch2 = match;
4910 }
4911 *parentMatch1 = match;
4912 }
4913 if (match.hit)
4914 {
4915 Match match(false);
4916 Match* parentMatch3 = &match;
4917 {
4918 Match match(true);
4919 Match* parentMatch4 = &match;
4920 {
4921 System.Lex.Span span = lexer.GetSpan();
4922 Match match = ExpressionParser.Expression(lexer, ctx);
4923 ptr.Reset(cast<Node*>(match.value));
4924 if (match.hit)
4925 {
4926 *parentMatch4 = match;
4927 }
4928 else
4929 {
4930 lexer.ThrowExpectationFailure(span, u"expression");
4931 }
4932 }
4933 *parentMatch3 = match;
4934 }
4935 *parentMatch1 = match;
4936 }
4937 *parentMatch0 = match;
4938 }
4939 if (match.hit)
4940 {
4941 Match match(false);
4942 Match* parentMatch5 = &match;
4943 {
4944 Match match(false);
4945 Match* parentMatch6 = &match;
4946 {
4947 long pos = lexer.GetPos();
4948 Span span = lexer.GetSpan();
4949 Match match(true);
4950 Match* parentMatch7 = &match;
4951 {
4952 System.Lex.Span span = lexer.GetSpan();
4953 Match match(false);
4954 if (*lexer == SEMICOLON)
4955 {
4956 ++lexer;
4957 match.hit = true;
4958 }
4959 if (match.hit)
4960 {
4961 *parentMatch7 = match;
4962 }
4963 else
4964 {
4965 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
4966 }
4967 }
4968 if (match.hit)
4969 {
4970 s.end = span.end;
4971 {
4972 #if (DEBUG)
4973 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DeleteStatement");
4974 #endif
4975 return Match(true, new DeleteStatementNode(s, ctx->ModuleId(), ptr.Release()));
4976 }
4977 }
4978 *parentMatch6 = match;
4979 }
4980 *parentMatch5 = match;
4981 }
4982 *parentMatch0 = match;
4983 }
4984 #if (DEBUG)
4985 if (writeToLog)
4986 {
4987 if (match.hit)
4988 {
4989 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DeleteStatement");
4990 }
4991 else
4992 {
4993 System.Lex.WriteFailureToLog(lexer, u"DeleteStatement");
4994 }
4995 }
4996 #endif
4997 if (!match.hit)
4998 {
4999 match.value = null;
5000 }
5001 return match;
5002 }
5003 public static Match DestroyStatement(LexerFileLexer& lexer, ParsingContext* ctx)
5004 {
5005 #if (DEBUG)
5006 Span debugSpan;
5007 bool writeToLog = lexer.Log() != null;
5008 if (writeToLog)
5009 {
5010 debugSpan = lexer.GetSpan();
5011 System.Lex.WriteBeginRuleToLog(lexer, u"DestroyStatement");
5012 }
5013 #endif
5014 Span s;
5015 UniquePtr<Node> ptr;
5016 Match match(false);
5017 Match* parentMatch0 = &match;
5018 {
5019 Match match(false);
5020 Match* parentMatch1 = &match;
5021 {
5022 Match match(false);
5023 Match* parentMatch2 = &match;
5024 {
5025 long pos = lexer.GetPos();
5026 Span span = lexer.GetSpan();
5027 Match match(false);
5028 if (*lexer == DESTROY)
5029 {
5030 ++lexer;
5031 match.hit = true;
5032 }
5033 if (match.hit)
5034 {
5035 s = span;
5036 }
5037 *parentMatch2 = match;
5038 }
5039 *parentMatch1 = match;
5040 }
5041 if (match.hit)
5042 {
5043 Match match(false);
5044 Match* parentMatch3 = &match;
5045 {
5046 Match match(true);
5047 Match* parentMatch4 = &match;
5048 {
5049 System.Lex.Span span = lexer.GetSpan();
5050 Match match = ExpressionParser.Expression(lexer, ctx);
5051 ptr.Reset(cast<Node*>(match.value));
5052 if (match.hit)
5053 {
5054 *parentMatch4 = match;
5055 }
5056 else
5057 {
5058 lexer.ThrowExpectationFailure(span, u"expression");
5059 }
5060 }
5061 *parentMatch3 = match;
5062 }
5063 *parentMatch1 = match;
5064 }
5065 *parentMatch0 = match;
5066 }
5067 if (match.hit)
5068 {
5069 Match match(false);
5070 Match* parentMatch5 = &match;
5071 {
5072 Match match(false);
5073 Match* parentMatch6 = &match;
5074 {
5075 long pos = lexer.GetPos();
5076 Span span = lexer.GetSpan();
5077 Match match(true);
5078 Match* parentMatch7 = &match;
5079 {
5080 System.Lex.Span span = lexer.GetSpan();
5081 Match match(false);
5082 if (*lexer == SEMICOLON)
5083 {
5084 ++lexer;
5085 match.hit = true;
5086 }
5087 if (match.hit)
5088 {
5089 *parentMatch7 = match;
5090 }
5091 else
5092 {
5093 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
5094 }
5095 }
5096 if (match.hit)
5097 {
5098 s.end = span.end;
5099 {
5100 #if (DEBUG)
5101 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DestroyStatement");
5102 #endif
5103 return Match(true, new DestroyStatementNode(s, ctx->ModuleId(), ptr.Release()));
5104 }
5105 }
5106 *parentMatch6 = match;
5107 }
5108 *parentMatch5 = match;
5109 }
5110 *parentMatch0 = match;
5111 }
5112 #if (DEBUG)
5113 if (writeToLog)
5114 {
5115 if (match.hit)
5116 {
5117 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"DestroyStatement");
5118 }
5119 else
5120 {
5121 System.Lex.WriteFailureToLog(lexer, u"DestroyStatement");
5122 }
5123 }
5124 #endif
5125 if (!match.hit)
5126 {
5127 match.value = null;
5128 }
5129 return match;
5130 }
5131 public static Match ExpressionStatement(LexerFileLexer& lexer, ParsingContext* ctx)
5132 {
5133 #if (DEBUG)
5134 Span debugSpan;
5135 bool writeToLog = lexer.Log() != null;
5136 if (writeToLog)
5137 {
5138 debugSpan = lexer.GetSpan();
5139 System.Lex.WriteBeginRuleToLog(lexer, u"ExpressionStatement");
5140 }
5141 #endif
5142 Span s;
5143 UniquePtr<Node> expr;
5144 Match match(false);
5145 Match* parentMatch0 = &match;
5146 {
5147 Match match(false);
5148 Match* parentMatch1 = &match;
5149 {
5150 long pos = lexer.GetPos();
5151 Match match(true);
5152 if (match.hit)
5153 {
5154 ctx->PushParsingExpressionStatement(true);
5155 }
5156 *parentMatch1 = match;
5157 }
5158 *parentMatch0 = match;
5159 }
5160 if (match.hit)
5161 {
5162 Match match(false);
5163 Match* parentMatch2 = &match;
5164 {
5165 Match match(false);
5166 Match* parentMatch3 = &match;
5167 {
5168 long pos = lexer.GetPos();
5169 Match match(false);
5170 Match* parentMatch4 = &match;
5171 {
5172 Match match(false);
5173 Match* parentMatch5 = &match;
5174 {
5175 Match match(false);
5176 Match* parentMatch6 = &match;
5177 {
5178 long pos = lexer.GetPos();
5179 Span span = lexer.GetSpan();
5180 Match match = ExpressionParser.Expression(lexer, ctx);
5181 expr.Reset(cast<Node*>(match.value));
5182 if (match.hit)
5183 {
5184 s = span;
5185 }
5186 *parentMatch6 = match;
5187 }
5188 *parentMatch5 = match;
5189 }
5190 if (match.hit)
5191 {
5192 Match match(false);
5193 Match* parentMatch7 = &match;
5194 {
5195 Match match(false);
5196 Match* parentMatch8 = &match;
5197 {
5198 long pos = lexer.GetPos();
5199 Span span = lexer.GetSpan();
5200 Match match(false);
5201 if (*lexer == SEMICOLON)
5202 {
5203 ++lexer;
5204 match.hit = true;
5205 }
5206 if (match.hit)
5207 {
5208 s.end = span.end;
5209 }
5210 *parentMatch8 = match;
5211 }
5212 *parentMatch7 = match;
5213 }
5214 *parentMatch5 = match;
5215 }
5216 *parentMatch4 = match;
5217 }
5218 if (match.hit)
5219 {
5220 ctx->PopParsingExpressionStatement();
5221 {
5222 #if (DEBUG)
5223 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ExpressionStatement");
5224 #endif
5225 return Match(true, new ExpressionStatementNode(s, ctx->ModuleId(), expr.Release()));
5226 }
5227 }
5228 else
5229 {
5230 ctx->PopParsingExpressionStatement();
5231 }
5232 *parentMatch3 = match;
5233 }
5234 *parentMatch2 = match;
5235 }
5236 *parentMatch0 = match;
5237 }
5238 #if (DEBUG)
5239 if (writeToLog)
5240 {
5241 if (match.hit)
5242 {
5243 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ExpressionStatement");
5244 }
5245 else
5246 {
5247 System.Lex.WriteFailureToLog(lexer, u"ExpressionStatement");
5248 }
5249 }
5250 #endif
5251 if (!match.hit)
5252 {
5253 match.value = null;
5254 }
5255 return match;
5256 }
5257 public static Match EmptyStatement(LexerFileLexer& lexer, ParsingContext* ctx)
5258 {
5259 #if (DEBUG)
5260 Span debugSpan;
5261 bool writeToLog = lexer.Log() != null;
5262 if (writeToLog)
5263 {
5264 debugSpan = lexer.GetSpan();
5265 System.Lex.WriteBeginRuleToLog(lexer, u"EmptyStatement");
5266 }
5267 #endif
5268 Match match(false);
5269 Match* parentMatch0 = &match;
5270 {
5271 long pos = lexer.GetPos();
5272 Span span = lexer.GetSpan();
5273 Match match(false);
5274 if (*lexer == SEMICOLON)
5275 {
5276 ++lexer;
5277 match.hit = true;
5278 }
5279 if (match.hit)
5280 {
5281 {
5282 #if (DEBUG)
5283 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"EmptyStatement");
5284 #endif
5285 return Match(true, new EmptyStatementNode(span, ctx->ModuleId()));
5286 }
5287 }
5288 *parentMatch0 = match;
5289 }
5290 #if (DEBUG)
5291 if (writeToLog)
5292 {
5293 if (match.hit)
5294 {
5295 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"EmptyStatement");
5296 }
5297 else
5298 {
5299 System.Lex.WriteFailureToLog(lexer, u"EmptyStatement");
5300 }
5301 }
5302 #endif
5303 if (!match.hit)
5304 {
5305 match.value = null;
5306 }
5307 return match;
5308 }
5309 public static Match ThrowStatement(LexerFileLexer& lexer, ParsingContext* ctx)
5310 {
5311 #if (DEBUG)
5312 Span debugSpan;
5313 bool writeToLog = lexer.Log() != null;
5314 if (writeToLog)
5315 {
5316 debugSpan = lexer.GetSpan();
5317 System.Lex.WriteBeginRuleToLog(lexer, u"ThrowStatement");
5318 }
5319 #endif
5320 Span s;
5321 UniquePtr<Node> exception;
5322 Match match(false);
5323 Match* parentMatch0 = &match;
5324 {
5325 Match match(false);
5326 Match* parentMatch1 = &match;
5327 {
5328 Match match(false);
5329 Match* parentMatch2 = &match;
5330 {
5331 long pos = lexer.GetPos();
5332 Span span = lexer.GetSpan();
5333 Match match(false);
5334 if (*lexer == THROW)
5335 {
5336 ++lexer;
5337 match.hit = true;
5338 }
5339 if (match.hit)
5340 {
5341 s = span;
5342 }
5343 *parentMatch2 = match;
5344 }
5345 *parentMatch1 = match;
5346 }
5347 if (match.hit)
5348 {
5349 Match match(false);
5350 Match* parentMatch3 = &match;
5351 {
5352 Match match(true);
5353 long save = lexer.GetPos();
5354 Match* parentMatch4 = &match;
5355 {
5356 Match match = ExpressionParser.Expression(lexer, ctx);
5357 exception.Reset(cast<Node*>(match.value));
5358 if (match.hit)
5359 {
5360 *parentMatch4 = match;
5361 }
5362 else
5363 {
5364 lexer.SetPos(save);
5365 }
5366 }
5367 *parentMatch3 = match;
5368 }
5369 *parentMatch1 = match;
5370 }
5371 *parentMatch0 = match;
5372 }
5373 if (match.hit)
5374 {
5375 Match match(false);
5376 Match* parentMatch5 = &match;
5377 {
5378 Match match(false);
5379 Match* parentMatch6 = &match;
5380 {
5381 long pos = lexer.GetPos();
5382 Span span = lexer.GetSpan();
5383 Match match(true);
5384 Match* parentMatch7 = &match;
5385 {
5386 System.Lex.Span span = lexer.GetSpan();
5387 Match match(false);
5388 if (*lexer == SEMICOLON)
5389 {
5390 ++lexer;
5391 match.hit = true;
5392 }
5393 if (match.hit)
5394 {
5395 *parentMatch7 = match;
5396 }
5397 else
5398 {
5399 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
5400 }
5401 }
5402 if (match.hit)
5403 {
5404 s.end = span.end;
5405 {
5406 #if (DEBUG)
5407 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ThrowStatement");
5408 #endif
5409 return Match(true, new ThrowStatementNode(s, ctx->ModuleId(), exception.Release()));
5410 }
5411 }
5412 *parentMatch6 = match;
5413 }
5414 *parentMatch5 = match;
5415 }
5416 *parentMatch0 = match;
5417 }
5418 #if (DEBUG)
5419 if (writeToLog)
5420 {
5421 if (match.hit)
5422 {
5423 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ThrowStatement");
5424 }
5425 else
5426 {
5427 System.Lex.WriteFailureToLog(lexer, u"ThrowStatement");
5428 }
5429 }
5430 #endif
5431 if (!match.hit)
5432 {
5433 match.value = null;
5434 }
5435 return match;
5436 }
5437 public static Match TryStatement(LexerFileLexer& lexer, ParsingContext* ctx)
5438 {
5439 #if (DEBUG)
5440 Span debugSpan;
5441 bool writeToLog = lexer.Log() != null;
5442 if (writeToLog)
5443 {
5444 debugSpan = lexer.GetSpan();
5445 System.Lex.WriteBeginRuleToLog(lexer, u"TryStatement");
5446 }
5447 #endif
5448 UniquePtr<TryStatementNode> tryStatement;
5449 UniquePtr<CompoundStatementNode> tryBlock;
5450 UniquePtr<CatchNode> ctch;
5451 Match match(false);
5452 Match* parentMatch0 = &match;
5453 {
5454 long pos = lexer.GetPos();
5455 Match match(false);
5456 Match* parentMatch1 = &match;
5457 {
5458 Match match(false);
5459 Match* parentMatch2 = &match;
5460 {
5461 Match match(false);
5462 Match* parentMatch3 = &match;
5463 {
5464 long pos = lexer.GetPos();
5465 Span span = lexer.GetSpan();
5466 Match match(false);
5467 Match* parentMatch4 = &match;
5468 {
5469 Match match(false);
5470 Match* parentMatch5 = &match;
5471 {
5472 Match match(false);
5473 if (*lexer == TRY)
5474 {
5475 ++lexer;
5476 match.hit = true;
5477 }
5478 *parentMatch5 = match;
5479 }
5480 if (match.hit)
5481 {
5482 Match match(false);
5483 Match* parentMatch6 = &match;
5484 {
5485 Match match = StatementParser.CompoundStatement(lexer, ctx);
5486 tryBlock.Reset(cast<CompoundStatementNode*>(match.value));
5487 *parentMatch6 = match;
5488 }
5489 *parentMatch5 = match;
5490 }
5491 *parentMatch4 = match;
5492 }
5493 if (match.hit)
5494 {
5495 tryStatement.Reset(new TryStatementNode(span, ctx->ModuleId(), tryBlock.Release()));
5496 }
5497 *parentMatch3 = match;
5498 }
5499 *parentMatch2 = match;
5500 }
5501 if (match.hit)
5502 {
5503 Match match(false);
5504 Match* parentMatch7 = &match;
5505 {
5506 Match match(false);
5507 Match* parentMatch8 = &match;
5508 {
5509 Match match(false);
5510 Match* parentMatch9 = &match;
5511 {
5512 Match match(false);
5513 Match* parentMatch10 = &match;
5514 {
5515 long pos = lexer.GetPos();
5516 Match match = StatementParser.Catch(lexer, ctx);
5517 ctch.Reset(cast<CatchNode*>(match.value));
5518 if (match.hit)
5519 {
5520 tryStatement->AddCatch(ctch.Release());
5521 }
5522 *parentMatch10 = match;
5523 }
5524 *parentMatch9 = match;
5525 }
5526 *parentMatch8 = match;
5527 }
5528 if (match.hit)
5529 {
5530 Match match(true);
5531 Match* parentMatch11 = &match;
5532 while (true)
5533 {
5534 long save = lexer.GetPos();
5535 {
5536 Match match(false);
5537 Match* parentMatch12 = &match;
5538 {
5539 Match match(false);
5540 Match* parentMatch13 = &match;
5541 {
5542 long pos = lexer.GetPos();
5543 Match match = StatementParser.Catch(lexer, ctx);
5544 ctch.Reset(cast<CatchNode*>(match.value));
5545 if (match.hit)
5546 {
5547 tryStatement->AddCatch(ctch.Release());
5548 }
5549 *parentMatch13 = match;
5550 }
5551 *parentMatch12 = match;
5552 }
5553 if (match.hit)
5554 {
5555 *parentMatch11 = match;
5556 }
5557 else
5558 {
5559 lexer.SetPos(save);
5560 break;
5561 }
5562 }
5563 }
5564 }
5565 *parentMatch7 = match;
5566 }
5567 *parentMatch2 = match;
5568 }
5569 *parentMatch1 = match;
5570 }
5571 if (match.hit)
5572 {
5573 {
5574 #if (DEBUG)
5575 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"TryStatement");
5576 #endif
5577 return Match(true, tryStatement.Release());
5578 }
5579 }
5580 *parentMatch0 = match;
5581 }
5582 #if (DEBUG)
5583 if (writeToLog)
5584 {
5585 if (match.hit)
5586 {
5587 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"TryStatement");
5588 }
5589 else
5590 {
5591 System.Lex.WriteFailureToLog(lexer, u"TryStatement");
5592 }
5593 }
5594 #endif
5595 if (!match.hit)
5596 {
5597 match.value = null;
5598 }
5599 return match;
5600 }
5601 public static Match Catch(LexerFileLexer& lexer, ParsingContext* ctx)
5602 {
5603 #if (DEBUG)
5604 Span debugSpan;
5605 bool writeToLog = lexer.Log() != null;
5606 if (writeToLog)
5607 {
5608 debugSpan = lexer.GetSpan();
5609 System.Lex.WriteBeginRuleToLog(lexer, u"Catch");
5610 }
5611 #endif
5612 Span s;
5613 Span leftParenSpan;
5614 Span rightParenSpan;
5615 UniquePtr<Node> catchType;
5616 UniquePtr<IdentifierNode> catchId;
5617 UniquePtr<CompoundStatementNode> catchBlock;
5618 Match match(false);
5619 Match* parentMatch0 = &match;
5620 {
5621 Match match(false);
5622 Match* parentMatch1 = &match;
5623 {
5624 Match match(false);
5625 Match* parentMatch2 = &match;
5626 {
5627 Match match(false);
5628 Match* parentMatch3 = &match;
5629 {
5630 Match match(false);
5631 Match* parentMatch4 = &match;
5632 {
5633 Match match(false);
5634 Match* parentMatch5 = &match;
5635 {
5636 long pos = lexer.GetPos();
5637 Span span = lexer.GetSpan();
5638 Match match(false);
5639 if (*lexer == CATCH)
5640 {
5641 ++lexer;
5642 match.hit = true;
5643 }
5644 if (match.hit)
5645 {
5646 s = span;
5647 }
5648 *parentMatch5 = match;
5649 }
5650 *parentMatch4 = match;
5651 }
5652 if (match.hit)
5653 {
5654 Match match(false);
5655 Match* parentMatch6 = &match;
5656 {
5657 Match match(false);
5658 Match* parentMatch7 = &match;
5659 {
5660 long pos = lexer.GetPos();
5661 Span span = lexer.GetSpan();
5662 Match match(true);
5663 Match* parentMatch8 = &match;
5664 {
5665 System.Lex.Span span = lexer.GetSpan();
5666 Match match(false);
5667 if (*lexer == LPAREN)
5668 {
5669 ++lexer;
5670 match.hit = true;
5671 }
5672 if (match.hit)
5673 {
5674 *parentMatch8 = match;
5675 }
5676 else
5677 {
5678 lexer.ThrowExpectationFailure(span, GetTokenName(LPAREN));
5679 }
5680 }
5681 if (match.hit)
5682 {
5683 leftParenSpan = span;
5684 }
5685 *parentMatch7 = match;
5686 }
5687 *parentMatch6 = match;
5688 }
5689 *parentMatch4 = match;
5690 }
5691 *parentMatch3 = match;
5692 }
5693 if (match.hit)
5694 {
5695 Match match(false);
5696 Match* parentMatch9 = &match;
5697 {
5698 Match match(true);
5699 Match* parentMatch10 = &match;
5700 {
5701 System.Lex.Span span = lexer.GetSpan();
5702 Match match = TypeExprParser.TypeExpr(lexer, ctx);
5703 catchType.Reset(cast<Node*>(match.value));
5704 if (match.hit)
5705 {
5706 *parentMatch10 = match;
5707 }
5708 else
5709 {
5710 lexer.ThrowExpectationFailure(span, u"type expression");
5711 }
5712 }
5713 *parentMatch9 = match;
5714 }
5715 *parentMatch3 = match;
5716 }
5717 *parentMatch2 = match;
5718 }
5719 if (match.hit)
5720 {
5721 Match match(false);
5722 Match* parentMatch11 = &match;
5723 {
5724 Match match(true);
5725 long save = lexer.GetPos();
5726 Match* parentMatch12 = &match;
5727 {
5728 Match match = IdentifierParser.Identifier(lexer, ctx);
5729 catchId.Reset(cast<IdentifierNode*>(match.value));
5730 if (match.hit)
5731 {
5732 *parentMatch12 = match;
5733 }
5734 else
5735 {
5736 lexer.SetPos(save);
5737 }
5738 }
5739 *parentMatch11 = match;
5740 }
5741 *parentMatch2 = match;
5742 }
5743 *parentMatch1 = match;
5744 }
5745 if (match.hit)
5746 {
5747 Match match(false);
5748 Match* parentMatch13 = &match;
5749 {
5750 Match match(false);
5751 Match* parentMatch14 = &match;
5752 {
5753 long pos = lexer.GetPos();
5754 Span span = lexer.GetSpan();
5755 Match match(true);
5756 Match* parentMatch15 = &match;
5757 {
5758 System.Lex.Span span = lexer.GetSpan();
5759 Match match(false);
5760 if (*lexer == RPAREN)
5761 {
5762 ++lexer;
5763 match.hit = true;
5764 }
5765 if (match.hit)
5766 {
5767 *parentMatch15 = match;
5768 }
5769 else
5770 {
5771 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
5772 }
5773 }
5774 if (match.hit)
5775 {
5776 rightParenSpan = span;
5777 }
5778 *parentMatch14 = match;
5779 }
5780 *parentMatch13 = match;
5781 }
5782 *parentMatch1 = match;
5783 }
5784 *parentMatch0 = match;
5785 }
5786 if (match.hit)
5787 {
5788 Match match(false);
5789 Match* parentMatch16 = &match;
5790 {
5791 Match match(false);
5792 Match* parentMatch17 = &match;
5793 {
5794 long pos = lexer.GetPos();
5795 Span span = lexer.GetSpan();
5796 Match match = StatementParser.CompoundStatement(lexer, ctx);
5797 catchBlock.Reset(cast<CompoundStatementNode*>(match.value));
5798 if (match.hit)
5799 {
5800 s.end = span.end;
5801 CatchNode* value = new CatchNode(s, ctx->ModuleId(), catchType.Release(), catchId.Release(), catchBlock.Release());
5802 value->SetLeftParenSpan(leftParenSpan);
5803 value->SetRightParenSpan(rightParenSpan);
5804 {
5805 #if (DEBUG)
5806 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Catch");
5807 #endif
5808 return Match(true, value);
5809 }
5810 }
5811 *parentMatch17 = match;
5812 }
5813 *parentMatch16 = match;
5814 }
5815 *parentMatch0 = match;
5816 }
5817 #if (DEBUG)
5818 if (writeToLog)
5819 {
5820 if (match.hit)
5821 {
5822 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"Catch");
5823 }
5824 else
5825 {
5826 System.Lex.WriteFailureToLog(lexer, u"Catch");
5827 }
5828 }
5829 #endif
5830 if (!match.hit)
5831 {
5832 match.value = null;
5833 }
5834 return match;
5835 }
5836 public static Match AssertStatement(LexerFileLexer& lexer, ParsingContext* ctx)
5837 {
5838 #if (DEBUG)
5839 Span debugSpan;
5840 bool writeToLog = lexer.Log() != null;
5841 if (writeToLog)
5842 {
5843 debugSpan = lexer.GetSpan();
5844 System.Lex.WriteBeginRuleToLog(lexer, u"AssertStatement");
5845 }
5846 #endif
5847 Span s;
5848 UniquePtr<Node> expr;
5849 Match match(false);
5850 Match* parentMatch0 = &match;
5851 {
5852 Match match(false);
5853 Match* parentMatch1 = &match;
5854 {
5855 Match match(false);
5856 Match* parentMatch2 = &match;
5857 {
5858 Match match(false);
5859 Match* parentMatch3 = &match;
5860 {
5861 long pos = lexer.GetPos();
5862 Span span = lexer.GetSpan();
5863 Match match(false);
5864 if (*lexer == HASH)
5865 {
5866 ++lexer;
5867 match.hit = true;
5868 }
5869 if (match.hit)
5870 {
5871 s = span;
5872 }
5873 *parentMatch3 = match;
5874 }
5875 *parentMatch2 = match;
5876 }
5877 if (match.hit)
5878 {
5879 Match match(false);
5880 Match* parentMatch4 = &match;
5881 {
5882 Match match(false);
5883 if (*lexer == ASSERT)
5884 {
5885 ++lexer;
5886 match.hit = true;
5887 }
5888 *parentMatch4 = match;
5889 }
5890 *parentMatch2 = match;
5891 }
5892 *parentMatch1 = match;
5893 }
5894 if (match.hit)
5895 {
5896 Match match(false);
5897 Match* parentMatch5 = &match;
5898 {
5899 Match match(true);
5900 Match* parentMatch6 = &match;
5901 {
5902 System.Lex.Span span = lexer.GetSpan();
5903 Match match = ExpressionParser.Expression(lexer, ctx);
5904 expr.Reset(cast<Node*>(match.value));
5905 if (match.hit)
5906 {
5907 *parentMatch6 = match;
5908 }
5909 else
5910 {
5911 lexer.ThrowExpectationFailure(span, u"expression");
5912 }
5913 }
5914 *parentMatch5 = match;
5915 }
5916 *parentMatch1 = match;
5917 }
5918 *parentMatch0 = match;
5919 }
5920 if (match.hit)
5921 {
5922 Match match(false);
5923 Match* parentMatch7 = &match;
5924 {
5925 Match match(false);
5926 Match* parentMatch8 = &match;
5927 {
5928 long pos = lexer.GetPos();
5929 Span span = lexer.GetSpan();
5930 Match match(true);
5931 Match* parentMatch9 = &match;
5932 {
5933 System.Lex.Span span = lexer.GetSpan();
5934 Match match(false);
5935 if (*lexer == SEMICOLON)
5936 {
5937 ++lexer;
5938 match.hit = true;
5939 }
5940 if (match.hit)
5941 {
5942 *parentMatch9 = match;
5943 }
5944 else
5945 {
5946 lexer.ThrowExpectationFailure(span, GetTokenName(SEMICOLON));
5947 }
5948 }
5949 if (match.hit)
5950 {
5951 s.end = span.end;
5952 {
5953 #if (DEBUG)
5954 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"AssertStatement");
5955 #endif
5956 return Match(true, new AssertStatementNode(s, ctx->ModuleId(), expr.Release()));
5957 }
5958 }
5959 *parentMatch8 = match;
5960 }
5961 *parentMatch7 = match;
5962 }
5963 *parentMatch0 = match;
5964 }
5965 #if (DEBUG)
5966 if (writeToLog)
5967 {
5968 if (match.hit)
5969 {
5970 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"AssertStatement");
5971 }
5972 else
5973 {
5974 System.Lex.WriteFailureToLog(lexer, u"AssertStatement");
5975 }
5976 }
5977 #endif
5978 if (!match.hit)
5979 {
5980 match.value = null;
5981 }
5982 return match;
5983 }
5984 public static Match ConditionalCompilationStatement(LexerFileLexer& lexer, ParsingContext* ctx)
5985 {
5986 #if (DEBUG)
5987 Span debugSpan;
5988 bool writeToLog = lexer.Log() != null;
5989 if (writeToLog)
5990 {
5991 debugSpan = lexer.GetSpan();
5992 System.Lex.WriteBeginRuleToLog(lexer, u"ConditionalCompilationStatement");
5993 }
5994 #endif
5995 UniquePtr<ConditionalCompilationStatementNode> condCompStmt;
5996 Span s;
5997 Span keywordSpan;
5998 Span leftParenSpan;
5999 Span rightParenSpan;
6000 UniquePtr<ConditionalCompilationExpressionNode> ifExpr;
6001 UniquePtr<StatementNode> ifS;
6002 UniquePtr<ConditionalCompilationExpressionNode> elifExpr;
6003 UniquePtr<StatementNode> elifS;
6004 UniquePtr<StatementNode> elseS;
6005 Match match(false);
6006 Match* parentMatch0 = &match;
6007 {
6008 Match match(false);
6009 Match* parentMatch1 = &match;
6010 {
6011 Match match(false);
6012 Match* parentMatch2 = &match;
6013 {
6014 Match match(false);
6015 Match* parentMatch3 = &match;
6016 {
6017 Match match(false);
6018 Match* parentMatch4 = &match;
6019 {
6020 Match match(false);
6021 Match* parentMatch5 = &match;
6022 {
6023 Match match(false);
6024 Match* parentMatch6 = &match;
6025 {
6026 Match match(false);
6027 Match* parentMatch7 = &match;
6028 {
6029 Match match(false);
6030 Match* parentMatch8 = &match;
6031 {
6032 Match match(false);
6033 Match* parentMatch9 = &match;
6034 {
6035 long pos = lexer.GetPos();
6036 Span span = lexer.GetSpan();
6037 Match match(false);
6038 if (*lexer == HASH)
6039 {
6040 ++lexer;
6041 match.hit = true;
6042 }
6043 if (match.hit)
6044 {
6045 s = span;
6046 keywordSpan = span;
6047 }
6048 *parentMatch9 = match;
6049 }
6050 *parentMatch8 = match;
6051 }
6052 if (match.hit)
6053 {
6054 Match match(false);
6055 Match* parentMatch10 = &match;
6056 {
6057 Match match(false);
6058 Match* parentMatch11 = &match;
6059 {
6060 long pos = lexer.GetPos();
6061 Span span = lexer.GetSpan();
6062 Match match(false);
6063 if (*lexer == IF)
6064 {
6065 ++lexer;
6066 match.hit = true;
6067 }
6068 if (match.hit)
6069 {
6070 keywordSpan.end = span.end;
6071 }
6072 *parentMatch11 = match;
6073 }
6074 *parentMatch10 = match;
6075 }
6076 *parentMatch8 = match;
6077 }
6078 *parentMatch7 = match;
6079 }
6080 if (match.hit)
6081 {
6082 Match match(false);
6083 Match* parentMatch12 = &match;
6084 {
6085 Match match(false);
6086 Match* parentMatch13 = &match;
6087 {
6088 long pos = lexer.GetPos();
6089 Span span = lexer.GetSpan();
6090 Match match(true);
6091 Match* parentMatch14 = &match;
6092 {
6093 System.Lex.Span span = lexer.GetSpan();
6094 Match match(false);
6095 if (*lexer == LPAREN)
6096 {
6097 ++lexer;
6098 match.hit = true;
6099 }
6100 if (match.hit)
6101 {
6102 *parentMatch14 = match;
6103 }
6104 else
6105 {
6106 lexer.ThrowExpectationFailure(span, GetTokenName(LPAREN));
6107 }
6108 }
6109 if (match.hit)
6110 {
6111 leftParenSpan = span;
6112 }
6113 *parentMatch13 = match;
6114 }
6115 *parentMatch12 = match;
6116 }
6117 *parentMatch7 = match;
6118 }
6119 *parentMatch6 = match;
6120 }
6121 if (match.hit)
6122 {
6123 Match match(false);
6124 Match* parentMatch15 = &match;
6125 {
6126 Match match(false);
6127 Match* parentMatch16 = &match;
6128 {
6129 long pos = lexer.GetPos();
6130 Span span = lexer.GetSpan();
6131 Match match = StatementParser.ConditionalCompilationExpression(lexer, ctx);
6132 ifExpr.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
6133 if (match.hit)
6134 {
6135 s.end = span.end;
6136 condCompStmt.Reset(new ConditionalCompilationStatementNode(s, ctx->ModuleId(), ifExpr.Release()));
6137 condCompStmt->IfPart()->SetKeywordSpan(keywordSpan);
6138 }
6139 *parentMatch16 = match;
6140 }
6141 *parentMatch15 = match;
6142 }
6143 *parentMatch6 = match;
6144 }
6145 *parentMatch5 = match;
6146 }
6147 if (match.hit)
6148 {
6149 Match match(false);
6150 Match* parentMatch17 = &match;
6151 {
6152 Match match(false);
6153 Match* parentMatch18 = &match;
6154 {
6155 long pos = lexer.GetPos();
6156 Span span = lexer.GetSpan();
6157 Match match(true);
6158 Match* parentMatch19 = &match;
6159 {
6160 System.Lex.Span span = lexer.GetSpan();
6161 Match match(false);
6162 if (*lexer == RPAREN)
6163 {
6164 ++lexer;
6165 match.hit = true;
6166 }
6167 if (match.hit)
6168 {
6169 *parentMatch19 = match;
6170 }
6171 else
6172 {
6173 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
6174 }
6175 }
6176 if (match.hit)
6177 {
6178 rightParenSpan = span;
6179 condCompStmt->IfPart()->SetLeftParenSpan(leftParenSpan);
6180 condCompStmt->IfPart()->SetRightParenSpan(rightParenSpan);
6181 }
6182 *parentMatch18 = match;
6183 }
6184 *parentMatch17 = match;
6185 }
6186 *parentMatch5 = match;
6187 }
6188 *parentMatch4 = match;
6189 }
6190 if (match.hit)
6191 {
6192 Match match(false);
6193 Match* parentMatch20 = &match;
6194 {
6195 Match match(true);
6196 Match* parentMatch21 = &match;
6197 {
6198 while (true)
6199 {
6200 long save = lexer.GetPos();
6201 {
6202 Match match(false);
6203 Match* parentMatch22 = &match;
6204 {
6205 Match match(false);
6206 Match* parentMatch23 = &match;
6207 {
6208 long pos = lexer.GetPos();
6209 Match match = StatementParser.Statement(lexer, ctx);
6210 ifS.Reset(cast<StatementNode*>(match.value));
6211 if (match.hit)
6212 {
6213 condCompStmt->AddIfStatement(ifS.Release());
6214 }
6215 *parentMatch23 = match;
6216 }
6217 *parentMatch22 = match;
6218 }
6219 if (match.hit)
6220 {
6221 *parentMatch21 = match;
6222 }
6223 else
6224 {
6225 lexer.SetPos(save);
6226 break;
6227 }
6228 }
6229 }
6230 }
6231 *parentMatch20 = match;
6232 }
6233 *parentMatch4 = match;
6234 }
6235 *parentMatch3 = match;
6236 }
6237 if (match.hit)
6238 {
6239 Match match(false);
6240 Match* parentMatch24 = &match;
6241 {
6242 Match match(true);
6243 Match* parentMatch25 = &match;
6244 {
6245 while (true)
6246 {
6247 long save = lexer.GetPos();
6248 {
6249 Match match(false);
6250 Match* parentMatch26 = &match;
6251 {
6252 Match match(false);
6253 Match* parentMatch27 = &match;
6254 {
6255 Match match(false);
6256 Match* parentMatch28 = &match;
6257 {
6258 Match match(false);
6259 Match* parentMatch29 = &match;
6260 {
6261 Match match(false);
6262 Match* parentMatch30 = &match;
6263 {
6264 Match match(false);
6265 Match* parentMatch31 = &match;
6266 {
6267 Match match(false);
6268 Match* parentMatch32 = &match;
6269 {
6270 long pos = lexer.GetPos();
6271 Span span = lexer.GetSpan();
6272 Match match(false);
6273 if (*lexer == HASH)
6274 {
6275 ++lexer;
6276 match.hit = true;
6277 }
6278 if (match.hit)
6279 {
6280 keywordSpan = span;
6281 }
6282 *parentMatch32 = match;
6283 }
6284 *parentMatch31 = match;
6285 }
6286 if (match.hit)
6287 {
6288 Match match(false);
6289 Match* parentMatch33 = &match;
6290 {
6291 Match match(false);
6292 Match* parentMatch34 = &match;
6293 {
6294 long pos = lexer.GetPos();
6295 Span span = lexer.GetSpan();
6296 Match match(false);
6297 if (*lexer == ELIF)
6298 {
6299 ++lexer;
6300 match.hit = true;
6301 }
6302 if (match.hit)
6303 {
6304 keywordSpan.end = span.end;
6305 }
6306 *parentMatch34 = match;
6307 }
6308 *parentMatch33 = match;
6309 }
6310 *parentMatch31 = match;
6311 }
6312 *parentMatch30 = match;
6313 }
6314 if (match.hit)
6315 {
6316 Match match(false);
6317 Match* parentMatch35 = &match;
6318 {
6319 Match match(false);
6320 Match* parentMatch36 = &match;
6321 {
6322 long pos = lexer.GetPos();
6323 Span span = lexer.GetSpan();
6324 Match match(true);
6325 Match* parentMatch37 = &match;
6326 {
6327 System.Lex.Span span = lexer.GetSpan();
6328 Match match(false);
6329 if (*lexer == LPAREN)
6330 {
6331 ++lexer;
6332 match.hit = true;
6333 }
6334 if (match.hit)
6335 {
6336 *parentMatch37 = match;
6337 }
6338 else
6339 {
6340 lexer.ThrowExpectationFailure(span, GetTokenName(LPAREN));
6341 }
6342 }
6343 if (match.hit)
6344 {
6345 leftParenSpan = span;
6346 }
6347 *parentMatch36 = match;
6348 }
6349 *parentMatch35 = match;
6350 }
6351 *parentMatch30 = match;
6352 }
6353 *parentMatch29 = match;
6354 }
6355 if (match.hit)
6356 {
6357 Match match(false);
6358 Match* parentMatch38 = &match;
6359 {
6360 Match match(false);
6361 Match* parentMatch39 = &match;
6362 {
6363 long pos = lexer.GetPos();
6364 Span span = lexer.GetSpan();
6365 Match match = StatementParser.ConditionalCompilationExpression(lexer, ctx);
6366 elifExpr.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
6367 if (match.hit)
6368 {
6369 condCompStmt->AddElifExpr(span, ctx->ModuleId(), elifExpr.Release());
6370 }
6371 *parentMatch39 = match;
6372 }
6373 *parentMatch38 = match;
6374 }
6375 *parentMatch29 = match;
6376 }
6377 *parentMatch28 = match;
6378 }
6379 if (match.hit)
6380 {
6381 Match match(false);
6382 Match* parentMatch40 = &match;
6383 {
6384 Match match(false);
6385 Match* parentMatch41 = &match;
6386 {
6387 long pos = lexer.GetPos();
6388 Span span = lexer.GetSpan();
6389 Match match(true);
6390 Match* parentMatch42 = &match;
6391 {
6392 System.Lex.Span span = lexer.GetSpan();
6393 Match match(false);
6394 if (*lexer == RPAREN)
6395 {
6396 ++lexer;
6397 match.hit = true;
6398 }
6399 if (match.hit)
6400 {
6401 *parentMatch42 = match;
6402 }
6403 else
6404 {
6405 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
6406 }
6407 }
6408 if (match.hit)
6409 {
6410 rightParenSpan = span;
6411 condCompStmt->SetElifLeftParenSpan(leftParenSpan);
6412 condCompStmt->SetElifRightParenSpan(rightParenSpan);
6413 condCompStmt->SetElifKeywordSpan(keywordSpan);
6414 }
6415 *parentMatch41 = match;
6416 }
6417 *parentMatch40 = match;
6418 }
6419 *parentMatch28 = match;
6420 }
6421 *parentMatch27 = match;
6422 }
6423 if (match.hit)
6424 {
6425 Match match(false);
6426 Match* parentMatch43 = &match;
6427 {
6428 Match match(true);
6429 Match* parentMatch44 = &match;
6430 {
6431 while (true)
6432 {
6433 long save = lexer.GetPos();
6434 {
6435 Match match(false);
6436 Match* parentMatch45 = &match;
6437 {
6438 Match match(false);
6439 Match* parentMatch46 = &match;
6440 {
6441 long pos = lexer.GetPos();
6442 Match match = StatementParser.Statement(lexer, ctx);
6443 elifS.Reset(cast<StatementNode*>(match.value));
6444 if (match.hit)
6445 {
6446 condCompStmt->AddElifStatement(elifS.Release());
6447 }
6448 *parentMatch46 = match;
6449 }
6450 *parentMatch45 = match;
6451 }
6452 if (match.hit)
6453 {
6454 *parentMatch44 = match;
6455 }
6456 else
6457 {
6458 lexer.SetPos(save);
6459 break;
6460 }
6461 }
6462 }
6463 }
6464 *parentMatch43 = match;
6465 }
6466 *parentMatch27 = match;
6467 }
6468 *parentMatch26 = match;
6469 }
6470 if (match.hit)
6471 {
6472 *parentMatch25 = match;
6473 }
6474 else
6475 {
6476 lexer.SetPos(save);
6477 break;
6478 }
6479 }
6480 }
6481 }
6482 *parentMatch24 = match;
6483 }
6484 *parentMatch3 = match;
6485 }
6486 *parentMatch2 = match;
6487 }
6488 if (match.hit)
6489 {
6490 Match match(false);
6491 Match* parentMatch47 = &match;
6492 {
6493 Match match(true);
6494 long save = lexer.GetPos();
6495 Match* parentMatch48 = &match;
6496 {
6497 Match match(false);
6498 Match* parentMatch49 = &match;
6499 {
6500 Match match(false);
6501 Match* parentMatch50 = &match;
6502 {
6503 Match match(false);
6504 Match* parentMatch51 = &match;
6505 {
6506 Match match(false);
6507 Match* parentMatch52 = &match;
6508 {
6509 Match match(false);
6510 Match* parentMatch53 = &match;
6511 {
6512 long pos = lexer.GetPos();
6513 Span span = lexer.GetSpan();
6514 Match match(false);
6515 if (*lexer == HASH)
6516 {
6517 ++lexer;
6518 match.hit = true;
6519 }
6520 if (match.hit)
6521 {
6522 keywordSpan = span;
6523 }
6524 *parentMatch53 = match;
6525 }
6526 *parentMatch52 = match;
6527 }
6528 if (match.hit)
6529 {
6530 Match match(false);
6531 Match* parentMatch54 = &match;
6532 {
6533 Match match(false);
6534 if (*lexer == ELSE)
6535 {
6536 ++lexer;
6537 match.hit = true;
6538 }
6539 *parentMatch54 = match;
6540 }
6541 *parentMatch52 = match;
6542 }
6543 *parentMatch51 = match;
6544 }
6545 if (match.hit)
6546 {
6547 Match match(false);
6548 Match* parentMatch55 = &match;
6549 {
6550 Match match(true);
6551 Match* parentMatch56 = &match;
6552 {
6553 while (true)
6554 {
6555 long save = lexer.GetPos();
6556 {
6557 Match match(false);
6558 Match* parentMatch57 = &match;
6559 {
6560 Match match(false);
6561 Match* parentMatch58 = &match;
6562 {
6563 long pos = lexer.GetPos();
6564 Span span = lexer.GetSpan();
6565 Match match = StatementParser.Statement(lexer, ctx);
6566 elseS.Reset(cast<StatementNode*>(match.value));
6567 if (match.hit)
6568 {
6569 condCompStmt->AddElseStatement(span, ctx->ModuleId(), elseS.Release());
6570 }
6571 *parentMatch58 = match;
6572 }
6573 *parentMatch57 = match;
6574 }
6575 if (match.hit)
6576 {
6577 *parentMatch56 = match;
6578 }
6579 else
6580 {
6581 lexer.SetPos(save);
6582 break;
6583 }
6584 }
6585 }
6586 }
6587 *parentMatch55 = match;
6588 }
6589 *parentMatch51 = match;
6590 }
6591 *parentMatch50 = match;
6592 }
6593 if (match.hit)
6594 {
6595 Match match(false);
6596 Match* parentMatch59 = &match;
6597 {
6598 Match match(false);
6599 Match* parentMatch60 = &match;
6600 {
6601 long pos = lexer.GetPos();
6602 Match match(true);
6603 if (match.hit)
6604 {
6605 condCompStmt->ElsePart()->SetKeywordSpan(keywordSpan);
6606 }
6607 *parentMatch60 = match;
6608 }
6609 *parentMatch59 = match;
6610 }
6611 *parentMatch50 = match;
6612 }
6613 *parentMatch49 = match;
6614 }
6615 if (match.hit)
6616 {
6617 *parentMatch48 = match;
6618 }
6619 else
6620 {
6621 lexer.SetPos(save);
6622 }
6623 }
6624 *parentMatch47 = match;
6625 }
6626 *parentMatch2 = match;
6627 }
6628 *parentMatch1 = match;
6629 }
6630 if (match.hit)
6631 {
6632 Match match(false);
6633 Match* parentMatch61 = &match;
6634 {
6635 Match match(false);
6636 Match* parentMatch62 = &match;
6637 {
6638 long pos = lexer.GetPos();
6639 Span span = lexer.GetSpan();
6640 Match match(false);
6641 if (*lexer == HASH)
6642 {
6643 ++lexer;
6644 match.hit = true;
6645 }
6646 if (match.hit)
6647 {
6648 keywordSpan = span;
6649 }
6650 *parentMatch62 = match;
6651 }
6652 *parentMatch61 = match;
6653 }
6654 *parentMatch1 = match;
6655 }
6656 *parentMatch0 = match;
6657 }
6658 if (match.hit)
6659 {
6660 Match match(false);
6661 Match* parentMatch63 = &match;
6662 {
6663 Match match(false);
6664 Match* parentMatch64 = &match;
6665 {
6666 long pos = lexer.GetPos();
6667 Span span = lexer.GetSpan();
6668 Match match(true);
6669 Match* parentMatch65 = &match;
6670 {
6671 System.Lex.Span span = lexer.GetSpan();
6672 Match match(false);
6673 if (*lexer == ENDIF)
6674 {
6675 ++lexer;
6676 match.hit = true;
6677 }
6678 if (match.hit)
6679 {
6680 *parentMatch65 = match;
6681 }
6682 else
6683 {
6684 lexer.ThrowExpectationFailure(span, GetTokenName(ENDIF));
6685 }
6686 }
6687 if (match.hit)
6688 {
6689 keywordSpan.end = span.end;
6690 condCompStmt->SetEndIfSpan(keywordSpan);
6691 {
6692 #if (DEBUG)
6693 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationStatement");
6694 #endif
6695 return Match(true, condCompStmt.Release());
6696 }
6697 }
6698 *parentMatch64 = match;
6699 }
6700 *parentMatch63 = match;
6701 }
6702 *parentMatch0 = match;
6703 }
6704 #if (DEBUG)
6705 if (writeToLog)
6706 {
6707 if (match.hit)
6708 {
6709 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationStatement");
6710 }
6711 else
6712 {
6713 System.Lex.WriteFailureToLog(lexer, u"ConditionalCompilationStatement");
6714 }
6715 }
6716 #endif
6717 if (!match.hit)
6718 {
6719 match.value = null;
6720 }
6721 return match;
6722 }
6723 public static Match ConditionalCompilationExpression(LexerFileLexer& lexer, ParsingContext* ctx)
6724 {
6725 #if (DEBUG)
6726 Span debugSpan;
6727 bool writeToLog = lexer.Log() != null;
6728 if (writeToLog)
6729 {
6730 debugSpan = lexer.GetSpan();
6731 System.Lex.WriteBeginRuleToLog(lexer, u"ConditionalCompilationExpression");
6732 }
6733 #endif
6734 UniquePtr<ConditionalCompilationExpressionNode> disjunction;
6735 Match match(false);
6736 Match* parentMatch0 = &match;
6737 {
6738 long pos = lexer.GetPos();
6739 Match match = StatementParser.ConditionalCompilationDisjunction(lexer, ctx);
6740 disjunction.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
6741 if (match.hit)
6742 {
6743 {
6744 #if (DEBUG)
6745 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationExpression");
6746 #endif
6747 return Match(true, disjunction.Release());
6748 }
6749 }
6750 *parentMatch0 = match;
6751 }
6752 #if (DEBUG)
6753 if (writeToLog)
6754 {
6755 if (match.hit)
6756 {
6757 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationExpression");
6758 }
6759 else
6760 {
6761 System.Lex.WriteFailureToLog(lexer, u"ConditionalCompilationExpression");
6762 }
6763 }
6764 #endif
6765 if (!match.hit)
6766 {
6767 match.value = null;
6768 }
6769 return match;
6770 }
6771 public static Match ConditionalCompilationDisjunction(LexerFileLexer& lexer, ParsingContext* ctx)
6772 {
6773 #if (DEBUG)
6774 Span debugSpan;
6775 bool writeToLog = lexer.Log() != null;
6776 if (writeToLog)
6777 {
6778 debugSpan = lexer.GetSpan();
6779 System.Lex.WriteBeginRuleToLog(lexer, u"ConditionalCompilationDisjunction");
6780 }
6781 #endif
6782 Span s;
6783 UniquePtr<ConditionalCompilationExpressionNode> condCompExpr;
6784 UniquePtr<ConditionalCompilationExpressionNode> left;
6785 UniquePtr<ConditionalCompilationExpressionNode> right;
6786 Match match(false);
6787 Match* parentMatch0 = &match;
6788 {
6789 long pos = lexer.GetPos();
6790 Match match(false);
6791 Match* parentMatch1 = &match;
6792 {
6793 Match match(false);
6794 Match* parentMatch2 = &match;
6795 {
6796 Match match(false);
6797 Match* parentMatch3 = &match;
6798 {
6799 long pos = lexer.GetPos();
6800 Span span = lexer.GetSpan();
6801 Match match = StatementParser.ConditionalCompilationConjunction(lexer, ctx);
6802 left.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
6803 if (match.hit)
6804 {
6805 s = span;
6806 condCompExpr.Reset(left.Release());
6807 }
6808 *parentMatch3 = match;
6809 }
6810 *parentMatch2 = match;
6811 }
6812 if (match.hit)
6813 {
6814 Match match(false);
6815 Match* parentMatch4 = &match;
6816 {
6817 Match match(true);
6818 Match* parentMatch5 = &match;
6819 {
6820 while (true)
6821 {
6822 long save = lexer.GetPos();
6823 {
6824 Match match(false);
6825 Match* parentMatch6 = &match;
6826 {
6827 Match match(false);
6828 Match* parentMatch7 = &match;
6829 {
6830 Match match(false);
6831 if (*lexer == DISJUNCTION)
6832 {
6833 ++lexer;
6834 match.hit = true;
6835 }
6836 *parentMatch7 = match;
6837 }
6838 if (match.hit)
6839 {
6840 Match match(false);
6841 Match* parentMatch8 = &match;
6842 {
6843 Match match(false);
6844 Match* parentMatch9 = &match;
6845 {
6846 long pos = lexer.GetPos();
6847 Span span = lexer.GetSpan();
6848 Match match = StatementParser.ConditionalCompilationConjunction(lexer, ctx);
6849 right.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
6850 if (match.hit)
6851 {
6852 s.end = span.end;
6853 condCompExpr.Reset(new ConditionalCompilationDisjunctionNode(s, ctx->ModuleId(), condCompExpr.Release(), right.Release()));
6854 }
6855 *parentMatch9 = match;
6856 }
6857 *parentMatch8 = match;
6858 }
6859 *parentMatch7 = match;
6860 }
6861 *parentMatch6 = match;
6862 }
6863 if (match.hit)
6864 {
6865 *parentMatch5 = match;
6866 }
6867 else
6868 {
6869 lexer.SetPos(save);
6870 break;
6871 }
6872 }
6873 }
6874 }
6875 *parentMatch4 = match;
6876 }
6877 *parentMatch2 = match;
6878 }
6879 *parentMatch1 = match;
6880 }
6881 if (match.hit)
6882 {
6883 {
6884 #if (DEBUG)
6885 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationDisjunction");
6886 #endif
6887 return Match(true, condCompExpr.Release());
6888 }
6889 }
6890 *parentMatch0 = match;
6891 }
6892 #if (DEBUG)
6893 if (writeToLog)
6894 {
6895 if (match.hit)
6896 {
6897 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationDisjunction");
6898 }
6899 else
6900 {
6901 System.Lex.WriteFailureToLog(lexer, u"ConditionalCompilationDisjunction");
6902 }
6903 }
6904 #endif
6905 if (!match.hit)
6906 {
6907 match.value = null;
6908 }
6909 return match;
6910 }
6911 public static Match ConditionalCompilationConjunction(LexerFileLexer& lexer, ParsingContext* ctx)
6912 {
6913 #if (DEBUG)
6914 Span debugSpan;
6915 bool writeToLog = lexer.Log() != null;
6916 if (writeToLog)
6917 {
6918 debugSpan = lexer.GetSpan();
6919 System.Lex.WriteBeginRuleToLog(lexer, u"ConditionalCompilationConjunction");
6920 }
6921 #endif
6922 Span s;
6923 UniquePtr<ConditionalCompilationExpressionNode> condCompExpr;
6924 UniquePtr<ConditionalCompilationExpressionNode> left;
6925 UniquePtr<ConditionalCompilationExpressionNode> right;
6926 Match match(false);
6927 Match* parentMatch0 = &match;
6928 {
6929 long pos = lexer.GetPos();
6930 Match match(false);
6931 Match* parentMatch1 = &match;
6932 {
6933 Match match(false);
6934 Match* parentMatch2 = &match;
6935 {
6936 Match match(false);
6937 Match* parentMatch3 = &match;
6938 {
6939 long pos = lexer.GetPos();
6940 Span span = lexer.GetSpan();
6941 Match match = StatementParser.ConditionalCompilationPrefix(lexer, ctx);
6942 left.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
6943 if (match.hit)
6944 {
6945 s = span;
6946 condCompExpr.Reset(left.Release());
6947 }
6948 *parentMatch3 = match;
6949 }
6950 *parentMatch2 = match;
6951 }
6952 if (match.hit)
6953 {
6954 Match match(false);
6955 Match* parentMatch4 = &match;
6956 {
6957 Match match(true);
6958 Match* parentMatch5 = &match;
6959 {
6960 while (true)
6961 {
6962 long save = lexer.GetPos();
6963 {
6964 Match match(false);
6965 Match* parentMatch6 = &match;
6966 {
6967 Match match(false);
6968 Match* parentMatch7 = &match;
6969 {
6970 Match match(false);
6971 if (*lexer == AMPAMP)
6972 {
6973 ++lexer;
6974 match.hit = true;
6975 }
6976 *parentMatch7 = match;
6977 }
6978 if (match.hit)
6979 {
6980 Match match(false);
6981 Match* parentMatch8 = &match;
6982 {
6983 Match match(false);
6984 Match* parentMatch9 = &match;
6985 {
6986 long pos = lexer.GetPos();
6987 Span span = lexer.GetSpan();
6988 Match match = StatementParser.ConditionalCompilationPrefix(lexer, ctx);
6989 right.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
6990 if (match.hit)
6991 {
6992 s.end = span.end;
6993 condCompExpr.Reset(new ConditionalCompilationConjunctionNode(s, ctx->ModuleId(), condCompExpr.Release(), right.Release()));
6994 }
6995 *parentMatch9 = match;
6996 }
6997 *parentMatch8 = match;
6998 }
6999 *parentMatch7 = match;
7000 }
7001 *parentMatch6 = match;
7002 }
7003 if (match.hit)
7004 {
7005 *parentMatch5 = match;
7006 }
7007 else
7008 {
7009 lexer.SetPos(save);
7010 break;
7011 }
7012 }
7013 }
7014 }
7015 *parentMatch4 = match;
7016 }
7017 *parentMatch2 = match;
7018 }
7019 *parentMatch1 = match;
7020 }
7021 if (match.hit)
7022 {
7023 {
7024 #if (DEBUG)
7025 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationConjunction");
7026 #endif
7027 return Match(true, condCompExpr.Release());
7028 }
7029 }
7030 *parentMatch0 = match;
7031 }
7032 #if (DEBUG)
7033 if (writeToLog)
7034 {
7035 if (match.hit)
7036 {
7037 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationConjunction");
7038 }
7039 else
7040 {
7041 System.Lex.WriteFailureToLog(lexer, u"ConditionalCompilationConjunction");
7042 }
7043 }
7044 #endif
7045 if (!match.hit)
7046 {
7047 match.value = null;
7048 }
7049 return match;
7050 }
7051 public static Match ConditionalCompilationPrefix(LexerFileLexer& lexer, ParsingContext* ctx)
7052 {
7053 #if (DEBUG)
7054 Span debugSpan;
7055 bool writeToLog = lexer.Log() != null;
7056 if (writeToLog)
7057 {
7058 debugSpan = lexer.GetSpan();
7059 System.Lex.WriteBeginRuleToLog(lexer, u"ConditionalCompilationPrefix");
7060 }
7061 #endif
7062 Span s;
7063 UniquePtr<ConditionalCompilationExpressionNode> condCompExpr;
7064 UniquePtr<ConditionalCompilationExpressionNode> prefix;
7065 UniquePtr<ConditionalCompilationExpressionNode> primary;
7066 Match match(false);
7067 Match* parentMatch0 = &match;
7068 {
7069 long pos = lexer.GetPos();
7070 Match match(false);
7071 Match* parentMatch1 = &match;
7072 {
7073 Match match(false);
7074 Match* parentMatch2 = &match;
7075 {
7076 long save = lexer.GetPos();
7077 Match match(false);
7078 Match* parentMatch3 = &match;
7079 {
7080 Match match(false);
7081 Match* parentMatch4 = &match;
7082 {
7083 long pos = lexer.GetPos();
7084 Span span = lexer.GetSpan();
7085 Match match(false);
7086 if (*lexer == EXCLAMATION)
7087 {
7088 ++lexer;
7089 match.hit = true;
7090 }
7091 if (match.hit)
7092 {
7093 s = span;
7094 }
7095 *parentMatch4 = match;
7096 }
7097 *parentMatch3 = match;
7098 }
7099 if (match.hit)
7100 {
7101 Match match(false);
7102 Match* parentMatch5 = &match;
7103 {
7104 Match match(false);
7105 Match* parentMatch6 = &match;
7106 {
7107 long pos = lexer.GetPos();
7108 Span span = lexer.GetSpan();
7109 Match match = StatementParser.ConditionalCompilationPrefix(lexer, ctx);
7110 prefix.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
7111 if (match.hit)
7112 {
7113 s.end = span.end;
7114 condCompExpr.Reset(new ConditionalCompilationNotNode(s, ctx->ModuleId(), prefix.Release()));
7115 }
7116 *parentMatch6 = match;
7117 }
7118 *parentMatch5 = match;
7119 }
7120 *parentMatch3 = match;
7121 }
7122 *parentMatch2 = match;
7123 if (!match.hit)
7124 {
7125 Match match(false);
7126 Match* parentMatch7 = &match;
7127 lexer.SetPos(save);
7128 {
7129 Match match(false);
7130 Match* parentMatch8 = &match;
7131 {
7132 long pos = lexer.GetPos();
7133 Match match(true);
7134 Match* parentMatch9 = &match;
7135 {
7136 System.Lex.Span span = lexer.GetSpan();
7137 Match match = StatementParser.ConditionalCompilationPrimary(lexer, ctx);
7138 primary.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
7139 if (match.hit)
7140 {
7141 *parentMatch9 = match;
7142 }
7143 else
7144 {
7145 lexer.ThrowExpectationFailure(span, u"conditional compilation primary expression");
7146 }
7147 }
7148 if (match.hit)
7149 {
7150 condCompExpr.Reset(primary.Release());
7151 }
7152 *parentMatch8 = match;
7153 }
7154 *parentMatch7 = match;
7155 }
7156 *parentMatch2 = match;
7157 }
7158 }
7159 *parentMatch1 = match;
7160 }
7161 if (match.hit)
7162 {
7163 {
7164 #if (DEBUG)
7165 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationPrefix");
7166 #endif
7167 return Match(true, condCompExpr.Release());
7168 }
7169 }
7170 *parentMatch0 = match;
7171 }
7172 #if (DEBUG)
7173 if (writeToLog)
7174 {
7175 if (match.hit)
7176 {
7177 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationPrefix");
7178 }
7179 else
7180 {
7181 System.Lex.WriteFailureToLog(lexer, u"ConditionalCompilationPrefix");
7182 }
7183 }
7184 #endif
7185 if (!match.hit)
7186 {
7187 match.value = null;
7188 }
7189 return match;
7190 }
7191 public static Match ConditionalCompilationPrimary(LexerFileLexer& lexer, ParsingContext* ctx)
7192 {
7193 #if (DEBUG)
7194 Span debugSpan;
7195 bool writeToLog = lexer.Log() != null;
7196 if (writeToLog)
7197 {
7198 debugSpan = lexer.GetSpan();
7199 System.Lex.WriteBeginRuleToLog(lexer, u"ConditionalCompilationPrimary");
7200 }
7201 #endif
7202 ustring symbol;
7203 UniquePtr<ConditionalCompilationExpressionNode> expr;
7204 Match match(false);
7205 Match* parentMatch0 = &match;
7206 {
7207 long save = lexer.GetPos();
7208 Match match(false);
7209 Match* parentMatch1 = &match;
7210 {
7211 long pos = lexer.GetPos();
7212 Span span = lexer.GetSpan();
7213 Match match(false);
7214 if (*lexer == ID)
7215 {
7216 ++lexer;
7217 match.hit = true;
7218 }
7219 if (match.hit)
7220 {
7221 symbol = lexer.GetMatch(span);
7222 {
7223 #if (DEBUG)
7224 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationPrimary");
7225 #endif
7226 return Match(true, new ConditionalCompilationPrimaryNode(span, ctx->ModuleId(), symbol));
7227 }
7228 }
7229 *parentMatch1 = match;
7230 }
7231 *parentMatch0 = match;
7232 if (!match.hit)
7233 {
7234 Match match(false);
7235 Match* parentMatch2 = &match;
7236 lexer.SetPos(save);
7237 {
7238 Match match(false);
7239 Match* parentMatch3 = &match;
7240 {
7241 Match match(false);
7242 Match* parentMatch4 = &match;
7243 {
7244 Match match(false);
7245 if (*lexer == LPAREN)
7246 {
7247 ++lexer;
7248 match.hit = true;
7249 }
7250 *parentMatch4 = match;
7251 }
7252 if (match.hit)
7253 {
7254 Match match(false);
7255 Match* parentMatch5 = &match;
7256 {
7257 Match match = StatementParser.ConditionalCompilationExpression(lexer, ctx);
7258 expr.Reset(cast<ConditionalCompilationExpressionNode*>(match.value));
7259 *parentMatch5 = match;
7260 }
7261 *parentMatch4 = match;
7262 }
7263 *parentMatch3 = match;
7264 }
7265 if (match.hit)
7266 {
7267 Match match(false);
7268 Match* parentMatch6 = &match;
7269 {
7270 Match match(false);
7271 Match* parentMatch7 = &match;
7272 {
7273 long pos = lexer.GetPos();
7274 Span span = lexer.GetSpan();
7275 Match match(true);
7276 Match* parentMatch8 = &match;
7277 {
7278 System.Lex.Span span = lexer.GetSpan();
7279 Match match(false);
7280 if (*lexer == RPAREN)
7281 {
7282 ++lexer;
7283 match.hit = true;
7284 }
7285 if (match.hit)
7286 {
7287 *parentMatch8 = match;
7288 }
7289 else
7290 {
7291 lexer.ThrowExpectationFailure(span, GetTokenName(RPAREN));
7292 }
7293 }
7294 if (match.hit)
7295 {
7296 {
7297 #if (DEBUG)
7298 if (writeToLog) System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationPrimary");
7299 #endif
7300 return Match(true, new ParenthesizedConditionalCompilationExpressionNode(span, ctx->ModuleId(), expr.Release()));
7301 }
7302 }
7303 *parentMatch7 = match;
7304 }
7305 *parentMatch6 = match;
7306 }
7307 *parentMatch3 = match;
7308 }
7309 *parentMatch2 = match;
7310 }
7311 *parentMatch0 = match;
7312 }
7313 }
7314 #if (DEBUG)
7315 if (writeToLog)
7316 {
7317 if (match.hit)
7318 {
7319 System.Lex.WriteSuccessToLog(lexer, debugSpan, u"ConditionalCompilationPrimary");
7320 }
7321 else
7322 {
7323 System.Lex.WriteFailureToLog(lexer, u"ConditionalCompilationPrimary");
7324 }
7325 }
7326 #endif
7327 if (!match.hit)
7328 {
7329 match.value = null;
7330 }
7331 return match;
7332 }
7333 }