forked from javacc/javacc-8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExpressParser.jj
1411 lines (1188 loc) · 30 KB
/
ExpressParser.jj
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
/***************************************************************************************************************************************
** DESCRIPTION: EXPRESS Grammar and Scanner to be used with JavaCC
** FILENAME: ExpressParser.jj
** DATE: MAR 1998 - <[email protected]> (Initial grammar)
** UPDATE: OCT 1998 - <[email protected]> (Production 294 correction)
**
** Contributed by Jason Goodman - [email protected]
*************************************************************************************************************************************/
options {
LOOKAHEAD = 2;
STATIC = false;
}
PARSER_BEGIN(ExpressParser)
public class ExpressParser{
//
// MAIN class used for command line parsing
//
public static void main(String args[]) {
ExpressParser parser;
if (args.length == 0) {
System.out.println("ExpressParser: Reading from standard input . . .");
parser = new ExpressParser(System.in);
}
else if (args.length == 1) {
System.out.println("ExpressParser: Reading from file " + args[0] + " . . .");
try {
parser = new ExpressParser(new java.io.FileInputStream(args[0]));
}
catch (java.io.FileNotFoundException e) {
System.out.println("Express Parser: File " + args[0] + " not found.");
return;
}
}
else {
System.out.println("ExpressParser: Usage is one of:");
System.out.println(" java ExpressParser < inputfile");
System.out.println("OR");
System.out.println(" java ExpressParser inputfile");
return;
}
try {
parser.syntax();
System.out.println("ExpressParser: source parsed successfully.");
}
catch (ParseException e) {
System.out.println(e.getMessage());
System.out.println("ExpressParser: Encountered errors during parse.");
}
} // end main
} // end class ExpressParser
PARSER_END(ExpressParser)
/************************************************
*************************************************
** Tokens
*************************************************
************************************************/
SKIP : /* WHITE SPACE */
{
" "
| "\t"
| "\n"
| "\r"
| "\f"
}
SPECIAL_TOKEN : /* COMMENTS */
{
<TAIL_REMARK: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n")>
| <EMBEDDED_REMARK: "(*" (~["*"])* "*" ("*" | (~["*",")"] (~["*"])* "*"))* ")">
}
TOKEN : {
<ABS: "ABS">
| <ABSTRACT: "ABSTRACT">
| <ACOS: "ACOS">
| <AGGREGATE: "AGGREGATE">
| <ALIAS: "ALIAS">
| <AND: "AND">
| <ANDOR: "ANDOR">
| <ARRAY: "ARRAY">
| <AS: "AS">
| <ASIN: "ASIN">
| <ATAN: "ATAN">
| <BAG: "BAG">
| <BEGIN: "BEGIN">
| <BINARY: "BINARY">
| <BLENGTH: "BLENGTH">
| <BOOLEAN: "BOOLEAN">
| <BY: "BY">
| <CASE: "CASE">
| <CONSTANT: "CONSTANT">
| <CONTEXT: "CONTEXT">
| <COS: "COS">
| <DERIVE: "DERIVE">
| <DIV: "DIV">
| <ELSE: "ELSE">
| <END: "END">
| <ENTITY: "ENTITY">
| <ENUMERATION: "ENUMERATION">
| <ESCAPE: "ESCAPE">
| <EXISTS: "EXISTS">
| <EXP: "EXP">
| <FALSE: "FALSE">
| <FIXED: "FIXED">
| <FOR: "FOR">
| <FORMAT: "FORMAT">
| <FROM : "FROM">
| <FUNCTION: "FUNCTION">
| <GENERIC: "GENERIC">
| <HIBOUND: "HIBOUND">
| <HIINDEX: "HIINDEX">
| <IF: "IF">
| <IN: "IN">
| <INSERT: "INSERT">
| <INTEGER: "INTEGER">
| <INVERSE: "INVERSE">
| <LENGTH: "LENGTH">
| <LIKE: "LIKE">
| <LIST: "LIST">
| <LOBOUND: "LOBOUND">
| <LOINDEX: "LOINDEX">
| <LOCAL: "LOCAL">
| <LOG: "LOG">
| <LOG10: "LOG10">
| <LOG2: "LOG2">
| <LOGICAL: "LOGICAL">
| <MOD: "MOD">
| <MODEL: "MODEL">
| <NOT: "NOT">
| <NUMBER: "NUMBER">
| <NVL: "NVL">
| <ODD: "ODD">
| <OF: "OF">
| <ONEOF: "ONEOF">
| <OPTIONAL: "OPTIONAL">
| <OR: "OR">
| <OTHERWISE: "OTHERWISE">
| <PI: "PI">
| <PROCEDURE: "PROCEDURE">
| <QUERY: "QUERY">
| <REAL: "REAL">
| <REFERENCE: "REFERENCE">
| <REMOVE: "REMOVE">
| <REPEAT: "REPEAT">
| <RETURN: "RETURN">
| <ROLESOF: "ROLESOF">
| <RULE: "RULE">
| <SCHEMA: "SCHEMA">
| <SELECT: "SELECT">
| <SELF: "SELF">
| <SET: "SET">
| <SIN: "SIN">
| <SIZEOF: "SIZEOF">
| <SKIP_E: "SKIP">
| <SQRT: "SQRT">
| <STRING: "STRING">
| <SUBTYPE: "SUBTYPE">
| <SUPERTYPE: "SUPERTYPE">
| <TAN: "TAN">
| <THEN: "THEN">
| <TO: "TO">
| <TRUE: "TRUE">
| <TYPE: "TYPE">
| <TYPEOF: "TYPEOF">
| <UNIQUE: "UNIQUE">
| <UNKNOWN: "UNKNOWN">
| <UNTIL: "UNTIL">
| <USE: "USE">
| <USEDIN: "USEDIN">
| <VALUE: "VALUE">
| <VAR: "VAR">
| <WHERE: "WHERE">
| <WHILE: "WHILE">
| <XOR: "XOR">
| <CONST_E: "CONST_E">
| <END_ALIAS: "END_ALIAS">
| <END_CASE: "END_CASE">
| <END_CONSTANT: "END_CONSTANT">
| <END_CONTEXT: "END_CONTEXT">
| <END_ENTITY: "END_ENTITY">
| <END_FUNCTION: "END_FUNCTION">
| <END_IF: "END_IF">
| <END_LOCAL: "END_LOCAL">
| <END_MODEL: "END_MODEL">
| <END_PROCEDURE: "END_PROCEDURE">
| <END_REPEAT: "END_REPEAT">
| <END_RULE: "END_RULE">
| <END_SCHEMA: "END_SCHEMA">
| <END_TYPE: "END_TYPE">
| <VALUE_IN: "VALUE_IN">
| <VALUE_UNIQUE: "VALUE_UNIQUE">
}
TOKEN : {
<INTEGER_LITERAL: (["+","-"])? ["0"-"9"] (["0"-"9"])*>
| <#HEX_LITERAL: "0" ["x","X"] (<HEX_DIGIT>)+>
| <#HEX_DIGIT: ["0"-"9","a"-"f","A"-"F"]>
| <#OCTAL_LITERAL: "0" (["0"-"7"])*>
| <REAL_LITERAL: (["+","-"])? (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? >
| <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+>
| <SIMPLE_STRING_LITERAL: "\'" (<DIGIT> | <LETTER> | <ESCAPED_CHAR> | <PRINT_CHAR> | " " )* "\'" >
| <#ESCAPED_CHAR: "\\" (["n","t","b","r","f","\\","\'","\""]) >
| <#PRINT_CHAR: "~" | "!" | "@" | "#" | "$" | "%" | "^" |"&" | "*" | "(" | <RPAREN> | "_" | "-" | "+" | "=" | "|" | "{" | "}" | "[" | "]" | ":" | ";" | "," | "." | "<" | ">" | "/" | "?" | "~" | "`" >
| <ENCODED_STRING_LITERAL: "\"" (<ENCODED_CHARACTER>)+ "\"">
| <BINARY_LITERAL: "%" (["0","1"])* >
| <OCTET: <HEX_DIGIT> <HEX_DIGIT> <HEX_DIGIT> <HEX_DIGIT> >
| <#ENCODED_CHARACTER: <OCTET> <OCTET> <OCTET> <OCTET> >
| <SIMPLE_ID: <LETTER> (<LETTER> | <DIGIT> | "_")*>
| <#LETTER: ["A"-"Z", "a"-"z"]>
| <#DIGIT: ["0"-"9"]>
}
TOKEN :
{
< LPAREN: "(" >
| < RPAREN: ")" >
| < LBRACE: "{" >
| < RBRACE: "}" >
| < LBRACKET: "[" >
| < RBRACKET: "]" >
| < SEMICOLON: ";" >
| < COLON: ":" >
| < COMMA: "," >
| < DOT: "." >
}
TOKEN :
{
< ASSIGN: ":=" >
| < GT: ">" >
| < LT: "<" >
| < LTE: "<=" >
| < GTE: ">=" >
| < QMARK: "?" >
| < POWER: "**" >
| < BSLASH: "\\" >
| < NE: "<>" >
| < EQ: "=" >
| < ASSIGN_NE: ":<>:">
| < ASSIGN_EQ: ":=:">
| < PLUS: "+" >
| < MINUS: "-" >
| < STAR: "*">
| < SLASH: "/">
| < SC_OR: "||" >
| < SRS: "<*" >
| < BIT_OR: "|" >
}
/************************************************
*************************************************
** Grammar
*************************************************
************************************************/
/********** PRODUCTION 140 **********/
void simple_id() : {}
{
<SIMPLE_ID>
}
/********** PRODUCTION 145 **********/
void attribute_ref() : {}
{
attribute_id()
}
/********** PRODUCTION 146 **********/
void constant_ref() : {}
{
constant_id()
}
/********** PRODUCTION 147 **********/
void entity_ref() : {}
{
entity_id()
}
/********** PRODUCTION 148 **********/
void enumeration_ref() : {}
{
enumeration_id()
}
/********** PRODUCTION 149 **********/
void function_ref() : {}
{
function_id()
}
/********** PRODUCTION 150 **********/
void parameter_ref() : {}
{
parameter_id()
}
/********** PRODUCTION 151 **********/
void procedure_ref() : {}
{
procedure_id()
}
/********** PRODUCTION 152 **********/
void schema_ref() : {}
{
schema_id()
}
/********** PRODUCTION 153 **********/
void type_label_ref() : {}
{
type_label_id()
}
/********** PRODUCTION 154 **********/
void type_ref() : {}
{
type_id()
}
/********** PRODUCTION 155 **********/
void variable_ref() : {}
{
variable_id()
}
/********** PRODUCTION 156 **********/
void abstract_supertype_declaration() : {}
{
<ABSTRACT> <SUPERTYPE> (subtype_constraint())?
}
/********** PRODUCTION 157 **********/
void actual_parameter_list() : {}
{
<LPAREN> parameter() (<COMMA> parameter())* <RPAREN>
}
/********** PRODUCTION 158 **********/
void add_like_op() : {}
{
<PLUS> | <MINUS> | <OR> | <XOR>
}
/********** PRODUCTION 159 **********/
void aggregate_initializer() : {}
{
<LBRACKET> (element() (<COMMA> element())*)? <RBRACKET>
}
/********** PRODUCTION 160 **********/
void aggregate_source() : {}
{
simple_expression()
}
/********** PRODUCTION 161 **********/
void aggregate_type() : {}
{
<AGGREGATE> (<COLON> type_label())? <OF> parameter_type()
}
/********** PRODUCTION 162 **********/
void aggregation_types() : {}
{
array_type()
| bag_type()
| list_type()
| set_type()
}
/********** PRODUCTION 163 **********/
void algorithm_head() : {}
{
(declaration())* (constant_decl())? (local_decl())
}
/********** PRODUCTION 164 **********/
void alias_stmt() : {}
{
<ALIAS> variable_id() <FOR> general_ref() (qualifier())* <SEMICOLON> (stmt())+ <END_ALIAS> <SEMICOLON>
}
/********** PRODUCTION 165 **********/
void array_type() : {}
{
<ARRAY> bound_spec() <OF> (<OPTIONAL>)? (<UNIQUE>)? base_type()
}
/********** PRODUCTION 166 **********/
void assignment_stmt() : {}
{
general_ref() (qualifier())* <ASSIGN> expression() <SEMICOLON>
}
/********** PRODUCTION 167 **********/
void attribute_decl() : {}
{
attribute_id() | qualified_attribute()
}
/********** PRODUCTION 168 **********/
void attribute_id() : {}
{
simple_id()
}
/********** PRODUCTION 169 **********/
void attribute_qualifier() : {}
{
<DOT> attribute_ref()
}
/********** PRODUCTION 170 **********/
void bag_type() : {}
{
<BAG> (bound_spec())? <OF> base_type()
}
/********** PRODUCTION 171 **********/
void base_type() : {}
{
aggregation_types()
| simple_types()
| named_types()
}
/********** PRODUCTION 172 **********/
void binary_type() : {}
{
<BINARY> (width_spec())?
}
/********** PRODUCTION 173 **********/
void boolean_type() : {}
{
<BOOLEAN>
}
/********** PRODUCTION 174 **********/
void bound_1() : {}
{
numeric_expression()
}
/********** PRODUCTION 175 **********/
void bound_2() : {}
{
numeric_expression()
}
/********** PRODUCTION 176 **********/
void bound_spec() : {}
{
<LBRACKET> bound_1() <COLON> bound_2() <RBRACKET>
}
/********** PRODUCTION 177 **********/
void built_in_constant() : {}
{
<CONST_E> | <PI> | <SELF> | <QMARK>
}
/********** PRODUCTION 178 **********/
void built_in_function() : {}
{
<ABS> | <ACOS> | <ASIN> | <ATAN> | <BLENGTH> | <COS> |
<EXISTS> | <EXP> | <FORMAT> | <HIBOUND> | <HIINDEX> |
<LENGTH> | <LOBOUND> | <LOINDEX> | <LOG> | <LOG2> |
<LOG10> | <NVL> | <ODD> | <ROLESOF> | <SIN> | <SIZEOF> |
<SQRT> | <TAN> | <TYPEOF> | <USEDIN> | <VALUE> |
<VALUE_IN> | <VALUE_UNIQUE>
}
/********** PRODUCTION 179 **********/
void built_in_procedure() : {}
{
<INSERT> | <REMOVE>
}
/********** PRODUCTION 180 **********/
void case_action() : {}
{
case_label() (<COMMA> case_label())* <COLON> stmt()
}
/********** PRODUCTION 181 **********/
void case_label() : {}
{
expression()
}
/********** PRODUCTION 182 **********/
void case_stmt() : {}
{
<CASE> selector() <OF> (case_action())* (<OTHERWISE> <COLON> stmt())? <END_CASE> <SEMICOLON>
}
/********** PRODUCTION 183 **********/
void compound_stmt() : {}
{
<BEGIN> (stmt())+ <END> <SEMICOLON>
}
/********** PRODUCTION 184 **********/
void constant_body() : {}
{
constant_id() <COLON> base_type() <ASSIGN> expression() <SEMICOLON>
}
/********** PRODUCTION 185 **********/
void constant_decl() : {}
{
<CONSTANT> (constant_body())+ <END_CONSTANT> <SEMICOLON>
}
/********** PRODUCTION 186 **********/
void constant_factor() : {}
{
built_in_constant() | constant_ref()
}
/********** PRODUCTION 187 **********/
void constant_id() : {}
{
simple_id()
}
/********** PRODUCTION 188 **********/
void constructed_types() : {}
{
enumeration_type() | select_type()
}
/********** PRODUCTION 189 **********/
void declaration() : {}
{
entity_decl() | function_decl() | procedure_decl() | type_decl()
}
/********** PRODUCTION 190 **********/
void derived_attr() : {}
{
attribute_decl() <COLON> base_type() <ASSIGN> expression() <SEMICOLON>
}
/********** PRODUCTION 191 **********/
void derive_clause() : {}
{
<DERIVE> (derived_attr())+
}
/********** PRODUCTION 192 **********/
void domain_rule() : {}
{
(label() <COLON>)? expression()
}
/********** PRODUCTION 193 **********/
void element() : {}
{
expression() (<COLON> repetition())?
}
/********** PRODUCTION 194 **********/
void entity_body() : {}
{
(explicit_attr())* (derive_clause())? (inverse_clause())? (unique_clause())? (where_clause())?
}
/********** PRODUCTION 195 **********/
void entity_constructor() : {}
{
entity_ref() <LPAREN> (expression() (<COMMA> expression())*)? <RPAREN>
}
/********** PRODUCTION 196 **********/
void entity_decl() : { }
{
entity_head() entity_body() <END_ENTITY> <SEMICOLON>
}
/********** PRODUCTION 197 **********/
void entity_head() : { }
{
<ENTITY> entity_id() (subsuper())? <SEMICOLON>
}
/********** PRODUCTION 198 **********/
void entity_id() : {}
{
simple_id()
}
/********** PRODUCTION 199 **********/
void enumeration_id() : {}
{
simple_id()
}
/********** PRODUCTION 200 **********/
void enumeration_reference() : {}
{
(type_ref() <DOT>)? enumeration_ref()
}
/********** PRODUCTION 201 **********/
void enumeration_type() : {}
{
<ENUMERATION> <OF> <LPAREN> enumeration_id() (<COMMA> enumeration_id())* <RPAREN>
}
/********** PRODUCTION 202 **********/
void escape_stmt() : {}
{
<ESCAPE> <SEMICOLON>
}
/********** PRODUCTION 203 **********/
void explicit_attr() : {}
{
attribute_decl()
(<COMMA> attribute_decl())*
<COLON> (<OPTIONAL>)?
base_type()
<SEMICOLON>
}
/********** PRODUCTION 204 **********/
void expression() : {}
{
simple_expression() (rel_op_extended() simple_expression())?
}
/********** PRODUCTION 205 **********/
void factor() : {}
{
simple_factor() (<POWER> simple_factor())?
}
/********** PRODUCTION 206 **********/
void formal_parameter() : {}
{
parameter_id() (<COMMA> parameter_id())* <COLON> parameter_type()
}
/********** PRODUCTION 207 **********/
void function_call() : {}
{
(built_in_function() | function_ref()) (actual_parameter_list())?
}
/********** PRODUCTION 208 **********/
void function_decl() : {}
{
function_head() (algorithm_head())? (stmt())+ <END_FUNCTION> <SEMICOLON>
}
/********** PRODUCTION 209 **********/
void function_head() : {}
{
<FUNCTION> function_id() (<LPAREN> formal_parameter() (<SEMICOLON> formal_parameter())* <RPAREN>)? <COLON> parameter_type() <SEMICOLON>
}
/********** PRODUCTION 210 **********/
void function_id() : {}
{
simple_id()
}
/********** PRODUCTION 211 **********/
void generalized_types() : {}
{
aggregate_type()
| general_aggregation_types()
| generic_type()
}
/********** PRODUCTION 212 **********/
void general_aggregation_types() : {}
{
general_array_type()
| general_bag_type()
| general_list_type()
| general_set_type()
}
/********** PRODUCTION 213 **********/
void general_array_type() : {}
{
<ARRAY> (bound_spec())? <OF> (<OPTIONAL> )? (<UNIQUE>)? parameter_type()
}
/********** PRODUCTION 214 **********/
void general_bag_type() : {}
{
<BAG> (bound_spec())? <OF> parameter_type()
}
/********** PRODUCTION 215 **********/
void general_list_type() : {}
{
<LIST> (bound_spec())? <OF> (<UNIQUE>)? parameter_type()
}
/********** PRODUCTION 216 **********/
void general_ref() : {}
{
parameter_ref()
| variable_ref()
}
/********** PRODUCTION 217 **********/
void general_set_type() : {}
{
<SET> (bound_spec())? <OF> parameter_type()
}
/********** PRODUCTION 218 **********/
void generic_type() : {}
{
<GENERIC> (<COLON> type_label())?
}
/********** PRODUCTION 219 **********/
void group_qualifier() : {}
{
<BSLASH> entity_ref()
}
/********** PRODUCTION 220 **********/
void if_stmt() : {}
{
<IF> expression() <THEN> (stmt())+ (<ELSE> (stmt())+)? <END_IF> <SEMICOLON>
}
/********** PRODUCTION 221 **********/
void increment() : {}
{
numeric_expression()
}
/********** PRODUCTION 222 **********/
void increment_control() : {}
{
variable_id() <ASSIGN> bound_1() <TO> bound_2() (<BY> increment())?
}
/********** PRODUCTION 223 **********/
void index() : {}
{
numeric_expression()
}
/********** PRODUCTION 224 **********/
void index_1() : {}
{
index()
}
/********** PRODUCTION 225 **********/
void index_2() : {}
{
index()
}
/********** PRODUCTION 226 **********/
void index_qualifier() : {}
{
<LBRACKET> index_1() (<COLON> index_2())? <RBRACKET>
}
/********** PRODUCTION 227 **********/
void integer_type() : {}
{
<INTEGER>
}
/********** PRODUCTION 228 **********/
void interface_specification() : {}
{
reference_clause()
| use_clause()
}
/********** PRODUCTION 229 **********/
void interval() : {}
{
<LBRACE> interval_low() interval_op() interval_item() interval_op() interval_high() <RBRACE>
}
/********** PRODUCTION 230 **********/
void interval_high() : {}
{
simple_expression()
}
/********** PRODUCTION 231 **********/
void interval_item() : {}
{
simple_expression()
}
/********** PRODUCTION 232 **********/
void interval_low() : {}
{
simple_expression()
}
/********** PRODUCTION 233 **********/
void interval_op() : {}
{
<LT> | <LTE>
}
/********** PRODUCTION 234 **********/
void inverse_attr() : {}
{
attribute_decl() <COLON> ((<SET>|<BAG>) (bound_spec())? <OF>)? entity_ref() <FOR> attribute_ref() <SEMICOLON>
}
/********** PRODUCTION 235 **********/
void inverse_clause() : {}
{
<INVERSE> (inverse_attr())+
}
/********** PRODUCTION 236 **********/
void label() : {}
{
simple_id()
}
/********** PRODUCTION 237 **********/
void list_type() : {}
{
<LIST> (bound_spec())? <OF> (<UNIQUE>)? base_type()
}
/********** PRODUCTION 238 **********/
void literal() : {}
{
<BINARY_LITERAL> | <INTEGER_LITERAL> | logical_literal() | <REAL_LITERAL> | string_literal()
}
/********** PRODUCTION 239 **********/
void local_decl() : {}
{
<LOCAL> local_variable() (local_variable())* <END_LOCAL> <SEMICOLON>
}
/********** PRODUCTION 240 **********/
void local_variable() : {}
{
variable_id() (<COMMA> variable_id())* <COLON> parameter_type() (<ASSIGN> expression())? <SEMICOLON>
}
/********** PRODUCTION 241 **********/
void logical_expression() : {}
{
expression()
}
/********** PRODUCTION 242 **********/
void logical_literal() : {}
{
<FALSE> | <TRUE> | <UNKNOWN>
}
/********** PRODUCTION 243 **********/
void logical_type() : {}
{
<LOGICAL>
}
/********** PRODUCTION 244 **********/
void multiplication_like_op() : {}
{
<STAR> | <SLASH> | <DIV> | <MOD> | <AND> | <SC_OR>
}
/********** PRODUCTION 245 **********/
void named_types() : {}
{
entity_ref() | type_ref()
}
/********** PRODUCTION 246 **********/
void named_type_or_rename() : {}
{
named_types() (<AS> (entity_id() | type_id()))?
}
/********** PRODUCTION 247 **********/
void null_stmt() : {}
{
<SEMICOLON>
}
/********** PRODUCTION 248 **********/
void number_type() : {}
{
<NUMBER>
}
/********** PRODUCTION 249 **********/
void numeric_expression() : {}
{
simple_expression()
}
/********** PRODUCTION 250 **********/
void one_of() : {}
{
<ONEOF> <LPAREN> supertype_expression() (<COMMA> supertype_expression())* <RPAREN>
}
/********** PRODUCTION 251 **********/
void parameter() : {}
{
expression()
}
/********** PRODUCTION 252 **********/
void parameter_id() : {}
{
simple_id()
}
/********** PRODUCTION 253 **********/
void parameter_type() : {}
{
generalized_types() | named_types() | simple_types()
}
/********** PRODUCTION 254 **********/
void population() : {}
{
entity_ref()
}
/********** PRODUCTION 255 **********/
void precision_spec() : {}
{
numeric_expression()
}
/********** PRODUCTION 256 **********/
void primary() : {}
{
literal() | (qualifiable_factor() (qualifier())*)
}
/********** PRODUCTION 257 **********/
void procedure_call_stmt() : {}
{
(built_in_procedure() | procedure_ref()) (actual_parameter_list())? <SEMICOLON>