changes to build script to increase java heap memory
[IRC.git] / Robust / JavaGrammar / Parse / java15.cup
1 package Parse;
2
3 import java_cup.runtime.*;
4
5 /* Java 1.5 (JSR-14 + JSR-201) parser for CUP.
6  * (Well, Java 1.5 as of 28 Jul 2003; it may change before official release)
7  * Copyright (C) 2003 C. Scott Ananian <cananian@alumni.princeton.edu>
8  * This program is released under the terms of the GPL; see the file
9  * COPYING for more details.  There is NO WARRANTY on this code.
10  */
11
12 /*
13 JSR-14 Features added:
14 * parameterized types, including corrections from the spec released
15   with the 2.2 prototype of the JSR-14 compiler.  Arrays of parameterized
16   types bounded by wildcards are slated to be added to Java 1.5 (although
17   they are not supported by the 2.2 prototype); this grammar supports them.
18   "Wildcard" types are supported as of the 28 jul 2003 release.
19
20 JSR-201 Features added:
21 * no changes for autoboxing
22 * new-style for:
23   foreach_statement ::=
24                 FOR LPAREN type variable_declarator_id COLON expression RPAREN
25                         statement
26         // must check that first IDENTIFIER is 'each' and second IDENTIFIER
27         //  is 'in'  -- CSA extension; not (yet?) officially adopted
28         |       FOR IDENTIFIER LPAREN type variable_declarator_id IDENTIFIER
29                         expression RPAREN statement
30         ;
31   foreach_statement_no_short_if ::=
32                 FOR LPAREN type variable_declarator_id COLON expression RPAREN
33                         statement_no_short_if
34         // must check that first IDENTIFIER is 'each' and second IDENTIFIER
35         //  is 'in'  -- CSA extension; not (yet?) officially adopted
36         |       FOR IDENTIFIER LPAREN type variable_declarator_id IDENTIFIER
37                         expression RPAREN statement_no_short_if
38         ;
39   statement ::= ...
40      |          foreach_statement ;
41   statement_no_short_if ::= ...
42      |          foreach_statement_no_short_if ;
43
44 * static import:
45   static_single_type_import_declaration ::= 
46                 IMPORT STATIC name SEMICOLON
47         ;
48   static_type_import_on_demand_declaration ::=
49                 IMPORT STATIC name DOT MULT SEMICOLON
50         ;
51   import_declaration ::= ...
52         |       static_single_type_import_declaration
53         |       static_type_import_on_demand_declaration
54         ;
55 * varargs:
56  formal_parameter ::= ...
57         |       type ELLIPSIS IDENTIFIER
58         |       FINAL type ELLIPSIS IDENTIFIER
59         ;
60 * enum:
61   enum_declaration ::=
62                 modifiers_opt ENUM IDENTIFIER interfaces_opt enum_body
63         ;
64   enum_body ::=
65                 LBRACE enum_constants_opt enum_body_declarations_opt RBRACE
66         ;
67   enum_constants_opt ::=
68         |       enum_constants
69         ;
70   enum_constants ::=
71                 enum_constant
72         |       enum_constants COMMA enum_constant
73         ;
74   enum_constant ::=
75                 IDENTIFIER enum_arguments_opt
76         |       IDENTIFIER enum_arguments_opt class_body
77         ;
78   enum_arguments_opt ::=
79         |       LPAREN argument_list_opt RPAREN
80         ;
81   enum_body_declarations_opt ::=
82         |       SEMICOLON class_body_declarations_opt
83         ;
84 */
85 parser code  {: 
86   Lexer lexer;
87
88   public Grm15(Lexer l) {
89     this();
90     lexer=l;
91   }
92
93   public void syntax_error(java_cup.runtime.Symbol current) {
94     report_error("Syntax error (" + current.sym + ")", current);
95   }
96   public void report_error(String message, java_cup.runtime.Symbol info) {
97     lexer.errorMsg(message, info);
98   }
99 :};
100
101 scan with {: return lexer.nextToken(); :};
102
103 terminal BOOLEAN; // primitive_type
104 terminal BYTE, SHORT, INT, LONG, CHAR; // integral_type
105 terminal FLOAT, DOUBLE; // floating_point_type
106 terminal LBRACK, RBRACK; // array_type
107 terminal java.lang.String IDENTIFIER; // name
108 terminal DOT; // qualified_name
109 terminal SEMICOLON, MULT, COMMA, LBRACE, RBRACE, EQ, LPAREN, RPAREN, COLON;
110 terminal PACKAGE; // package_declaration
111 terminal IMPORT; // import_declaration
112 terminal PUBLIC, PROTECTED, PRIVATE; // modifier
113 terminal STATIC; // modifier
114 terminal ABSTRACT, FINAL, NATIVE, SYNCHRONIZED, TRANSIENT, VOLATILE;
115 terminal CLASS; // class_declaration
116 terminal EXTENDS; // super
117 terminal IMPLEMENTS; // interfaces
118 terminal VOID; // method_header
119 terminal THROWS; // throws
120 terminal THIS, SUPER; // explicit_constructor_invocation
121 terminal INTERFACE; // interface_declaration
122 terminal IF, ELSE; // if_then_statement, if_then_else_statement
123 terminal SWITCH; // switch_statement
124 terminal CASE, DEFAULT; // switch_label
125 terminal DO, WHILE; // while_statement, do_statement
126 terminal FOR; // for_statement
127 terminal BREAK; // break_statement
128 terminal CONTINUE; // continue_statement
129 terminal RETURN; // return_statement
130 terminal THROW; // throw_statement
131 terminal TRY; // try_statement
132 terminal CATCH; // catch_clause
133 terminal FINALLY; // finally
134 terminal NEW; // class_instance_creation_expression
135 terminal PLUSPLUS; // postincrement_expression
136 terminal MINUSMINUS; // postdecrement_expression
137 terminal PLUS, MINUS, COMP, NOT, DIV, MOD;
138 terminal LSHIFT, RSHIFT, URSHIFT; // shift_expression
139 terminal LT, GT, LTEQ, GTEQ, INSTANCEOF; // relational_expression
140 terminal EQEQ, NOTEQ; // equality_expression
141 terminal AND; // and_expression
142 terminal XOR; // exclusive_or_expression
143 terminal OR;  // inclusive_or_expression
144 terminal ANDAND; // conditional_and_expression
145 terminal OROR; // conditional_or_expression
146 terminal QUESTION; // conditional_expression
147 terminal MULTEQ, DIVEQ, MODEQ, PLUSEQ, MINUSEQ; // assignment_operator
148 terminal LSHIFTEQ, RSHIFTEQ, URSHIFTEQ; // assignment_operator
149 terminal ANDEQ, XOREQ, OREQ; // assignment_operator
150
151 terminal java.lang.Number INTEGER_LITERAL;
152 terminal java.lang.Number FLOATING_POINT_LITERAL;
153 terminal java.lang.Boolean BOOLEAN_LITERAL;
154 terminal java.lang.Character CHARACTER_LITERAL;
155 terminal java.lang.String STRING_LITERAL;
156 terminal NULL_LITERAL;
157
158 // Reserved but unused:
159 terminal CONST, GOTO;
160 // strictfp keyword, new in Java 1.2
161 terminal STRICTFP;
162 // assert keyword, new in Java 1.4
163 terminal ASSERT; // assert_statement
164 // ellipsis token for varargs, new in Java 1.5 (JSR-201)
165 terminal ELLIPSIS;
166 // enum keyword, new in Java 1.5 (JSR-201)
167 terminal ENUM;
168
169 // 19.2) The Syntactic Grammar
170 non terminal goal;
171 // 19.3) Lexical Structure
172 non terminal literal;
173 // 19.4) Types, Values, and Variables
174 non terminal type, primitive_type, numeric_type;
175 non terminal integral_type, floating_point_type;
176 non terminal reference_type;
177 non terminal class_or_interface_type;
178 non terminal class_type, interface_type;
179 non terminal array_type;
180 // 19.5) Names
181 non terminal name, simple_name, qualified_name;
182 // 19.6) Packages
183 non terminal compilation_unit;
184 non terminal package_declaration_opt, package_declaration;
185 non terminal import_declarations_opt, import_declarations;
186 non terminal type_declarations_opt, type_declarations;
187 non terminal import_declaration;
188 non terminal single_type_import_declaration;
189 non terminal type_import_on_demand_declaration;
190 non terminal static_single_type_import_declaration;
191 non terminal static_type_import_on_demand_declaration;
192 non terminal type_declaration;
193 // 19.7) Productions used only in the LALR(1) grammar
194 non terminal modifiers_opt, modifiers, modifier;
195 // 19.8.1) Class Declaration
196 non terminal class_declaration, super, super_opt;
197 non terminal interfaces, interfaces_opt, interface_type_list;
198 non terminal class_body, class_body_opt;
199 non terminal class_body_declarations, class_body_declarations_opt;
200 non terminal class_body_declaration, class_member_declaration;
201 // JSR-201) Enum Declaration
202 non terminal enum_declaration;
203 non terminal enum_body, enum_constants_opt, enum_constants, enum_constant;
204 non terminal enum_arguments_opt, enum_body_declarations_opt;
205 // 19.8.2) Field Declarations
206 non terminal field_declaration, variable_declarators, variable_declarator;
207 non terminal variable_declarator_id, variable_initializer;
208 // 19.8.3) Method Declarations
209 non terminal method_declaration, method_header, method_declarator;
210 non terminal formal_parameter_list_opt, formal_parameter_list;
211 non terminal formal_parameter;
212 non terminal throws_opt, throws;
213 non terminal class_type_list, method_body;
214 // 19.8.4) Static Initializers
215 non terminal static_initializer;
216 // 19.8.5) Constructor Declarations
217 non terminal constructor_declaration, constructor_declarator;
218 non terminal constructor_body;
219 non terminal explicit_constructor_invocation;
220 // 19.9.1) Interface Declarations
221 non terminal interface_declaration;
222 non terminal extends_interfaces_opt, extends_interfaces;
223 non terminal interface_body;
224 non terminal interface_member_declarations_opt, interface_member_declarations;
225 non terminal interface_member_declaration, constant_declaration;
226 non terminal abstract_method_declaration;
227 // 19.10) Arrays
228 non terminal array_initializer;
229 non terminal variable_initializers;
230 // 19.11) Blocks and Statements
231 non terminal block;
232 non terminal block_statements_opt, block_statements, block_statement;
233 non terminal local_variable_declaration_statement, local_variable_declaration;
234 non terminal statement, statement_no_short_if;
235 non terminal statement_without_trailing_substatement;
236 non terminal empty_statement;
237 non terminal labeled_statement, labeled_statement_no_short_if;
238 non terminal expression_statement, statement_expression;
239 non terminal if_then_statement;
240 non terminal if_then_else_statement, if_then_else_statement_no_short_if;
241 non terminal switch_statement, switch_block;
242 non terminal switch_block_statement_groups;
243 non terminal switch_block_statement_group;
244 non terminal switch_labels, switch_label;
245 non terminal while_statement, while_statement_no_short_if;
246 non terminal do_statement;
247 non terminal foreach_statement, foreach_statement_no_short_if;
248 non terminal for_statement, for_statement_no_short_if;
249 non terminal for_init_opt, for_init;
250 non terminal for_update_opt, for_update;
251 non terminal statement_expression_list;
252 non terminal identifier_opt;
253 non terminal break_statement, continue_statement;
254 non terminal return_statement, throw_statement;
255 non terminal synchronized_statement, try_statement;
256 non terminal catches_opt, catches, catch_clause;
257 non terminal finally;
258 non terminal assert_statement;
259 // 19.12) Expressions
260 non terminal primary, primary_no_new_array;
261 non terminal class_instance_creation_expression;
262 non terminal argument_list_opt, argument_list;
263 non terminal array_creation_init, array_creation_uninit;
264 non terminal dim_exprs, dim_expr, dims_opt, dims;
265 non terminal field_access, method_invocation, array_access;
266 non terminal postfix_expression;
267 non terminal postincrement_expression, postdecrement_expression;
268 non terminal unary_expression, unary_expression_not_plus_minus;
269 non terminal preincrement_expression, predecrement_expression;
270 non terminal cast_expression;
271 non terminal multiplicative_expression, additive_expression;
272 non terminal shift_expression, relational_expression, equality_expression;
273 non terminal and_expression, exclusive_or_expression, inclusive_or_expression;
274 non terminal conditional_and_expression, conditional_or_expression;
275 non terminal conditional_expression, assignment_expression;
276 non terminal assignment;
277 non terminal assignment_operator;
278 non terminal expression_opt, expression;
279 non terminal constant_expression;
280 // JSR-14 2.1) Type Syntax 2.3) Handling Consecutive Type Brackets
281 non terminal class_or_interface;
282 non terminal type_variable;
283 non terminal type_arguments, type_arguments_opt;
284 non terminal type_argument_list;
285 non terminal type_argument_list_1, reference_type_1;
286 non terminal type_argument_list_2, reference_type_2;
287 non terminal type_argument_list_3, reference_type_3;
288 // JSR-14 2.2) Parameterized Type Declarations 2.3) Handling Consecutive...
289 non terminal type_parameters, type_parameters_opt;
290 non terminal type_parameter, type_parameter_list;
291 non terminal type_parameter_1, type_parameter_list_1;
292 non terminal type_bound, type_bound_opt;
293 non terminal type_bound_1;
294 non terminal additional_bound_list, additional_bound_list_opt;
295 non terminal additional_bound_list_1;
296 non terminal additional_bound;
297 non terminal additional_bound_1;
298 non terminal wildcard, wildcard_1, wildcard_2, wildcard_3;
299 non terminal type_argument, type_argument_1, type_argument_2, type_argument_3;
300 // not mentioned in JSR-14: need to reduce the precedence of instanceof
301 // Alternatively, you can tweak the relational_expression production a little.
302 non terminal instanceof_expression;
303 //// expressions which are Not a Name
304 non terminal postfix_expression_nn;
305 non terminal unary_expression_nn;
306 non terminal unary_expression_not_plus_minus_nn;
307 non terminal multiplicative_expression_nn;
308 non terminal additive_expression_nn;
309 non terminal shift_expression_nn;
310 non terminal relational_expression_nn;
311 non terminal instanceof_expression_nn;
312 non terminal equality_expression_nn;
313 non terminal and_expression_nn;
314 non terminal exclusive_or_expression_nn;
315 non terminal inclusive_or_expression_nn;
316 non terminal conditional_and_expression_nn;
317 non terminal conditional_or_expression_nn;
318 non terminal conditional_expression_nn;
319 non terminal assignment_expression_nn;
320 non terminal expression_nn;
321
322 start with goal;
323
324 // 19.2) The Syntactic Grammar
325 goal ::=        compilation_unit
326         ;
327
328 // 19.3) Lexical Structure.
329 literal ::=     INTEGER_LITERAL
330         |       FLOATING_POINT_LITERAL
331         |       BOOLEAN_LITERAL
332         |       CHARACTER_LITERAL
333         |       STRING_LITERAL
334         |       NULL_LITERAL
335         ;
336
337 // 19.4) Types, Values, and Variables
338 type    ::=     primitive_type
339         |       reference_type
340         ;
341 primitive_type ::=
342                 numeric_type
343         |       BOOLEAN
344         ;
345 numeric_type::= integral_type
346         |       floating_point_type
347         ;
348 integral_type ::= 
349                 BYTE 
350         |       SHORT 
351         |       INT 
352         |       LONG 
353         |       CHAR 
354         ;
355 floating_point_type ::= 
356                 FLOAT 
357         |       DOUBLE
358         ;
359
360 reference_type ::=
361                 class_or_interface_type
362 /* note that the 'type_variable' production will come out of the grammar
363  * as a 'class_or_interface_type' with a 'simple_name'.  The semantic
364  * checker will have to resolve whether this is a class name or a type
365  * variable */
366         |       array_type
367         ;
368 type_variable ::=
369                 IDENTIFIER
370         ;
371 class_or_interface ::=
372                 name
373         |       class_or_interface LT type_argument_list_1 DOT name
374         ;
375 class_or_interface_type ::=
376                 class_or_interface
377         |       class_or_interface LT type_argument_list_1
378         ;
379
380 class_type ::=  class_or_interface_type;
381 interface_type ::= class_or_interface_type;             
382
383 array_type ::=  primitive_type dims
384         // we have class_or_interface_type here even though only unbounded
385         // wildcards are really allowed in the parameterization.
386         // we have to expand this to avoid lookahead problems.
387         |       name dims
388         |       class_or_interface LT type_argument_list_1 DOT name dims
389         |       class_or_interface LT type_argument_list_1 dims
390         ;
391
392 type_arguments_opt ::= type_arguments | ;
393
394 type_arguments ::=
395                 LT type_argument_list_1
396         ;
397 wildcard ::=    QUESTION
398         |       QUESTION EXTENDS reference_type
399         |       QUESTION SUPER reference_type
400         ;
401 wildcard_1 ::=  QUESTION GT
402         |       QUESTION EXTENDS reference_type_1
403         |       QUESTION SUPER reference_type_1
404         ;
405 wildcard_2 ::=  QUESTION RSHIFT
406         |       QUESTION EXTENDS reference_type_2
407         |       QUESTION SUPER reference_type_2
408         ;
409 wildcard_3 ::=  QUESTION URSHIFT
410         |       QUESTION EXTENDS reference_type_3
411         |       QUESTION SUPER reference_type_3
412         ;
413 reference_type_1 ::=
414                 reference_type GT
415         |       class_or_interface LT type_argument_list_2
416         ;
417 reference_type_2 ::=
418                 reference_type RSHIFT
419         |       class_or_interface LT type_argument_list_3
420         ;
421 reference_type_3 ::=
422                 reference_type URSHIFT
423         ;
424 type_argument_list ::=
425                 type_argument
426         |       type_argument_list COMMA type_argument
427         ;
428 type_argument_list_1 ::=
429                 type_argument_1
430         |       type_argument_list COMMA type_argument_1
431         ;
432 type_argument_list_2 ::=
433                 type_argument_2
434         |       type_argument_list COMMA type_argument_2
435         ;
436 type_argument_list_3 ::=
437                 type_argument_3
438         |       type_argument_list COMMA type_argument_3
439         ;
440 type_argument ::=
441                 reference_type
442         |       wildcard
443         ;
444 type_argument_1 ::=
445                 reference_type_1
446         |       wildcard_1
447         ;
448 type_argument_2 ::=
449                 reference_type_2
450         |       wildcard_2
451         ;
452 type_argument_3 ::=
453                 reference_type_3
454         |       wildcard_3
455         ;
456
457 // 19.5) Names
458 name    ::=     simple_name
459         |       qualified_name
460         ;
461 simple_name ::= IDENTIFIER
462         ;
463 qualified_name ::=
464                 name DOT IDENTIFIER
465         ;
466
467 // 19.6) Packages
468 compilation_unit ::=
469                 package_declaration_opt 
470                 import_declarations_opt
471                 type_declarations_opt
472                 ;
473 package_declaration_opt ::= package_declaration | ;
474 import_declarations_opt ::= import_declarations | ;
475 type_declarations_opt   ::= type_declarations   | ;
476
477 import_declarations ::= 
478                 import_declaration
479         |       import_declarations import_declaration
480         ;
481 type_declarations ::= 
482                 type_declaration
483         |       type_declarations type_declaration
484         ;
485 package_declaration ::= 
486                 PACKAGE name SEMICOLON
487         ;
488 import_declaration ::= 
489                 single_type_import_declaration
490         |       type_import_on_demand_declaration
491         |       static_single_type_import_declaration
492         |       static_type_import_on_demand_declaration
493         ;
494 single_type_import_declaration ::= 
495                 IMPORT name SEMICOLON
496         ;
497 static_single_type_import_declaration ::= 
498                 IMPORT STATIC name SEMICOLON
499         ;
500 type_import_on_demand_declaration ::=
501                 IMPORT name DOT MULT SEMICOLON
502         ;
503 static_type_import_on_demand_declaration ::=
504                 IMPORT STATIC name DOT MULT SEMICOLON
505         ;
506 type_declaration ::=
507                 class_declaration
508         |       enum_declaration
509         |       interface_declaration
510         |       SEMICOLON
511         ;
512
513 // 19.7) Productions used only in the LALR(1) grammar
514 modifiers_opt::=
515         |       modifiers
516         ;
517 modifiers ::=   modifier
518         |       modifiers modifier
519         ;
520 modifier ::=    PUBLIC | PROTECTED | PRIVATE
521         |       STATIC
522         |       ABSTRACT | FINAL | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE
523         |       STRICTFP // note that semantic analysis must check that the
524                          // context of the modifier allows strictfp.
525         ;
526
527 // 19.8) Classes
528
529 // 19.8.1) Class Declaration:
530 class_declaration ::= 
531         modifiers_opt CLASS IDENTIFIER type_parameters_opt
532           super_opt interfaces_opt class_body
533         ;
534 super ::=       EXTENDS class_type
535         ;
536 super_opt ::=   
537         |       super
538         ;
539 interfaces ::=  IMPLEMENTS interface_type_list
540         ;
541 interfaces_opt::=
542         |       interfaces 
543         ;
544 interface_type_list ::= 
545                 interface_type
546         |       interface_type_list COMMA interface_type
547         ;
548 class_body ::=  LBRACE class_body_declarations_opt RBRACE 
549         ;
550 class_body_opt ::=
551         |       class_body ;
552 class_body_declarations_opt ::= 
553         |       class_body_declarations ;
554 class_body_declarations ::= 
555                 class_body_declaration
556         |       class_body_declarations class_body_declaration
557         ;
558 class_body_declaration ::=
559                 class_member_declaration
560         |       static_initializer
561         |       constructor_declaration
562         |       block
563         ;
564 class_member_declaration ::=
565                 field_declaration
566         |       method_declaration
567         /* repeat the prod for 'class_declaration' here: */
568         |       modifiers_opt CLASS IDENTIFIER type_parameters_opt super_opt interfaces_opt class_body
569         |       enum_declaration
570         |       interface_declaration
571         |       SEMICOLON
572         ;
573
574 // JSR-201) Enum Declaration
575 enum_declaration ::=
576                 modifiers_opt ENUM IDENTIFIER interfaces_opt enum_body
577         ;
578 enum_body ::=
579                 LBRACE enum_constants_opt enum_body_declarations_opt RBRACE
580         ;
581 enum_constants_opt ::=
582         |       enum_constants
583         ;
584 enum_constants ::=
585                 enum_constant
586         |       enum_constants COMMA enum_constant
587         ;
588 enum_constant ::=
589                 IDENTIFIER enum_arguments_opt
590         |       IDENTIFIER enum_arguments_opt class_body
591         ;
592 enum_arguments_opt ::=
593         |       LPAREN argument_list_opt RPAREN
594         ;
595 enum_body_declarations_opt ::=
596         |       SEMICOLON class_body_declarations_opt
597         ;
598
599 // 19.8.2) Field Declarations
600 field_declaration ::= 
601                 modifiers_opt type variable_declarators SEMICOLON
602         ;
603 variable_declarators ::=
604                 variable_declarator
605         |       variable_declarators COMMA variable_declarator
606         ;
607 variable_declarator ::=
608                 variable_declarator_id
609         |       variable_declarator_id EQ variable_initializer
610         ;
611 variable_declarator_id ::=
612                 IDENTIFIER
613         |       variable_declarator_id LBRACK RBRACK
614         ;
615 variable_initializer ::=
616                 expression
617         |       array_initializer
618         ;
619
620 // 19.8.3) Method Declarations
621 method_declaration ::=
622                 method_header method_body
623         ;
624 method_header ::=
625         // have to expand type_parameters_opt here so that we don't
626         // force an early decision of whether this is a field_declaration
627         // or a method_declaration (the type_parameters_opt would have to
628         // be reduced when we see the 'type' if this was a method declaration,
629         // but it might still turn out to be a field declaration).
630                 modifiers_opt type method_declarator throws_opt
631         |       modifiers_opt LT type_parameter_list_1 type method_declarator throws_opt
632         |       modifiers_opt VOID method_declarator throws_opt
633         |       modifiers_opt LT type_parameter_list_1 VOID method_declarator throws_opt
634         ;
635 method_declarator ::=
636                 IDENTIFIER LPAREN formal_parameter_list_opt RPAREN
637         |       method_declarator LBRACK RBRACK // deprecated
638         // be careful; the above production also allows 'void foo() []'
639         ;
640 formal_parameter_list_opt ::=
641         |       formal_parameter_list
642         ;
643 formal_parameter_list ::=
644                 formal_parameter
645         |       formal_parameter_list COMMA formal_parameter
646         ;
647 formal_parameter ::=
648                 type variable_declarator_id
649         |       FINAL type variable_declarator_id
650         // careful, productions below allow varargs in non-final positions.
651         |       type ELLIPSIS IDENTIFIER
652         |       FINAL type ELLIPSIS IDENTIFIER
653         ;
654 throws_opt ::=  
655         |       throws
656         ;
657 throws ::=      THROWS class_type_list
658         ;
659 class_type_list ::=
660                 class_type
661         |       class_type_list COMMA class_type
662         ;
663 method_body ::= block
664         |       SEMICOLON
665         ;
666
667 // 19.8.4) Static Initializers
668 static_initializer ::=
669                 STATIC block
670         ;
671
672 // 19.8.5) Constructor Declarations
673 constructor_declaration ::=
674                 modifiers_opt constructor_declarator
675                         throws_opt constructor_body
676         |       modifiers_opt LT type_parameter_list_1 constructor_declarator
677                         throws_opt constructor_body
678         ;
679 constructor_declarator ::=
680                 simple_name LPAREN formal_parameter_list_opt RPAREN
681         ;
682 constructor_body ::=
683                 LBRACE explicit_constructor_invocation
684                         block_statements RBRACE
685         |       LBRACE explicit_constructor_invocation RBRACE
686         |       LBRACE block_statements RBRACE
687         |       LBRACE RBRACE
688         ;
689 explicit_constructor_invocation ::=
690                 THIS LPAREN argument_list_opt RPAREN SEMICOLON
691         |       type_arguments THIS LPAREN argument_list_opt RPAREN SEMICOLON
692         |       SUPER LPAREN argument_list_opt RPAREN SEMICOLON
693         |       type_arguments SUPER LPAREN argument_list_opt RPAREN SEMICOLON
694         |       primary DOT SUPER LPAREN argument_list_opt RPAREN SEMICOLON
695         |       primary DOT type_arguments SUPER
696                         LPAREN argument_list_opt RPAREN SEMICOLON
697         |       name DOT SUPER LPAREN argument_list_opt RPAREN SEMICOLON
698         |       name DOT type_arguments SUPER LPAREN argument_list_opt RPAREN SEMICOLON
699         ;
700
701 // 19.9) Interfaces
702
703 // 19.9.1) Interface Declarations
704 interface_declaration ::=
705                 modifiers_opt INTERFACE IDENTIFIER type_parameters_opt
706                   extends_interfaces_opt interface_body
707         ;
708 extends_interfaces_opt ::=
709         |       extends_interfaces
710         ;
711 extends_interfaces ::=
712                 EXTENDS interface_type
713         |       extends_interfaces COMMA interface_type
714         ;
715 interface_body ::=
716                 LBRACE interface_member_declarations_opt RBRACE
717         ;
718 interface_member_declarations_opt ::=
719         |       interface_member_declarations
720         ;
721 interface_member_declarations ::=
722                 interface_member_declaration
723         |       interface_member_declarations interface_member_declaration
724         ;
725 interface_member_declaration ::=
726                 constant_declaration
727         |       abstract_method_declaration
728         |       class_declaration
729         |       enum_declaration
730         |       interface_declaration
731         |       SEMICOLON
732         ;
733 constant_declaration ::=
734                 field_declaration
735         // need to semantically check that modifiers of field declaration
736         // include only PUBLIC, STATIC, or FINAL.  Other modifiers are
737         // disallowed.
738         ;
739 abstract_method_declaration ::=
740                 method_header SEMICOLON
741         ;
742
743 // 19.10) Arrays
744 array_initializer ::=
745                 LBRACE variable_initializers COMMA RBRACE
746         |       LBRACE variable_initializers RBRACE
747         |       LBRACE COMMA RBRACE
748         |       LBRACE RBRACE
749         ;
750 variable_initializers ::=
751                 variable_initializer
752         |       variable_initializers COMMA variable_initializer
753         ;
754
755 // 19.11) Blocks and Statements
756 block ::=       LBRACE block_statements_opt RBRACE
757         ;
758 block_statements_opt ::=
759         |       block_statements
760         ;
761 block_statements ::=
762                 block_statement
763         |       block_statements block_statement
764         ;
765 block_statement ::=
766                 local_variable_declaration_statement
767         |       statement
768         |       class_declaration
769         |       enum_declaration
770         |       interface_declaration
771         ;
772 local_variable_declaration_statement ::=
773                 local_variable_declaration SEMICOLON
774         ;
775 /* jikes expands 'type' in production for local_variable_declaration to
776  * avoid reduce-reduce conflict:  given 'name [' the grammar can't decide
777  * whether this is going to be a type (starting the local_variable_declaration)
778  * or an array access expression. */
779 local_variable_declaration ::=
780                 type variable_declarators
781         // you may want to accept 'modifiers' here instead of just FINAL
782         // to produce better error messages.
783         |       FINAL type variable_declarators
784         ;
785 statement ::=   statement_without_trailing_substatement
786         |       labeled_statement
787         |       if_then_statement
788         |       if_then_else_statement
789         |       while_statement
790         |       for_statement
791         |       foreach_statement
792         ;
793 statement_no_short_if ::=
794                 statement_without_trailing_substatement
795         |       labeled_statement_no_short_if
796         |       if_then_else_statement_no_short_if
797         |       while_statement_no_short_if
798         |       for_statement_no_short_if
799         |       foreach_statement_no_short_if
800         ;
801 statement_without_trailing_substatement ::=
802                 block
803         |       empty_statement
804         |       expression_statement
805         |       switch_statement
806         |       do_statement
807         |       break_statement
808         |       continue_statement
809         |       return_statement
810         |       synchronized_statement
811         |       throw_statement
812         |       try_statement
813         |       assert_statement
814         ;
815 empty_statement ::=
816                 SEMICOLON
817         ;
818 labeled_statement ::=
819                 IDENTIFIER COLON statement
820         ;
821 labeled_statement_no_short_if ::=
822                 IDENTIFIER COLON statement_no_short_if
823         ;
824 expression_statement ::=
825                 statement_expression SEMICOLON
826         ;
827 statement_expression ::=
828                 assignment
829         |       preincrement_expression
830         |       predecrement_expression
831         |       postincrement_expression
832         |       postdecrement_expression
833         |       method_invocation
834         |       class_instance_creation_expression
835         ;
836 if_then_statement ::=
837                 IF LPAREN expression RPAREN statement
838         ;
839 if_then_else_statement ::=
840                 IF LPAREN expression RPAREN statement_no_short_if 
841                         ELSE statement
842         ;
843 if_then_else_statement_no_short_if ::=
844                 IF LPAREN expression RPAREN statement_no_short_if
845                         ELSE statement_no_short_if
846         ;
847 switch_statement ::=
848                 SWITCH LPAREN expression RPAREN switch_block
849         ;
850 switch_block ::=
851                 LBRACE switch_block_statement_groups switch_labels RBRACE
852         |       LBRACE switch_block_statement_groups RBRACE
853         |       LBRACE switch_labels RBRACE
854         |       LBRACE RBRACE
855         ;
856 switch_block_statement_groups ::=
857                 switch_block_statement_group
858         |       switch_block_statement_groups switch_block_statement_group
859         ;
860 switch_block_statement_group ::=
861                 switch_labels block_statements
862         ;
863 switch_labels ::=
864                 switch_label
865         |       switch_labels switch_label
866         ;
867 switch_label ::=
868                 CASE constant_expression COLON
869         |       DEFAULT COLON
870         ;
871
872 while_statement ::=
873                 WHILE LPAREN expression RPAREN statement
874         ;
875 while_statement_no_short_if ::=
876                 WHILE LPAREN expression RPAREN statement_no_short_if
877         ;
878 do_statement ::=
879                 DO statement WHILE LPAREN expression RPAREN SEMICOLON
880         ;
881 foreach_statement ::=
882                 FOR LPAREN type variable_declarator_id COLON expression RPAREN
883                         statement
884         // must check that first IDENTIFIER is 'each' and second IDENTIFIER
885         //  is 'in'
886         |       FOR IDENTIFIER LPAREN type variable_declarator_id IDENTIFIER
887                         expression RPAREN statement
888         ;
889 foreach_statement_no_short_if ::=
890                 FOR LPAREN type variable_declarator_id COLON expression RPAREN
891                         statement_no_short_if
892         // must check that first IDENTIFIER is 'each' and second IDENTIFIER
893         //  is 'in'
894         |       FOR IDENTIFIER LPAREN type variable_declarator_id IDENTIFIER
895                         expression RPAREN statement_no_short_if
896         ;
897 for_statement ::=
898                 FOR LPAREN for_init_opt SEMICOLON expression_opt SEMICOLON
899                         for_update_opt RPAREN statement
900         ;
901 for_statement_no_short_if ::=
902                 FOR LPAREN for_init_opt SEMICOLON expression_opt SEMICOLON
903                         for_update_opt RPAREN statement_no_short_if
904         ;
905 for_init_opt ::=
906         |       for_init
907         ;
908 for_init ::=    statement_expression_list
909         |       local_variable_declaration
910         ;
911 for_update_opt ::=
912         |       for_update
913         ;
914 for_update ::=  statement_expression_list
915         ;
916 statement_expression_list ::=
917                 statement_expression
918         |       statement_expression_list COMMA statement_expression
919         ;
920
921 identifier_opt ::= 
922         |       IDENTIFIER
923         ;
924
925 break_statement ::=
926                 BREAK identifier_opt SEMICOLON
927         ;
928
929 continue_statement ::=
930                 CONTINUE identifier_opt SEMICOLON
931         ;
932 return_statement ::=
933                 RETURN expression_opt SEMICOLON
934         ;
935 throw_statement ::=
936                 THROW expression SEMICOLON
937         ;
938 synchronized_statement ::=
939                 SYNCHRONIZED LPAREN expression RPAREN block
940         ;
941 try_statement ::=
942                 TRY block catches
943         |       TRY block catches_opt finally
944         ;
945 catches_opt ::=
946         |       catches
947         ;
948 catches ::=     catch_clause
949         |       catches catch_clause
950         ;
951 catch_clause ::=
952                 CATCH LPAREN formal_parameter RPAREN block
953         ;
954 finally ::=     FINALLY block
955         ;
956 assert_statement ::=
957                 ASSERT expression SEMICOLON
958         |       ASSERT expression COLON expression SEMICOLON
959         ;
960
961 // 19.12) Expressions
962 primary ::=     primary_no_new_array
963         |       array_creation_init
964         |       array_creation_uninit
965         ;
966 primary_no_new_array ::=
967                 literal
968         |       THIS
969         |       LPAREN name RPAREN
970         |       LPAREN expression_nn RPAREN
971         |       class_instance_creation_expression
972         |       field_access
973         |       method_invocation
974         |       array_access
975         |       name DOT THIS
976         |       VOID DOT CLASS
977         // "Type DOT CLASS", but expanded
978         |       primitive_type DOT CLASS
979         |       primitive_type dims DOT CLASS
980         |       name DOT CLASS
981         |       name dims DOT CLASS
982 //      the following two productions are part of the expansion of
983 //      'type DOT CLASS' but are not actually allowed, as they involve params.
984 //      [see msg from Neal Gafter <3F219367.3070903@sun.com> 25-jul-2003]
985 //      |       class_or_interface type_arguments DOT name dims DOT CLASS
986 //      |       class_or_interface LT type_argument_list_1 dims DOT CLASS
987         ;
988 // grammar distributed with prototype 2.2 is in error; the following is correct
989 //  [ Neal Gafter, <3F2577E0.3090008@sun.com> ]
990 class_instance_creation_expression ::=
991                 NEW class_or_interface_type LPAREN argument_list_opt RPAREN class_body_opt
992         |       NEW type_arguments class_or_interface_type LPAREN argument_list_opt RPAREN class_body_opt
993         |       primary DOT NEW type_arguments_opt IDENTIFIER type_arguments_opt
994                         LPAREN argument_list_opt RPAREN class_body_opt
995         |       name DOT NEW type_arguments_opt IDENTIFIER type_arguments_opt
996                         LPAREN argument_list_opt RPAREN class_body_opt
997         ;
998 argument_list_opt ::=
999         |       argument_list
1000         ;
1001 argument_list ::=
1002                 expression
1003         |       argument_list COMMA expression
1004         ;
1005 array_creation_uninit ::=
1006                 NEW primitive_type dim_exprs dims_opt
1007         |       NEW class_or_interface_type dim_exprs dims_opt
1008         ;
1009 array_creation_init ::=
1010                 NEW primitive_type dims array_initializer
1011         |       NEW class_or_interface_type dims array_initializer
1012         ;
1013 dim_exprs ::=   dim_expr
1014         |       dim_exprs dim_expr
1015         ;
1016 dim_expr ::=    LBRACK expression RBRACK
1017         ;
1018 dims_opt ::=
1019         |       dims
1020         ;
1021 dims ::=        LBRACK RBRACK
1022         |       dims LBRACK RBRACK
1023         ;
1024 field_access ::=
1025                 primary DOT IDENTIFIER
1026         |       SUPER DOT IDENTIFIER
1027         |       name DOT SUPER DOT IDENTIFIER
1028         ;
1029 method_invocation ::=
1030                 name LPAREN argument_list_opt RPAREN
1031 // the following production appeared in the prototype 2.2 spec, but it
1032 // introduces ambiguities in the grammar (consider the expression
1033 //          A((B)<C,D>E());
1034 // which could be either an invocation on E or two boolean comparisons).
1035 // Neal Gafter has assured me that this production should be removed
1036 // from the grammar. <3F256C06.7000600@sun.com>
1037 //      |       type_arguments name LPAREN argument_list_opt RPAREN
1038         |       primary DOT IDENTIFIER LPAREN argument_list_opt RPAREN
1039         |       primary DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN
1040         |       name DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN
1041         |       SUPER DOT IDENTIFIER LPAREN argument_list_opt RPAREN
1042         |       SUPER DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN
1043         |       name DOT SUPER DOT IDENTIFIER LPAREN argument_list_opt RPAREN
1044         |       name DOT SUPER DOT type_arguments IDENTIFIER LPAREN argument_list_opt RPAREN
1045         ;
1046 array_access ::=
1047                 name LBRACK expression RBRACK
1048         |       primary_no_new_array LBRACK expression RBRACK
1049         |       array_creation_init LBRACK expression RBRACK
1050         ;
1051 postfix_expression ::=
1052                 primary
1053         |       name
1054         |       postincrement_expression
1055         |       postdecrement_expression
1056         ;
1057 postincrement_expression ::=
1058                 postfix_expression PLUSPLUS
1059         ;
1060 postdecrement_expression ::=
1061                 postfix_expression MINUSMINUS
1062         ;
1063 unary_expression ::=
1064                 preincrement_expression
1065         |       predecrement_expression
1066         |       PLUS unary_expression
1067         |       MINUS unary_expression
1068         |       unary_expression_not_plus_minus
1069         ;
1070 preincrement_expression ::=
1071                 PLUSPLUS unary_expression
1072         ;
1073 predecrement_expression ::=
1074                 MINUSMINUS unary_expression
1075         ;
1076 unary_expression_not_plus_minus ::=
1077                 postfix_expression
1078         |       COMP unary_expression
1079         |       NOT unary_expression
1080         |       cast_expression
1081         ;
1082 // This parsing technique was discovered by Eric Blake <ebb9@email.byu.edu>
1083 // We solving grammar ambiguities with between parenthesized less-than
1084 // relational operations and type casts with a slightly-more-complicated
1085 // cast_expression production.
1086 // Illustrative example:  LPAREN name LT name ...
1087 //  is this going to be a cast_expression or a relational_expression?
1088 // canonically, this production is:
1089 //     cast_expression ::= LPAREN type RPAREN unary_expression_not_plus_minus
1090 cast_expression ::=
1091                 LPAREN primitive_type dims_opt RPAREN unary_expression
1092         |       LPAREN name RPAREN unary_expression_not_plus_minus
1093         |       LPAREN name dims RPAREN unary_expression_not_plus_minus
1094         |       LPAREN name LT type_argument_list_1 dims_opt RPAREN
1095                         unary_expression_not_plus_minus
1096         |       LPAREN name LT type_argument_list_1 DOT
1097                         class_or_interface_type dims_opt RPAREN
1098                         unary_expression_not_plus_minus
1099         ;
1100 multiplicative_expression ::=
1101                 unary_expression
1102         |       multiplicative_expression MULT unary_expression
1103         |       multiplicative_expression DIV unary_expression
1104         |       multiplicative_expression MOD unary_expression
1105         ;
1106 additive_expression ::=
1107                 multiplicative_expression
1108         |       additive_expression PLUS multiplicative_expression
1109         |       additive_expression MINUS multiplicative_expression
1110         ;
1111 shift_expression ::=
1112                 additive_expression
1113         |       shift_expression LSHIFT additive_expression
1114         |       shift_expression RSHIFT additive_expression
1115         |       shift_expression URSHIFT additive_expression
1116         ;
1117 relational_expression ::=
1118                 shift_expression
1119         |       relational_expression LT shift_expression
1120         |       relational_expression GT shift_expression
1121         |       relational_expression LTEQ shift_expression
1122         |       relational_expression GTEQ shift_expression
1123         ;
1124 // we lower the precendence of instanceof to resolve a grammar ambiguity.
1125 // semantics are unchanged, since relational expressions do not operate
1126 // on boolean.  Eric Blake had a different solution here, where he
1127 // used the production 'shift_expression LT shift_expression' to solve
1128 // the same problem.
1129 instanceof_expression ::=
1130                 relational_expression
1131         |       instanceof_expression INSTANCEOF reference_type
1132         ;
1133 equality_expression ::=
1134                 instanceof_expression
1135         |       equality_expression EQEQ instanceof_expression
1136         |       equality_expression NOTEQ instanceof_expression
1137         ;
1138 and_expression ::=
1139                 equality_expression
1140         |       and_expression AND equality_expression
1141         ;
1142 exclusive_or_expression ::=
1143                 and_expression
1144         |       exclusive_or_expression XOR and_expression
1145         ;
1146 inclusive_or_expression ::=
1147                 exclusive_or_expression
1148         |       inclusive_or_expression OR exclusive_or_expression
1149         ;
1150 conditional_and_expression ::=
1151                 inclusive_or_expression
1152         |       conditional_and_expression ANDAND inclusive_or_expression
1153         ;
1154 conditional_or_expression ::=
1155                 conditional_and_expression
1156         |       conditional_or_expression OROR conditional_and_expression
1157         ;
1158 conditional_expression ::=
1159                 conditional_or_expression
1160         |       conditional_or_expression QUESTION expression 
1161                         COLON conditional_expression
1162         ;
1163 assignment_expression ::=
1164                 conditional_expression
1165         |       assignment
1166         ;
1167 // semantic check necessary here to ensure a valid left-hand side.
1168 // allowing a parenthesized variable here on the lhs was introduced in
1169 // JLS 2; thanks to Eric Blake for pointing this out.
1170 assignment ::=  postfix_expression assignment_operator assignment_expression
1171         ;
1172 assignment_operator ::=
1173                 EQ
1174         |       MULTEQ
1175         |       DIVEQ
1176         |       MODEQ
1177         |       PLUSEQ
1178         |       MINUSEQ
1179         |       LSHIFTEQ
1180         |       RSHIFTEQ
1181         |       URSHIFTEQ
1182         |       ANDEQ
1183         |       XOREQ
1184         |       OREQ
1185         ;
1186 expression_opt ::=
1187         |       expression
1188         ;
1189 expression ::=  assignment_expression
1190         ;
1191 // note that this constraint must be enforced during semantic checking
1192 // 'constant_expression' should include enumerated constants.
1193 constant_expression ::=
1194                 expression
1195         ;
1196
1197 // JLS-14 productions.
1198 type_parameters_opt ::= type_parameters | ;
1199 type_parameters ::=
1200                 LT type_parameter_list_1
1201         ;
1202 type_parameter_list ::=
1203                 type_parameter_list COMMA type_parameter
1204         |       type_parameter
1205         ;
1206 type_parameter_list_1 ::=
1207                 type_parameter_1
1208         |       type_parameter_list COMMA type_parameter_1
1209         ;
1210 type_parameter ::=
1211                 type_variable type_bound_opt
1212         ;
1213 type_parameter_1 ::=
1214                 type_variable GT
1215         |       type_variable type_bound_1
1216         ;
1217 type_bound_opt ::= type_bound | ;
1218 type_bound ::=
1219                 EXTENDS reference_type additional_bound_list_opt
1220         ;
1221 type_bound_1 ::=
1222                 EXTENDS reference_type_1
1223         |       EXTENDS reference_type additional_bound_list_1
1224         ;
1225 additional_bound_list_opt ::= additional_bound_list | ;
1226 additional_bound_list ::=
1227                 additional_bound additional_bound_list
1228         |       additional_bound
1229         ;
1230 additional_bound_list_1 ::=
1231                 additional_bound additional_bound_list_1
1232         |       additional_bound_1
1233         ;
1234 additional_bound ::=
1235                 AND interface_type
1236         ;
1237 additional_bound_1 ::=
1238                 AND reference_type_1
1239         ;
1240 //////////////////////////////////////////////
1241 // the following productions are copied from the standard ones, but
1242 // 'name' all alone is not allowed.  The '_nn' stands for 'not name'.
1243 // we also expand the productions so that they recursively depend on the
1244 // '_nn' forms of their left hand side, then adding a new production
1245 // with 'name' explicit on the left-hand side.
1246 // this allows us to postpone the decision whether '(x)' is an expression
1247 // or a type-cast until we can see enough right context to make the proper
1248 // choice.
1249 postfix_expression_nn ::=
1250                 primary
1251         // the 'name' production was removed here.
1252         |       postincrement_expression
1253         |       postdecrement_expression
1254         ;
1255 unary_expression_nn ::=
1256                 preincrement_expression
1257         |       predecrement_expression
1258         |       PLUS unary_expression
1259         |       MINUS unary_expression
1260         |       unary_expression_not_plus_minus_nn
1261         ;
1262 unary_expression_not_plus_minus_nn ::=
1263                 postfix_expression_nn
1264         |       COMP unary_expression
1265         |       NOT unary_expression
1266         |       cast_expression
1267         ;
1268 multiplicative_expression_nn ::=
1269                 unary_expression_nn
1270         |       name                         MULT unary_expression
1271         |       multiplicative_expression_nn MULT unary_expression
1272         |       name                         DIV unary_expression
1273         |       multiplicative_expression_nn DIV unary_expression
1274         |       name                         MOD unary_expression
1275         |       multiplicative_expression_nn MOD unary_expression
1276         ;
1277 additive_expression_nn ::=
1278                 multiplicative_expression_nn
1279         |       name                   PLUS multiplicative_expression
1280         |       additive_expression_nn PLUS multiplicative_expression
1281         |       name                   MINUS multiplicative_expression
1282         |       additive_expression_nn MINUS multiplicative_expression
1283         ;
1284 shift_expression_nn ::=
1285                 additive_expression_nn
1286         |       name                LSHIFT additive_expression
1287         |       shift_expression_nn LSHIFT additive_expression
1288         |       name                RSHIFT additive_expression
1289         |       shift_expression_nn RSHIFT additive_expression
1290         |       name                URSHIFT additive_expression
1291         |       shift_expression_nn URSHIFT additive_expression
1292         ;
1293 relational_expression_nn ::=
1294                 shift_expression_nn
1295         // note that we've tweaked the productions for LT/GT to disallow
1296         //  a<b<c as a valid expression.  This avoids ambiguity with
1297         //  parameterized types in casts.
1298         |       name                LT shift_expression
1299         |       shift_expression_nn LT shift_expression
1300         |       name                GT shift_expression
1301         |       shift_expression_nn GT shift_expression
1302         |       name                     LTEQ shift_expression
1303         |       relational_expression_nn LTEQ shift_expression
1304         |       name                     GTEQ shift_expression
1305         |       relational_expression_nn GTEQ shift_expression
1306         ;
1307 instanceof_expression_nn ::=
1308                 relational_expression_nn
1309         |       name                     INSTANCEOF reference_type
1310         |       instanceof_expression_nn INSTANCEOF reference_type
1311         ;
1312 equality_expression_nn ::=
1313                 instanceof_expression_nn
1314         |       name                   EQEQ instanceof_expression
1315         |       equality_expression_nn EQEQ instanceof_expression
1316         |       name                   NOTEQ instanceof_expression
1317         |       equality_expression_nn NOTEQ instanceof_expression
1318         ;
1319 and_expression_nn ::=
1320                 equality_expression_nn
1321         |       name              AND equality_expression
1322         |       and_expression_nn AND equality_expression
1323         ;
1324 exclusive_or_expression_nn ::=
1325                 and_expression_nn
1326         |       name                       XOR and_expression
1327         |       exclusive_or_expression_nn XOR and_expression
1328         ;
1329 inclusive_or_expression_nn ::=
1330                 exclusive_or_expression_nn
1331         |       name                       OR exclusive_or_expression
1332         |       inclusive_or_expression_nn OR exclusive_or_expression
1333         ;
1334 conditional_and_expression_nn ::=
1335                 inclusive_or_expression_nn
1336         |       name                          ANDAND inclusive_or_expression
1337         |       conditional_and_expression_nn ANDAND inclusive_or_expression
1338         ;
1339 conditional_or_expression_nn ::=
1340                 conditional_and_expression_nn
1341         |       name                         OROR conditional_and_expression
1342         |       conditional_or_expression_nn OROR conditional_and_expression
1343         ;
1344 conditional_expression_nn ::=
1345                 conditional_or_expression_nn
1346         |       name QUESTION expression COLON conditional_expression
1347         |       conditional_or_expression_nn QUESTION expression 
1348                         COLON conditional_expression
1349         ;
1350 assignment_expression_nn ::=
1351                 conditional_expression_nn
1352         |       assignment
1353         ;
1354 expression_nn ::=       assignment_expression_nn
1355         ;