-
Notifications
You must be signed in to change notification settings - Fork 3
/
BaseVyperParser.java
4066 lines (3711 loc) · 137 KB
/
BaseVyperParser.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This is a generated file. Not intended for manual editing.
package org.vyperlang.plugin.parser;
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiBuilder.Marker;
import static org.vyperlang.plugin.psi.VyperTypes.*;
import static org.vyperlang.plugin.parser.ParserUtil.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.lang.ASTNode;
import com.intellij.psi.tree.TokenSet;
import com.intellij.lang.PsiParser;
import com.intellij.lang.LightPsiParser;
@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"})
public class BaseVyperParser implements PsiParser, LightPsiParser {
public ASTNode parse(IElementType t, PsiBuilder b) {
parseLight(t, b);
return b.getTreeBuilt();
}
public void parseLight(IElementType t, PsiBuilder b) {
boolean r;
b = adapt_builder_(t, b, this, EXTENDS_SETS_);
Marker m = enter_section_(b, 0, _COLLAPSE_, null);
r = parse_root_(t, b);
exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);
}
protected boolean parse_root_(IElementType t, PsiBuilder b) {
return parse_root_(t, b, 0);
}
static boolean parse_root_(IElementType t, PsiBuilder b, int l) {
return VyperFile(b, l + 1);
}
public static final TokenSet[] EXTENDS_SETS_ = new TokenSet[] {
create_token_set_(AND_EXPRESSION, ASSERT_EXPRESSION, ASSIGNMENT_EXPRESSION, BIN_EXPRESSION,
CALL_EXPRESSION, COMP_EXPRESSION, CONSTANT_DEFINITION_EXPRESSION, EQ_EXPRESSION,
EVENT_LOG_EXPRESSION, EXPONENT_EXPRESSION, EXPRESSION, EXT_CALL_EXPRESSION,
IMMUTABLE_DEFINITION_EXPRESSION, INDEX_ACCESS_EXPRESSION, INLINE_ARRAY_EXPRESSION, IN_EXPRESSION,
MEMBER_ACCESS_EXPRESSION, MULT_DIV_EXPRESSION, OR_EXPRESSION, PARENTHESIZED_EXPRESSION,
PLUS_MIN_EXPRESSION, PRIMARY_EXPRESSION, RANGE_EXPRESSION, STATIC_CALL_EXPRESSION,
STRUCT_EXPRESSION, TERNARY_EXPRESSION, TUPLE_ASSIGNMENT_EXPRESSION, UNARY_EXPRESSION),
};
/* ********************************************************** */
// ',' ( stringLiteralDouble | stringLiteralSingle | MultiLineString )
static boolean AssertMessage(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "AssertMessage")) return false;
if (!nextTokenIs(b, COMMA)) return false;
boolean r;
Marker m = enter_section_(b);
r = consumeToken(b, COMMA);
r = r && AssertMessage_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// stringLiteralDouble | stringLiteralSingle | MultiLineString
private static boolean AssertMessage_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "AssertMessage_1")) return false;
boolean r;
r = consumeToken(b, STRINGLITERALDOUBLE);
if (!r) r = consumeToken(b, STRINGLITERALSINGLE);
if (!r) r = MultiLineString(b, l + 1);
return r;
}
/* ********************************************************** */
// booleanLiteral
static boolean BooleanLiteral(PsiBuilder b, int l) {
return consumeToken(b, BOOLEANLITERAL);
}
/* ********************************************************** */
// break
static boolean Break(PsiBuilder b, int l) {
return consumeToken(b, BREAK);
}
/* ********************************************************** */
// Expression &INDNONE ':' ((&INDNONE Statement)
// | <<indented (Statement (&INDEQ Statement)*)>>)
static boolean CondStmt(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt")) return false;
boolean r;
Marker m = enter_section_(b);
r = Expression(b, l + 1, -1);
r = r && CondStmt_1(b, l + 1);
r = r && consumeToken(b, COLON);
r = r && CondStmt_3(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean CondStmt_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// (&INDNONE Statement)
// | <<indented (Statement (&INDEQ Statement)*)>>
private static boolean CondStmt_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_3")) return false;
boolean r;
Marker m = enter_section_(b);
r = CondStmt_3_0(b, l + 1);
if (!r) r = indented(b, l + 1, BaseVyperParser::CondStmt_3_1_0);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE Statement
private static boolean CondStmt_3_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_3_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = CondStmt_3_0_0(b, l + 1);
r = r && Statement(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean CondStmt_3_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_3_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// Statement (&INDEQ Statement)*
private static boolean CondStmt_3_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_3_1_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = Statement(b, l + 1);
r = r && CondStmt_3_1_0_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// (&INDEQ Statement)*
private static boolean CondStmt_3_1_0_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_3_1_0_1")) return false;
while (true) {
int c = current_position_(b);
if (!CondStmt_3_1_0_1_0(b, l + 1)) break;
if (!empty_element_parsed_guard_(b, "CondStmt_3_1_0_1", c)) break;
}
return true;
}
// &INDEQ Statement
private static boolean CondStmt_3_1_0_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_3_1_0_1_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = CondStmt_3_1_0_1_0_0(b, l + 1);
r = r && Statement(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDEQ
private static boolean CondStmt_3_1_0_1_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "CondStmt_3_1_0_1_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indEq(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// Identifier &INDNONE ':' ConstantType &INDNONE '=' &INDNONE Expression
public static boolean ConstantDefinitionExpression(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantDefinitionExpression")) return false;
if (!nextTokenIs(b, IDENTIFIER)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_, CONSTANT_DEFINITION_EXPRESSION, null);
r = consumeToken(b, IDENTIFIER);
r = r && ConstantDefinitionExpression_1(b, l + 1);
r = r && consumeToken(b, COLON);
r = r && ConstantType(b, l + 1);
r = r && ConstantDefinitionExpression_4(b, l + 1);
p = r; // pin = 5
r = r && report_error_(b, consumeToken(b, ASSIGN));
r = p && report_error_(b, ConstantDefinitionExpression_6(b, l + 1)) && r;
r = p && Expression(b, l + 1, -1) && r;
exit_section_(b, l, m, r, p, null);
return r || p;
}
// &INDNONE
private static boolean ConstantDefinitionExpression_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantDefinitionExpression_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ConstantDefinitionExpression_4(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantDefinitionExpression_4")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ConstantDefinitionExpression_6(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantDefinitionExpression_6")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// (&INDNONE constant &INDNONE '(' TYPE ')') | (public &INDNONE '(' &INDNONE ConstantType &INDNONE ')')
static boolean ConstantType(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType")) return false;
boolean r;
Marker m = enter_section_(b);
r = ConstantType_0(b, l + 1);
if (!r) r = ConstantType_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE constant &INDNONE '(' TYPE ')'
private static boolean ConstantType_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = ConstantType_0_0(b, l + 1);
r = r && consumeToken(b, CONSTANT);
r = r && ConstantType_0_2(b, l + 1);
r = r && consumeToken(b, LPAREN);
r = r && TYPE(b, l + 1);
r = r && consumeToken(b, RPAREN);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean ConstantType_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ConstantType_0_2(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType_0_2")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// public &INDNONE '(' &INDNONE ConstantType &INDNONE ')'
private static boolean ConstantType_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType_1")) return false;
boolean r;
Marker m = enter_section_(b);
r = consumeToken(b, PUBLIC);
r = r && ConstantType_1_1(b, l + 1);
r = r && consumeToken(b, LPAREN);
r = r && ConstantType_1_3(b, l + 1);
r = r && ConstantType(b, l + 1);
r = r && ConstantType_1_5(b, l + 1);
r = r && consumeToken(b, RPAREN);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean ConstantType_1_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType_1_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ConstantType_1_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType_1_3")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ConstantType_1_5(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ConstantType_1_5")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// continue
static boolean Continue(PsiBuilder b, int l) {
return consumeToken(b, CONTINUE);
}
/* ********************************************************** */
// decimalNumber
static boolean DecimalNumber(PsiBuilder b, int l) {
return consumeToken(b, DECIMALNUMBER);
}
/* ********************************************************** */
// DynArray &INDNONE '[' TYPE ',' Expression ']'
static boolean DynArrayType(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "DynArrayType")) return false;
if (!nextTokenIs(b, DYNARRAY)) return false;
boolean r;
Marker m = enter_section_(b);
r = consumeToken(b, DYNARRAY);
r = r && DynArrayType_1(b, l + 1);
r = r && consumeToken(b, LBRACKET);
r = r && TYPE(b, l + 1);
r = r && consumeToken(b, COMMA);
r = r && Expression(b, l + 1, -1);
r = r && consumeToken(b, RBRACKET);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean DynArrayType_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "DynArrayType_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// elif &INDNONE CondStmt
static boolean ElifStmt(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElifStmt")) return false;
if (!nextTokenIs(b, ELIF)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_);
r = consumeToken(b, ELIF);
p = r; // pin = 1
r = r && report_error_(b, ElifStmt_1(b, l + 1));
r = p && CondStmt(b, l + 1) && r;
exit_section_(b, l, m, r, p, null);
return r || p;
}
// &INDNONE
private static boolean ElifStmt_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElifStmt_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// else &INDNONE ':' ((&INDNONE Statement)
// | <<indented (Statement (&INDEQ Statement)*)>>)
static boolean ElseStmt(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt")) return false;
if (!nextTokenIs(b, ELSE)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_);
r = consumeToken(b, ELSE);
p = r; // pin = 1
r = r && report_error_(b, ElseStmt_1(b, l + 1));
r = p && report_error_(b, consumeToken(b, COLON)) && r;
r = p && ElseStmt_3(b, l + 1) && r;
exit_section_(b, l, m, r, p, null);
return r || p;
}
// &INDNONE
private static boolean ElseStmt_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// (&INDNONE Statement)
// | <<indented (Statement (&INDEQ Statement)*)>>
private static boolean ElseStmt_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_3")) return false;
boolean r;
Marker m = enter_section_(b);
r = ElseStmt_3_0(b, l + 1);
if (!r) r = indented(b, l + 1, BaseVyperParser::ElseStmt_3_1_0);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE Statement
private static boolean ElseStmt_3_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_3_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = ElseStmt_3_0_0(b, l + 1);
r = r && Statement(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean ElseStmt_3_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_3_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// Statement (&INDEQ Statement)*
private static boolean ElseStmt_3_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_3_1_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = Statement(b, l + 1);
r = r && ElseStmt_3_1_0_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// (&INDEQ Statement)*
private static boolean ElseStmt_3_1_0_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_3_1_0_1")) return false;
while (true) {
int c = current_position_(b);
if (!ElseStmt_3_1_0_1_0(b, l + 1)) break;
if (!empty_element_parsed_guard_(b, "ElseStmt_3_1_0_1", c)) break;
}
return true;
}
// &INDEQ Statement
private static boolean ElseStmt_3_1_0_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_3_1_0_1_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = ElseStmt_3_1_0_1_0_0(b, l + 1);
r = r && Statement(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDEQ
private static boolean ElseStmt_3_1_0_1_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ElseStmt_3_1_0_1_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indEq(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// event &INDNONE Identifier &INDNONE ':' ((&INDGT EventProperty?) | (&INDNONE PassStatement))
public static boolean EventDeclaration(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration")) return false;
if (!nextTokenIs(b, EVENT)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_, EVENT_DECLARATION, null);
r = consumeToken(b, EVENT);
r = r && EventDeclaration_1(b, l + 1);
r = r && consumeToken(b, IDENTIFIER);
r = r && EventDeclaration_3(b, l + 1);
r = r && consumeToken(b, COLON);
p = r; // pin = 5
r = r && EventDeclaration_5(b, l + 1);
exit_section_(b, l, m, r, p, null);
return r || p;
}
// &INDNONE
private static boolean EventDeclaration_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean EventDeclaration_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_3")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// (&INDGT EventProperty?) | (&INDNONE PassStatement)
private static boolean EventDeclaration_5(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_5")) return false;
boolean r;
Marker m = enter_section_(b);
r = EventDeclaration_5_0(b, l + 1);
if (!r) r = EventDeclaration_5_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDGT EventProperty?
private static boolean EventDeclaration_5_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_5_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = EventDeclaration_5_0_0(b, l + 1);
r = r && EventDeclaration_5_0_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDGT
private static boolean EventDeclaration_5_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_5_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indGt(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// EventProperty?
private static boolean EventDeclaration_5_0_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_5_0_1")) return false;
EventProperty(b, l + 1);
return true;
}
// &INDNONE PassStatement
private static boolean EventDeclaration_5_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_5_1")) return false;
boolean r;
Marker m = enter_section_(b);
r = EventDeclaration_5_1_0(b, l + 1);
r = r && PassStatement(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean EventDeclaration_5_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventDeclaration_5_1_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// Identifier ':' (IndexedData | TYPE) (Identifier ':' (IndexedData |TYPE))*
public static boolean EventProperty(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventProperty")) return false;
if (!nextTokenIs(b, IDENTIFIER)) return false;
boolean r;
Marker m = enter_section_(b);
r = consumeTokens(b, 0, IDENTIFIER, COLON);
r = r && EventProperty_2(b, l + 1);
r = r && EventProperty_3(b, l + 1);
exit_section_(b, m, EVENT_PROPERTY, r);
return r;
}
// IndexedData | TYPE
private static boolean EventProperty_2(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventProperty_2")) return false;
boolean r;
r = IndexedData(b, l + 1);
if (!r) r = TYPE(b, l + 1);
return r;
}
// (Identifier ':' (IndexedData |TYPE))*
private static boolean EventProperty_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventProperty_3")) return false;
while (true) {
int c = current_position_(b);
if (!EventProperty_3_0(b, l + 1)) break;
if (!empty_element_parsed_guard_(b, "EventProperty_3", c)) break;
}
return true;
}
// Identifier ':' (IndexedData |TYPE)
private static boolean EventProperty_3_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventProperty_3_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = consumeTokens(b, 0, IDENTIFIER, COLON);
r = r && EventProperty_3_0_2(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// IndexedData |TYPE
private static boolean EventProperty_3_0_2(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "EventProperty_3_0_2")) return false;
boolean r;
r = IndexedData(b, l + 1);
if (!r) r = TYPE(b, l + 1);
return r;
}
/* ********************************************************** */
// Expression
static boolean ExpressionStatement(PsiBuilder b, int l) {
return Expression(b, l + 1, -1);
}
/* ********************************************************** */
// fixedNumber
static boolean FixedNumber(PsiBuilder b, int l) {
return consumeToken(b, FIXEDNUMBER);
}
/* ********************************************************** */
// (enum|flag) &INDNONE Identifier &INDNONE COLON (<<indented FlagOptions >>)
public static boolean FlagDeclaration(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagDeclaration")) return false;
if (!nextTokenIs(b, "<flag declaration>", ENUM, FLAG)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_, FLAG_DECLARATION, "<flag declaration>");
r = FlagDeclaration_0(b, l + 1);
p = r; // pin = 1
r = r && report_error_(b, FlagDeclaration_1(b, l + 1));
r = p && report_error_(b, consumeToken(b, IDENTIFIER)) && r;
r = p && report_error_(b, FlagDeclaration_3(b, l + 1)) && r;
r = p && report_error_(b, consumeToken(b, COLON)) && r;
r = p && FlagDeclaration_5(b, l + 1) && r;
exit_section_(b, l, m, r, p, null);
return r || p;
}
// enum|flag
private static boolean FlagDeclaration_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagDeclaration_0")) return false;
boolean r;
r = consumeToken(b, ENUM);
if (!r) r = consumeToken(b, FLAG);
return r;
}
// &INDNONE
private static boolean FlagDeclaration_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagDeclaration_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean FlagDeclaration_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagDeclaration_3")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// <<indented FlagOptions >>
private static boolean FlagDeclaration_5(PsiBuilder b, int l) {
return indented(b, l + 1, BaseVyperParser::FlagOptions);
}
/* ********************************************************** */
// Identifier
public static boolean FlagOption(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagOption")) return false;
boolean r;
Marker m = enter_section_(b, l, _NONE_, FLAG_OPTION, "<flag option>");
r = consumeToken(b, IDENTIFIER);
exit_section_(b, l, m, r, false, BaseVyperParser::recoverIndent);
return r;
}
/* ********************************************************** */
// FlagOption ( &INDEQ FlagOption )*
static boolean FlagOptions(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagOptions")) return false;
if (!nextTokenIs(b, IDENTIFIER)) return false;
boolean r;
Marker m = enter_section_(b);
r = FlagOption(b, l + 1);
r = r && FlagOptions_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// ( &INDEQ FlagOption )*
private static boolean FlagOptions_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagOptions_1")) return false;
while (true) {
int c = current_position_(b);
if (!FlagOptions_1_0(b, l + 1)) break;
if (!empty_element_parsed_guard_(b, "FlagOptions_1", c)) break;
}
return true;
}
// &INDEQ FlagOption
private static boolean FlagOptions_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagOptions_1_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = FlagOptions_1_0_0(b, l + 1);
r = r && FlagOption(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDEQ
private static boolean FlagOptions_1_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FlagOptions_1_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indEq(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// for &INDNONE Identifier (&INDNONE ':' TYPE)? &INDNONE in &INDNONE Expression &INDNONE ':'
// (&INDNONE Statement | <<indented (Statement (&INDEQ Statement)*)>>)
public static boolean ForStatement(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement")) return false;
if (!nextTokenIs(b, FOR)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_, FOR_STATEMENT, null);
r = consumeToken(b, FOR);
p = r; // pin = 1
r = r && report_error_(b, ForStatement_1(b, l + 1));
r = p && report_error_(b, consumeToken(b, IDENTIFIER)) && r;
r = p && report_error_(b, ForStatement_3(b, l + 1)) && r;
r = p && report_error_(b, ForStatement_4(b, l + 1)) && r;
r = p && report_error_(b, consumeToken(b, IN)) && r;
r = p && report_error_(b, ForStatement_6(b, l + 1)) && r;
r = p && report_error_(b, Expression(b, l + 1, -1)) && r;
r = p && report_error_(b, ForStatement_8(b, l + 1)) && r;
r = p && report_error_(b, consumeToken(b, COLON)) && r;
r = p && ForStatement_10(b, l + 1) && r;
exit_section_(b, l, m, r, p, null);
return r || p;
}
// &INDNONE
private static boolean ForStatement_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_1")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// (&INDNONE ':' TYPE)?
private static boolean ForStatement_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_3")) return false;
ForStatement_3_0(b, l + 1);
return true;
}
// &INDNONE ':' TYPE
private static boolean ForStatement_3_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_3_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = ForStatement_3_0_0(b, l + 1);
r = r && consumeToken(b, COLON);
r = r && TYPE(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean ForStatement_3_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_3_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ForStatement_4(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_4")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ForStatement_6(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_6")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE
private static boolean ForStatement_8(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_8")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// &INDNONE Statement | <<indented (Statement (&INDEQ Statement)*)>>
private static boolean ForStatement_10(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_10")) return false;
boolean r;
Marker m = enter_section_(b);
r = ForStatement_10_0(b, l + 1);
if (!r) r = indented(b, l + 1, BaseVyperParser::ForStatement_10_1_0);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE Statement
private static boolean ForStatement_10_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_10_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = ForStatement_10_0_0(b, l + 1);
r = r && Statement(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean ForStatement_10_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_10_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// Statement (&INDEQ Statement)*
private static boolean ForStatement_10_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_10_1_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = Statement(b, l + 1);
r = r && ForStatement_10_1_0_1(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// (&INDEQ Statement)*
private static boolean ForStatement_10_1_0_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_10_1_0_1")) return false;
while (true) {
int c = current_position_(b);
if (!ForStatement_10_1_0_1_0(b, l + 1)) break;
if (!empty_element_parsed_guard_(b, "ForStatement_10_1_0_1", c)) break;
}
return true;
}
// &INDEQ Statement
private static boolean ForStatement_10_1_0_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_10_1_0_1_0")) return false;
boolean r;
Marker m = enter_section_(b);
r = ForStatement_10_1_0_1_0_0(b, l + 1);
r = r && Statement(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
// &INDEQ
private static boolean ForStatement_10_1_0_1_0_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "ForStatement_10_1_0_1_0_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indEq(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
/* ********************************************************** */
// def (&INDNONE Identifier) FunctionArgs FunTypeAnnotation? (&INDNONE ':')
static boolean FunDef(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FunDef")) return false;
if (!nextTokenIs(b, DEF)) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_);
r = consumeToken(b, DEF);
p = r; // pin = 1
r = r && report_error_(b, FunDef_1(b, l + 1));
r = p && report_error_(b, FunctionArgs(b, l + 1)) && r;
r = p && report_error_(b, FunDef_3(b, l + 1)) && r;
r = p && FunDef_4(b, l + 1) && r;
exit_section_(b, l, m, r, p, null);
return r || p;
}
// &INDNONE Identifier
private static boolean FunDef_1(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FunDef_1")) return false;
boolean r;
Marker m = enter_section_(b);
r = FunDef_1_0(b, l + 1);
r = r && consumeToken(b, IDENTIFIER);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean FunDef_1_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FunDef_1_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}
// FunTypeAnnotation?
private static boolean FunDef_3(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FunDef_3")) return false;
FunTypeAnnotation(b, l + 1);
return true;
}
// &INDNONE ':'
private static boolean FunDef_4(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FunDef_4")) return false;
boolean r;
Marker m = enter_section_(b);
r = FunDef_4_0(b, l + 1);
r = r && consumeToken(b, COLON);
exit_section_(b, m, null, r);
return r;
}
// &INDNONE
private static boolean FunDef_4_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "FunDef_4_0")) return false;
boolean r;
Marker m = enter_section_(b, l, _AND_);
r = indNone(b, l + 1);
exit_section_(b, l, m, r, false, null);
return r;
}