blob: d2b58f23e927ff4ea40cce975a155cc869d1aa65 [file] [log] [blame]
Stephan Herrmann7b7062f2010-04-01 19:56:59 +00001--main options
2%options ACTION, AN=JavaAction.java, GP=java,
3%options FILE-PREFIX=java, ESCAPE=$, PREFIX=TokenName, OUTPUT-SIZE=125 ,
4%options NOGOTO-DEFAULT, SINGLE-PRODUCTIONS, LALR=1 , TABLE,
5
6--error recovering options.....
7%options ERROR_MAPS
8
9--grammar understanding options
10%options first follow
11%options TRACE=FULL ,
12%options VERBOSE
13
14%options DEFERRED
15%options NAMES=MAX
16%options SCOPES
17
18--Usefull macros helping reading/writing semantic actions
19$Define
20$putCase
21/. case $rule_number : if (DEBUG) { System.out.println("$rule_text"); } //$NON-NLS-1$
22 ./
23
24$break
25/.
26 break;
27./
28
29
30$readableName
31/.1#$rule_number#./
32$compliance
33/.2#$rule_number#./
34$recovery
35/.2#$rule_number# recovery./
36$recovery_template
37/.3#$rule_number#./
38$no_statements_recovery
39/.4#$rule_number# 1./
40-- here it starts really ------------------------------------------
41$Terminals
42
43 Identifier
44
45 abstract assert boolean break byte case catch char class
46 continue const default do double else enum extends false final finally float
47 for goto if implements import instanceof int
48 interface long native new null package private
49 protected public return short static strictfp super switch
50 synchronized this throw throws transient true try void
51 volatile while
52
53 IntegerLiteral
54 LongLiteral
55 FloatingPointLiteral
56 DoubleLiteral
57 CharacterLiteral
58 StringLiteral
59
60 PLUS_PLUS
61 MINUS_MINUS
62 EQUAL_EQUAL
63 LESS_EQUAL
64 GREATER_EQUAL
65 NOT_EQUAL
66 LEFT_SHIFT
67 RIGHT_SHIFT
68 UNSIGNED_RIGHT_SHIFT
69 PLUS_EQUAL
70 MINUS_EQUAL
71 MULTIPLY_EQUAL
72 DIVIDE_EQUAL
73 AND_EQUAL
74 OR_EQUAL
75 XOR_EQUAL
76 REMAINDER_EQUAL
77 LEFT_SHIFT_EQUAL
78 RIGHT_SHIFT_EQUAL
79 UNSIGNED_RIGHT_SHIFT_EQUAL
80 OR_OR
81 AND_AND
82 PLUS
83 MINUS
84 NOT
85 REMAINDER
86 XOR
87 AND
88 MULTIPLY
89 OR
90 TWIDDLE
91 DIVIDE
92 GREATER
93 LESS
94 LPAREN
95 RPAREN
96 LBRACE
97 RBRACE
98 LBRACKET
99 RBRACKET
100 SEMICOLON
101 QUESTION
102 COLON
103 COMMA
104 DOT
105 EQUAL
106 AT
107 ELLIPSIS
108
109-- BodyMarker
110
111$Alias
112
113 '++' ::= PLUS_PLUS
114 '--' ::= MINUS_MINUS
115 '==' ::= EQUAL_EQUAL
116 '<=' ::= LESS_EQUAL
117 '>=' ::= GREATER_EQUAL
118 '!=' ::= NOT_EQUAL
119 '<<' ::= LEFT_SHIFT
120 '>>' ::= RIGHT_SHIFT
121 '>>>' ::= UNSIGNED_RIGHT_SHIFT
122 '+=' ::= PLUS_EQUAL
123 '-=' ::= MINUS_EQUAL
124 '*=' ::= MULTIPLY_EQUAL
125 '/=' ::= DIVIDE_EQUAL
126 '&=' ::= AND_EQUAL
127 '|=' ::= OR_EQUAL
128 '^=' ::= XOR_EQUAL
129 '%=' ::= REMAINDER_EQUAL
130 '<<=' ::= LEFT_SHIFT_EQUAL
131 '>>=' ::= RIGHT_SHIFT_EQUAL
132 '>>>=' ::= UNSIGNED_RIGHT_SHIFT_EQUAL
133 '||' ::= OR_OR
134 '&&' ::= AND_AND
135 '+' ::= PLUS
136 '-' ::= MINUS
137 '!' ::= NOT
138 '%' ::= REMAINDER
139 '^' ::= XOR
140 '&' ::= AND
141 '*' ::= MULTIPLY
142 '|' ::= OR
143 '~' ::= TWIDDLE
144 '/' ::= DIVIDE
145 '>' ::= GREATER
146 '<' ::= LESS
147 '(' ::= LPAREN
148 ')' ::= RPAREN
149 '{' ::= LBRACE
150 '}' ::= RBRACE
151 '[' ::= LBRACKET
152 ']' ::= RBRACKET
153 ';' ::= SEMICOLON
154 '?' ::= QUESTION
155 ':' ::= COLON
156 ',' ::= COMMA
157 '.' ::= DOT
158 '=' ::= EQUAL
159 '@' ::= AT
160 '...' ::= ELLIPSIS
161
162$Start
163 Goal
164
165$Rules
166
167/.// This method is part of an automatic generation : do NOT edit-modify
168protected void consumeRule(int act) {
169 switch ( act ) {
170./
171
172
173
174Goal ::= '++' CompilationUnit
175Goal ::= '--' MethodBody
176-- Initializer
177Goal ::= '>>' StaticInitializer
178Goal ::= '>>' Initializer
179-- error recovery
180-- Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method
181Goal ::= '>>>' Header1 Modifiersopt
182Goal ::= '!' Header2 Modifiersopt
183Goal ::= '*' BlockStatements
184Goal ::= '*' CatchHeader
185-- JDOM
186Goal ::= '&&' FieldDeclaration
187Goal ::= '||' ImportDeclaration
188Goal ::= '?' PackageDeclaration
189Goal ::= '+' TypeDeclaration
190Goal ::= '/' GenericMethodDeclaration
191Goal ::= '&' ClassBodyDeclarations
192-- code snippet
193Goal ::= '%' Expression
194Goal ::= '%' ArrayInitializer
195-- completion parser
196Goal ::= '~' BlockStatementsopt
197-- source type converter
198Goal ::= '||' MemberValue
199-- syntax diagnosis
200Goal ::= '?' AnnotationTypeMemberDeclaration
201/:$readableName Goal:/
202
203Literal -> IntegerLiteral
204Literal -> LongLiteral
205Literal -> FloatingPointLiteral
206Literal -> DoubleLiteral
207Literal -> CharacterLiteral
208Literal -> StringLiteral
209Literal -> null
210Literal -> BooleanLiteral
211/:$readableName Literal:/
212BooleanLiteral -> true
213BooleanLiteral -> false
214/:$readableName BooleanLiteral:/
215
216Type ::= PrimitiveType
217/.$putCase consumePrimitiveType(); $break ./
218Type -> ReferenceType
219/:$readableName Type:/
220
221PrimitiveType -> NumericType
222/:$readableName PrimitiveType:/
223NumericType -> IntegralType
224NumericType -> FloatingPointType
225/:$readableName NumericType:/
226
227PrimitiveType -> 'boolean'
228PrimitiveType -> 'void'
229IntegralType -> 'byte'
230IntegralType -> 'short'
231IntegralType -> 'int'
232IntegralType -> 'long'
233IntegralType -> 'char'
234/:$readableName IntegralType:/
235FloatingPointType -> 'float'
236FloatingPointType -> 'double'
237/:$readableName FloatingPointType:/
238
239ReferenceType ::= ClassOrInterfaceType
240/.$putCase consumeReferenceType(); $break ./
241ReferenceType -> ArrayType
242/:$readableName ReferenceType:/
243
244---------------------------------------------------------------
245-- 1.5 feature
246---------------------------------------------------------------
247ClassOrInterfaceType -> ClassOrInterface
248ClassOrInterfaceType -> GenericType
249/:$readableName Type:/
250
251ClassOrInterface ::= Name
252/.$putCase consumeClassOrInterfaceName(); $break ./
253ClassOrInterface ::= GenericType '.' Name
254/.$putCase consumeClassOrInterface(); $break ./
255/:$readableName Type:/
256
257GenericType ::= ClassOrInterface TypeArguments
258/.$putCase consumeGenericType(); $break ./
259/:$readableName GenericType:/
260
261--
262-- These rules have been rewritten to avoid some conflicts introduced
263-- by adding the 1.1 features
264--
265-- ArrayType ::= PrimitiveType '[' ']'
266-- ArrayType ::= Name '[' ']'
267-- ArrayType ::= ArrayType '[' ']'
268--
269
270ArrayTypeWithTypeArgumentsName ::= GenericType '.' Name
271/.$putCase consumeArrayTypeWithTypeArgumentsName(); $break ./
272/:$readableName ArrayTypeWithTypeArgumentsName:/
273
274ArrayType ::= PrimitiveType Dims
275/.$putCase consumePrimitiveArrayType(); $break ./
276ArrayType ::= Name Dims
277/.$putCase consumeNameArrayType(); $break ./
278ArrayType ::= ArrayTypeWithTypeArgumentsName Dims
279/.$putCase consumeGenericTypeNameArrayType(); $break ./
280ArrayType ::= GenericType Dims
281/.$putCase consumeGenericTypeArrayType(); $break ./
282/:$readableName ArrayType:/
283
284ClassType -> ClassOrInterfaceType
285/:$readableName ClassType:/
286
287--------------------------------------------------------------
288--------------------------------------------------------------
289
290Name -> SimpleName
291Name -> QualifiedName
292/:$readableName Name:/
293/:$recovery_template Identifier:/
294
295SimpleName -> 'Identifier'
296/:$readableName SimpleName:/
297
298QualifiedName ::= Name '.' SimpleName
299/.$putCase consumeQualifiedName(); $break ./
300/:$readableName QualifiedName:/
301
302CompilationUnit ::= EnterCompilationUnit InternalCompilationUnit
303/.$putCase consumeCompilationUnit(); $break ./
304/:$readableName CompilationUnit:/
305
306InternalCompilationUnit ::= PackageDeclaration
307/.$putCase consumeInternalCompilationUnit(); $break ./
308InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports
309/.$putCase consumeInternalCompilationUnit(); $break ./
310InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports TypeDeclarations
311/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
312InternalCompilationUnit ::= PackageDeclaration TypeDeclarations
313/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
314InternalCompilationUnit ::= ImportDeclarations ReduceImports
315/.$putCase consumeInternalCompilationUnit(); $break ./
316InternalCompilationUnit ::= TypeDeclarations
317/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
318InternalCompilationUnit ::= ImportDeclarations ReduceImports TypeDeclarations
319/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
320InternalCompilationUnit ::= $empty
321/.$putCase consumeEmptyInternalCompilationUnit(); $break ./
322/:$readableName CompilationUnit:/
323
324
325
326
327ReduceImports ::= $empty
328/.$putCase consumeReduceImports(); $break ./
329/:$readableName ReduceImports:/
330
331EnterCompilationUnit ::= $empty
332/.$putCase consumeEnterCompilationUnit(); $break ./
333/:$readableName EnterCompilationUnit:/
334
335Header -> ImportDeclaration
336Header -> PackageDeclaration
337Header -> ClassHeader
338Header -> InterfaceHeader
339Header -> EnumHeader
340Header -> AnnotationTypeDeclarationHeader
341Header -> StaticInitializer
342Header -> RecoveryMethodHeader
343Header -> FieldDeclaration
344Header -> AllocationHeader
345Header -> ArrayCreationHeader
346/:$readableName Header:/
347
348Header1 -> Header
349Header1 -> ConstructorHeader
350/:$readableName Header1:/
351
352Header2 -> Header
353Header2 -> EnumConstantHeader
354/:$readableName Header2:/
355
356CatchHeader ::= 'catch' '(' FormalParameter ')' '{'
357/.$putCase consumeCatchHeader(); $break ./
358/:$readableName CatchHeader:/
359
360ImportDeclarations -> ImportDeclaration
361ImportDeclarations ::= ImportDeclarations ImportDeclaration
362/.$putCase consumeImportDeclarations(); $break ./
363/:$readableName ImportDeclarations:/
364
365TypeDeclarations -> TypeDeclaration
366TypeDeclarations ::= TypeDeclarations TypeDeclaration
367/.$putCase consumeTypeDeclarations(); $break ./
368/:$readableName TypeDeclarations:/
369
370PackageDeclaration ::= PackageDeclarationName ';'
371/.$putCase consumePackageDeclaration(); $break ./
372/:$readableName PackageDeclaration:/
373
374PackageDeclarationName ::= Modifiers 'package' PushRealModifiers Name
375/.$putCase consumePackageDeclarationNameWithModifiers(); $break ./
376/:$readableName PackageDeclarationName:/
377/:$compliance 1.5:/
378
379PackageDeclarationName ::= PackageComment 'package' Name
380/.$putCase consumePackageDeclarationName(); $break ./
381/:$readableName PackageDeclarationName:/
382
383PackageComment ::= $empty
384/.$putCase consumePackageComment(); $break ./
385/:$readableName PackageComment:/
386
387ImportDeclaration -> SingleTypeImportDeclaration
388ImportDeclaration -> TypeImportOnDemandDeclaration
389-----------------------------------------------
390-- 1.5 feature
391-----------------------------------------------
392ImportDeclaration -> SingleStaticImportDeclaration
393ImportDeclaration -> StaticImportOnDemandDeclaration
394/:$readableName ImportDeclaration:/
395
396SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';'
397/.$putCase consumeImportDeclaration(); $break ./
398/:$readableName SingleTypeImportDeclaration:/
399
400SingleTypeImportDeclarationName ::= 'import' Name
401/.$putCase consumeSingleTypeImportDeclarationName(); $break ./
402/:$readableName SingleTypeImportDeclarationName:/
403
404TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName ';'
405/.$putCase consumeImportDeclaration(); $break ./
406/:$readableName TypeImportOnDemandDeclaration:/
407
408TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*'
409/.$putCase consumeTypeImportOnDemandDeclarationName(); $break ./
410/:$readableName TypeImportOnDemandDeclarationName:/
411
412TypeDeclaration -> ClassDeclaration
413TypeDeclaration -> InterfaceDeclaration
414-- this declaration in part of a list od declaration and we will
415-- use and optimized list length calculation process
416-- thus we decrement the number while it will be incremend.....
417TypeDeclaration ::= ';'
418/. $putCase consumeEmptyTypeDeclaration(); $break ./
419-----------------------------------------------
420-- 1.5 feature
421-----------------------------------------------
422TypeDeclaration -> EnumDeclaration
423TypeDeclaration -> AnnotationTypeDeclaration
424/:$readableName TypeDeclaration:/
425
426--18.7 Only in the LALR(1) Grammar
427
428Modifiers -> Modifier
429Modifiers ::= Modifiers Modifier
430/.$putCase consumeModifiers2(); $break ./
431/:$readableName Modifiers:/
432
433Modifier -> 'public'
434Modifier -> 'protected'
435Modifier -> 'private'
436Modifier -> 'static'
437Modifier -> 'abstract'
438Modifier -> 'final'
439Modifier -> 'native'
440Modifier -> 'synchronized'
441Modifier -> 'transient'
442Modifier -> 'volatile'
443Modifier -> 'strictfp'
444Modifier ::= Annotation
445/.$putCase consumeAnnotationAsModifier(); $break ./
446/:$readableName Modifier:/
447
448--18.8 Productions from 8: Class Declarations
449--ClassModifier ::=
450-- 'abstract'
451-- | 'final'
452-- | 'public'
453--18.8.1 Productions from 8.1: Class Declarations
454
455ClassDeclaration ::= ClassHeader ClassBody
456/.$putCase consumeClassDeclaration(); $break ./
457/:$readableName ClassDeclaration:/
458
459ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt
460/.$putCase consumeClassHeader(); $break ./
461/:$readableName ClassHeader:/
462
463-----------------------------------------------
464-- 1.5 features : generics
465-----------------------------------------------
466ClassHeaderName ::= ClassHeaderName1 TypeParameters
467/.$putCase consumeTypeHeaderNameWithTypeParameters(); $break ./
468
469ClassHeaderName -> ClassHeaderName1
470/:$readableName ClassHeaderName:/
471
472ClassHeaderName1 ::= Modifiersopt 'class' 'Identifier'
473/.$putCase consumeClassHeaderName1(); $break ./
474/:$readableName ClassHeaderName:/
475
476ClassHeaderExtends ::= 'extends' ClassType
477/.$putCase consumeClassHeaderExtends(); $break ./
478/:$readableName ClassHeaderExtends:/
479
480ClassHeaderImplements ::= 'implements' InterfaceTypeList
481/.$putCase consumeClassHeaderImplements(); $break ./
482/:$readableName ClassHeaderImplements:/
483
484InterfaceTypeList -> InterfaceType
485InterfaceTypeList ::= InterfaceTypeList ',' InterfaceType
486/.$putCase consumeInterfaceTypeList(); $break ./
487/:$readableName InterfaceTypeList:/
488
489InterfaceType ::= ClassOrInterfaceType
490/.$putCase consumeInterfaceType(); $break ./
491/:$readableName InterfaceType:/
492
493ClassBody ::= '{' ClassBodyDeclarationsopt '}'
494/:$readableName ClassBody:/
495/:$no_statements_recovery:/
496
497ClassBodyDeclarations ::= ClassBodyDeclaration
498ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration
499/.$putCase consumeClassBodyDeclarations(); $break ./
500/:$readableName ClassBodyDeclarations:/
501
502ClassBodyDeclaration -> ClassMemberDeclaration
503ClassBodyDeclaration -> StaticInitializer
504ClassBodyDeclaration -> ConstructorDeclaration
505--1.1 feature
506ClassBodyDeclaration ::= Diet NestedMethod CreateInitializer Block
507/.$putCase consumeClassBodyDeclaration(); $break ./
508/:$readableName ClassBodyDeclaration:/
509
510Diet ::= $empty
511/.$putCase consumeDiet(); $break./
512/:$readableName Diet:/
513
514Initializer ::= Diet NestedMethod CreateInitializer Block
515/.$putCase consumeClassBodyDeclaration(); $break ./
516/:$readableName Initializer:/
517
518CreateInitializer ::= $empty
519/.$putCase consumeCreateInitializer(); $break./
520/:$readableName CreateInitializer:/
521
522ClassMemberDeclaration -> FieldDeclaration
523ClassMemberDeclaration -> MethodDeclaration
524--1.1 feature
525ClassMemberDeclaration -> ClassDeclaration
526--1.1 feature
527ClassMemberDeclaration -> InterfaceDeclaration
528-- 1.5 feature
529ClassMemberDeclaration -> EnumDeclaration
530ClassMemberDeclaration -> AnnotationTypeDeclaration
531/:$readableName ClassMemberDeclaration:/
532
533-- Empty declarations are not valid Java ClassMemberDeclarations.
534-- However, since the current (2/14/97) Java compiler accepts them
535-- (in fact, some of the official tests contain this erroneous
536-- syntax)
537ClassMemberDeclaration ::= ';'
538/.$putCase consumeEmptyTypeDeclaration(); $break./
539
540GenericMethodDeclaration -> MethodDeclaration
541GenericMethodDeclaration -> ConstructorDeclaration
542/:$readableName GenericMethodDeclaration:/
543
544--18.8.2 Productions from 8.3: Field Declarations
545--VariableModifier ::=
546-- 'public'
547-- | 'protected'
548-- | 'private'
549-- | 'static'
550-- | 'final'
551-- | 'transient'
552-- | 'volatile'
553
554FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';'
555/.$putCase consumeFieldDeclaration(); $break ./
556/:$readableName FieldDeclaration:/
557
558VariableDeclarators -> VariableDeclarator
559VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator
560/.$putCase consumeVariableDeclarators(); $break ./
561/:$readableName VariableDeclarators:/
562
563VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization
564VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
565/:$readableName VariableDeclarator:/
566/:$recovery_template Identifier:/
567
568EnterVariable ::= $empty
569/.$putCase consumeEnterVariable(); $break ./
570/:$readableName EnterVariable:/
571
572ExitVariableWithInitialization ::= $empty
573/.$putCase consumeExitVariableWithInitialization(); $break ./
574/:$readableName ExitVariableWithInitialization:/
575
576ExitVariableWithoutInitialization ::= $empty
577/.$putCase consumeExitVariableWithoutInitialization(); $break ./
578/:$readableName ExitVariableWithoutInitialization:/
579
580ForceNoDiet ::= $empty
581/.$putCase consumeForceNoDiet(); $break ./
582/:$readableName ForceNoDiet:/
583RestoreDiet ::= $empty
584/.$putCase consumeRestoreDiet(); $break ./
585/:$readableName RestoreDiet:/
586
587VariableDeclaratorId ::= 'Identifier' Dimsopt
588/:$readableName VariableDeclaratorId:/
589/:$recovery_template Identifier:/
590
591VariableInitializer -> Expression
592VariableInitializer -> ArrayInitializer
593/:$readableName VariableInitializer:/
594/:$recovery_template Identifier:/
595
596--18.8.3 Productions from 8.4: Method Declarations
597--MethodModifier ::=
598-- 'public'
599-- | 'protected'
600-- | 'private'
601-- | 'static'
602-- | 'abstract'
603-- | 'final'
604-- | 'native'
605-- | 'synchronized'
606--
607
608MethodDeclaration -> AbstractMethodDeclaration
609MethodDeclaration ::= MethodHeader MethodBody
610/.$putCase // set to true to consume a method with a body
611 consumeMethodDeclaration(true); $break ./
612/:$readableName MethodDeclaration:/
613
614AbstractMethodDeclaration ::= MethodHeader ';'
615/.$putCase // set to false to consume a method without body
616 consumeMethodDeclaration(false); $break ./
617/:$readableName MethodDeclaration:/
618
619MethodHeader ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClauseopt
620/.$putCase consumeMethodHeader(); $break ./
621/:$readableName MethodDeclaration:/
622
623MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
624/.$putCase consumeMethodHeaderNameWithTypeParameters(false); $break ./
625MethodHeaderName ::= Modifiersopt Type 'Identifier' '('
626/.$putCase consumeMethodHeaderName(false); $break ./
627/:$readableName MethodHeaderName:/
628
629MethodHeaderRightParen ::= ')'
630/.$putCase consumeMethodHeaderRightParen(); $break ./
631/:$readableName ):/
632/:$recovery_template ):/
633
634MethodHeaderExtendedDims ::= Dimsopt
635/.$putCase consumeMethodHeaderExtendedDims(); $break ./
636/:$readableName MethodHeaderExtendedDims:/
637
638MethodHeaderThrowsClause ::= 'throws' ClassTypeList
639/.$putCase consumeMethodHeaderThrowsClause(); $break ./
640/:$readableName MethodHeaderThrowsClause:/
641
642ConstructorHeader ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderThrowsClauseopt
643/.$putCase consumeConstructorHeader(); $break ./
644/:$readableName ConstructorDeclaration:/
645
646ConstructorHeaderName ::= Modifiersopt TypeParameters 'Identifier' '('
647/.$putCase consumeConstructorHeaderNameWithTypeParameters(); $break ./
648ConstructorHeaderName ::= Modifiersopt 'Identifier' '('
649/.$putCase consumeConstructorHeaderName(); $break ./
650/:$readableName ConstructorHeaderName:/
651
652FormalParameterList -> FormalParameter
653FormalParameterList ::= FormalParameterList ',' FormalParameter
654/.$putCase consumeFormalParameterList(); $break ./
655/:$readableName FormalParameterList:/
656
657--1.1 feature
658FormalParameter ::= Modifiersopt Type VariableDeclaratorId
659/.$putCase consumeFormalParameter(false); $break ./
660FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId
661/.$putCase consumeFormalParameter(true); $break ./
662/:$readableName FormalParameter:/
663/:$compliance 1.5:/
664/:$recovery_template Identifier Identifier:/
665
666ClassTypeList -> ClassTypeElt
667ClassTypeList ::= ClassTypeList ',' ClassTypeElt
668/.$putCase consumeClassTypeList(); $break ./
669/:$readableName ClassTypeList:/
670
671ClassTypeElt ::= ClassType
672/.$putCase consumeClassTypeElt(); $break ./
673/:$readableName ClassType:/
674
675MethodBody ::= NestedMethod '{' BlockStatementsopt '}'
676/.$putCase consumeMethodBody(); $break ./
677/:$readableName MethodBody:/
678/:$no_statements_recovery:/
679
680NestedMethod ::= $empty
681/.$putCase consumeNestedMethod(); $break ./
682/:$readableName NestedMethod:/
683
684--18.8.4 Productions from 8.5: Static Initializers
685
686StaticInitializer ::= StaticOnly Block
687/.$putCase consumeStaticInitializer(); $break./
688/:$readableName StaticInitializer:/
689
690StaticOnly ::= 'static'
691/.$putCase consumeStaticOnly(); $break ./
692/:$readableName StaticOnly:/
693
694--18.8.5 Productions from 8.6: Constructor Declarations
695--ConstructorModifier ::=
696-- 'public'
697-- | 'protected'
698-- | 'private'
699--
700--
701ConstructorDeclaration ::= ConstructorHeader MethodBody
702/.$putCase consumeConstructorDeclaration() ; $break ./
703-- These rules are added to be able to parse constructors with no body
704ConstructorDeclaration ::= ConstructorHeader ';'
705/.$putCase consumeInvalidConstructorDeclaration() ; $break ./
706/:$readableName ConstructorDeclaration:/
707
708-- the rules ExplicitConstructorInvocationopt has been expanded
709-- in the rule below in order to make the grammar lalr(1).
710
711ExplicitConstructorInvocation ::= 'this' '(' ArgumentListopt ')' ';'
712/.$putCase consumeExplicitConstructorInvocation(0, THIS_CALL); $break ./
713
714ExplicitConstructorInvocation ::= OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
715/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL); $break ./
716
717ExplicitConstructorInvocation ::= 'super' '(' ArgumentListopt ')' ';'
718/.$putCase consumeExplicitConstructorInvocation(0,SUPER_CALL); $break ./
719
720ExplicitConstructorInvocation ::= OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
721/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL); $break ./
722
723--1.1 feature
724ExplicitConstructorInvocation ::= Primary '.' 'super' '(' ArgumentListopt ')' ';'
725/.$putCase consumeExplicitConstructorInvocation(1, SUPER_CALL); $break ./
726
727ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
728/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL); $break ./
729
730--1.1 feature
731ExplicitConstructorInvocation ::= Name '.' 'super' '(' ArgumentListopt ')' ';'
732/.$putCase consumeExplicitConstructorInvocation(2, SUPER_CALL); $break ./
733
734ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
735/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL); $break ./
736
737--1.1 feature
738ExplicitConstructorInvocation ::= Primary '.' 'this' '(' ArgumentListopt ')' ';'
739/.$putCase consumeExplicitConstructorInvocation(1, THIS_CALL); $break ./
740
741ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
742/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL); $break ./
743
744--1.1 feature
745ExplicitConstructorInvocation ::= Name '.' 'this' '(' ArgumentListopt ')' ';'
746/.$putCase consumeExplicitConstructorInvocation(2, THIS_CALL); $break ./
747
748ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
749/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL); $break ./
750/:$readableName ExplicitConstructorInvocation:/
751
752--18.9 Productions from 9: Interface Declarations
753
754--18.9.1 Productions from 9.1: Interface Declarations
755--InterfaceModifier ::=
756-- 'public'
757-- | 'abstract'
758--
759InterfaceDeclaration ::= InterfaceHeader InterfaceBody
760/.$putCase consumeInterfaceDeclaration(); $break ./
761/:$readableName InterfaceDeclaration:/
762
763InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt
764/.$putCase consumeInterfaceHeader(); $break ./
765/:$readableName InterfaceHeader:/
766
767-----------------------------------------------
768-- 1.5 features : generics
769-----------------------------------------------
770InterfaceHeaderName ::= InterfaceHeaderName1 TypeParameters
771/.$putCase consumeTypeHeaderNameWithTypeParameters(); $break ./
772
773InterfaceHeaderName -> InterfaceHeaderName1
774/:$readableName InterfaceHeaderName:/
775
776InterfaceHeaderName1 ::= Modifiersopt interface Identifier
777/.$putCase consumeInterfaceHeaderName1(); $break ./
778/:$readableName InterfaceHeaderName:/
779
780InterfaceHeaderExtends ::= 'extends' InterfaceTypeList
781/.$putCase consumeInterfaceHeaderExtends(); $break ./
782/:$readableName InterfaceHeaderExtends:/
783
784InterfaceBody ::= '{' InterfaceMemberDeclarationsopt '}'
785/:$readableName InterfaceBody:/
786
787InterfaceMemberDeclarations -> InterfaceMemberDeclaration
788InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration
789/.$putCase consumeInterfaceMemberDeclarations(); $break ./
790/:$readableName InterfaceMemberDeclarations:/
791
792--same as for class members
793InterfaceMemberDeclaration ::= ';'
794/.$putCase consumeEmptyTypeDeclaration(); $break ./
795/:$readableName InterfaceMemberDeclaration:/
796
797InterfaceMemberDeclaration -> ConstantDeclaration
798InterfaceMemberDeclaration ::= MethodHeader MethodBody
799/.$putCase consumeInvalidMethodDeclaration(); $break ./
800/:$readableName InterfaceMemberDeclaration:/
801
802-- These rules are added to be able to parse constructors inside interface and then report a relevent error message
803InvalidConstructorDeclaration ::= ConstructorHeader MethodBody
804/.$putCase consumeInvalidConstructorDeclaration(true); $break ./
805InvalidConstructorDeclaration ::= ConstructorHeader ';'
806/.$putCase consumeInvalidConstructorDeclaration(false); $break ./
807/:$readableName InvalidConstructorDeclaration:/
808
809InterfaceMemberDeclaration -> AbstractMethodDeclaration
810InterfaceMemberDeclaration -> InvalidConstructorDeclaration
811--1.1 feature
812InterfaceMemberDeclaration -> ClassDeclaration
813--1.1 feature
814InterfaceMemberDeclaration -> InterfaceDeclaration
815InterfaceMemberDeclaration -> EnumDeclaration
816InterfaceMemberDeclaration -> AnnotationTypeDeclaration
817/:$readableName InterfaceMemberDeclaration:/
818
819ConstantDeclaration -> FieldDeclaration
820/:$readableName ConstantDeclaration:/
821
822PushLeftBrace ::= $empty
823/.$putCase consumePushLeftBrace(); $break ./
824/:$readableName PushLeftBrace:/
825
826ArrayInitializer ::= '{' PushLeftBrace ,opt '}'
827/.$putCase consumeEmptyArrayInitializer(); $break ./
828ArrayInitializer ::= '{' PushLeftBrace VariableInitializers '}'
829/.$putCase consumeArrayInitializer(); $break ./
830ArrayInitializer ::= '{' PushLeftBrace VariableInitializers , '}'
831/.$putCase consumeArrayInitializer(); $break ./
832/:$readableName ArrayInitializer:/
833/:$recovery_template Identifier:/
834
835VariableInitializers ::= VariableInitializer
836VariableInitializers ::= VariableInitializers ',' VariableInitializer
837/.$putCase consumeVariableInitializers(); $break ./
838/:$readableName VariableInitializers:/
839
840Block ::= OpenBlock '{' BlockStatementsopt '}'
841/.$putCase consumeBlock(); $break ./
842/:$readableName Block:/
843
844OpenBlock ::= $empty
845/.$putCase consumeOpenBlock() ; $break ./
846/:$readableName OpenBlock:/
847
848BlockStatements -> BlockStatement
849BlockStatements ::= BlockStatements BlockStatement
850/.$putCase consumeBlockStatements() ; $break ./
851/:$readableName BlockStatements:/
852
853BlockStatement -> LocalVariableDeclarationStatement
854BlockStatement -> Statement
855--1.1 feature
856BlockStatement -> ClassDeclaration
857BlockStatement ::= InterfaceDeclaration
858/.$putCase consumeInvalidInterfaceDeclaration(); $break ./
859/:$readableName BlockStatement:/
860BlockStatement ::= AnnotationTypeDeclaration
861/.$putCase consumeInvalidAnnotationTypeDeclaration(); $break ./
862/:$readableName BlockStatement:/
863BlockStatement ::= EnumDeclaration
864/.$putCase consumeInvalidEnumDeclaration(); $break ./
865/:$readableName BlockStatement:/
866
867LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';'
868/.$putCase consumeLocalVariableDeclarationStatement(); $break ./
869/:$readableName LocalVariableDeclarationStatement:/
870
871LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators
872/.$putCase consumeLocalVariableDeclaration(); $break ./
873-- 1.1 feature
874-- The modifiers part of this rule makes the grammar more permissive.
875-- The only modifier here is final. We put Modifiers to allow multiple modifiers
876-- This will require to check the validity of the modifier
877LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators
878/.$putCase consumeLocalVariableDeclaration(); $break ./
879/:$readableName LocalVariableDeclaration:/
880
881PushModifiers ::= $empty
882/.$putCase consumePushModifiers(); $break ./
883/:$readableName PushModifiers:/
884
885PushModifiersForHeader ::= $empty
886/.$putCase consumePushModifiersForHeader(); $break ./
887/:$readableName PushModifiersForHeader:/
888
889PushRealModifiers ::= $empty
890/.$putCase consumePushRealModifiers(); $break ./
891/:$readableName PushRealModifiers:/
892
893Statement -> StatementWithoutTrailingSubstatement
894Statement -> LabeledStatement
895Statement -> IfThenStatement
896Statement -> IfThenElseStatement
897Statement -> WhileStatement
898Statement -> ForStatement
899-----------------------------------------------
900-- 1.5 feature
901-----------------------------------------------
902Statement -> EnhancedForStatement
903/:$readableName Statement:/
904/:$recovery_template ;:/
905
906StatementNoShortIf -> StatementWithoutTrailingSubstatement
907StatementNoShortIf -> LabeledStatementNoShortIf
908StatementNoShortIf -> IfThenElseStatementNoShortIf
909StatementNoShortIf -> WhileStatementNoShortIf
910StatementNoShortIf -> ForStatementNoShortIf
911-----------------------------------------------
912-- 1.5 feature
913-----------------------------------------------
914StatementNoShortIf -> EnhancedForStatementNoShortIf
915/:$readableName Statement:/
916
917StatementWithoutTrailingSubstatement -> AssertStatement
918StatementWithoutTrailingSubstatement -> Block
919StatementWithoutTrailingSubstatement -> EmptyStatement
920StatementWithoutTrailingSubstatement -> ExpressionStatement
921StatementWithoutTrailingSubstatement -> SwitchStatement
922StatementWithoutTrailingSubstatement -> DoStatement
923StatementWithoutTrailingSubstatement -> BreakStatement
924StatementWithoutTrailingSubstatement -> ContinueStatement
925StatementWithoutTrailingSubstatement -> ReturnStatement
926StatementWithoutTrailingSubstatement -> SynchronizedStatement
927StatementWithoutTrailingSubstatement -> ThrowStatement
928StatementWithoutTrailingSubstatement -> TryStatement
929/:$readableName Statement:/
930
931EmptyStatement ::= ';'
932/.$putCase consumeEmptyStatement(); $break ./
933/:$readableName EmptyStatement:/
934
935LabeledStatement ::= Label ':' Statement
936/.$putCase consumeStatementLabel() ; $break ./
937/:$readableName LabeledStatement:/
938
939LabeledStatementNoShortIf ::= Label ':' StatementNoShortIf
940/.$putCase consumeStatementLabel() ; $break ./
941/:$readableName LabeledStatement:/
942
943Label ::= 'Identifier'
944/.$putCase consumeLabel() ; $break ./
945/:$readableName Label:/
946
947ExpressionStatement ::= StatementExpression ';'
948/. $putCase consumeExpressionStatement(); $break ./
949ExpressionStatement ::= ExplicitConstructorInvocation
950/:$readableName Statement:/
951
952StatementExpression ::= Assignment
953StatementExpression ::= PreIncrementExpression
954StatementExpression ::= PreDecrementExpression
955StatementExpression ::= PostIncrementExpression
956StatementExpression ::= PostDecrementExpression
957StatementExpression ::= MethodInvocation
958StatementExpression ::= ClassInstanceCreationExpression
959/:$readableName Expression:/
960
961IfThenStatement ::= 'if' '(' Expression ')' Statement
962/.$putCase consumeStatementIfNoElse(); $break ./
963/:$readableName IfStatement:/
964
965IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' Statement
966/.$putCase consumeStatementIfWithElse(); $break ./
967/:$readableName IfStatement:/
968
969IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf
970/.$putCase consumeStatementIfWithElse(); $break ./
971/:$readableName IfStatement:/
972
973SwitchStatement ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock
974/.$putCase consumeStatementSwitch() ; $break ./
975/:$readableName SwitchStatement:/
976
977SwitchBlock ::= '{' '}'
978/.$putCase consumeEmptySwitchBlock() ; $break ./
979
980SwitchBlock ::= '{' SwitchBlockStatements '}'
981SwitchBlock ::= '{' SwitchLabels '}'
982SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}'
983/.$putCase consumeSwitchBlock() ; $break ./
984/:$readableName SwitchBlock:/
985
986SwitchBlockStatements -> SwitchBlockStatement
987SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement
988/.$putCase consumeSwitchBlockStatements() ; $break ./
989/:$readableName SwitchBlockStatements:/
990
991SwitchBlockStatement ::= SwitchLabels BlockStatements
992/.$putCase consumeSwitchBlockStatement() ; $break ./
993/:$readableName SwitchBlockStatement:/
994
995SwitchLabels -> SwitchLabel
996SwitchLabels ::= SwitchLabels SwitchLabel
997/.$putCase consumeSwitchLabels() ; $break ./
998/:$readableName SwitchLabels:/
999
1000SwitchLabel ::= 'case' ConstantExpression ':'
1001/. $putCase consumeCaseLabel(); $break ./
1002
1003SwitchLabel ::= 'default' ':'
1004/. $putCase consumeDefaultLabel(); $break ./
1005/:$readableName SwitchLabel:/
1006
1007WhileStatement ::= 'while' '(' Expression ')' Statement
1008/.$putCase consumeStatementWhile() ; $break ./
1009/:$readableName WhileStatement:/
1010
1011WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf
1012/.$putCase consumeStatementWhile() ; $break ./
1013/:$readableName WhileStatement:/
1014
1015DoStatement ::= 'do' Statement 'while' '(' Expression ')' ';'
1016/.$putCase consumeStatementDo() ; $break ./
1017/:$readableName DoStatement:/
1018
1019ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' Statement
1020/.$putCase consumeStatementFor() ; $break ./
1021/:$readableName ForStatement:/
1022
1023ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf
1024/.$putCase consumeStatementFor() ; $break ./
1025/:$readableName ForStatement:/
1026
1027--the minus one allows to avoid a stack-to-stack transfer
1028ForInit ::= StatementExpressionList
1029/.$putCase consumeForInit() ; $break ./
1030ForInit -> LocalVariableDeclaration
1031/:$readableName ForInit:/
1032
1033ForUpdate -> StatementExpressionList
1034/:$readableName ForUpdate:/
1035
1036StatementExpressionList -> StatementExpression
1037StatementExpressionList ::= StatementExpressionList ',' StatementExpression
1038/.$putCase consumeStatementExpressionList() ; $break ./
1039/:$readableName StatementExpressionList:/
1040
1041-- 1.4 feature
1042AssertStatement ::= 'assert' Expression ';'
1043/.$putCase consumeSimpleAssertStatement() ; $break ./
1044/:$compliance 1.4:/
1045
1046AssertStatement ::= 'assert' Expression ':' Expression ';'
1047/.$putCase consumeAssertStatement() ; $break ./
1048/:$readableName AssertStatement:/
1049/:$compliance 1.4:/
1050
1051BreakStatement ::= 'break' ';'
1052/.$putCase consumeStatementBreak() ; $break ./
1053
1054BreakStatement ::= 'break' Identifier ';'
1055/.$putCase consumeStatementBreakWithLabel() ; $break ./
1056/:$readableName BreakStatement:/
1057
1058ContinueStatement ::= 'continue' ';'
1059/.$putCase consumeStatementContinue() ; $break ./
1060
1061ContinueStatement ::= 'continue' Identifier ';'
1062/.$putCase consumeStatementContinueWithLabel() ; $break ./
1063/:$readableName ContinueStatement:/
1064
1065ReturnStatement ::= 'return' Expressionopt ';'
1066/.$putCase consumeStatementReturn() ; $break ./
1067/:$readableName ReturnStatement:/
1068
1069ThrowStatement ::= 'throw' Expression ';'
1070/.$putCase consumeStatementThrow(); $break ./
1071/:$readableName ThrowStatement:/
1072
1073SynchronizedStatement ::= OnlySynchronized '(' Expression ')' Block
1074/.$putCase consumeStatementSynchronized(); $break ./
1075/:$readableName SynchronizedStatement:/
1076
1077OnlySynchronized ::= 'synchronized'
1078/.$putCase consumeOnlySynchronized(); $break ./
1079/:$readableName OnlySynchronized:/
1080
1081TryStatement ::= 'try' TryBlock Catches
1082/.$putCase consumeStatementTry(false); $break ./
1083TryStatement ::= 'try' TryBlock Catchesopt Finally
1084/.$putCase consumeStatementTry(true); $break ./
1085/:$readableName TryStatement:/
1086
1087TryBlock ::= Block ExitTryBlock
1088/:$readableName Block:/
1089
1090ExitTryBlock ::= $empty
1091/.$putCase consumeExitTryBlock(); $break ./
1092/:$readableName ExitTryBlock:/
1093
1094Catches -> CatchClause
1095Catches ::= Catches CatchClause
1096/.$putCase consumeCatches(); $break ./
1097/:$readableName Catches:/
1098
1099CatchClause ::= 'catch' '(' FormalParameter ')' Block
1100/.$putCase consumeStatementCatch() ; $break ./
1101/:$readableName CatchClause:/
1102
1103Finally ::= 'finally' Block
1104/:$readableName Finally:/
1105/:$recovery_template finally { }:/
1106
1107--18.12 Productions from 14: Expressions
1108
1109--for source positioning purpose
1110PushLPAREN ::= '('
1111/.$putCase consumeLeftParen(); $break ./
1112/:$readableName (:/
1113/:$recovery_template (:/
1114PushRPAREN ::= ')'
1115/.$putCase consumeRightParen(); $break ./
1116/:$readableName ):/
1117/:$recovery_template ):/
1118
1119Primary -> PrimaryNoNewArray
1120Primary -> ArrayCreationWithArrayInitializer
1121Primary -> ArrayCreationWithoutArrayInitializer
1122/:$readableName Expression:/
1123
1124PrimaryNoNewArray -> Literal
1125PrimaryNoNewArray ::= 'this'
1126/.$putCase consumePrimaryNoNewArrayThis(); $break ./
1127
1128PrimaryNoNewArray ::= PushLPAREN Expression_NotName PushRPAREN
1129/.$putCase consumePrimaryNoNewArray(); $break ./
1130
1131PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN
1132/.$putCase consumePrimaryNoNewArrayWithName(); $break ./
1133
1134PrimaryNoNewArray -> ClassInstanceCreationExpression
1135PrimaryNoNewArray -> FieldAccess
1136--1.1 feature
1137PrimaryNoNewArray ::= Name '.' 'this'
1138/.$putCase consumePrimaryNoNewArrayNameThis(); $break ./
1139PrimaryNoNewArray ::= Name '.' 'super'
1140/.$putCase consumePrimaryNoNewArrayNameSuper(); $break ./
1141
1142--1.1 feature
1143--PrimaryNoNewArray ::= Type '.' 'class'
1144--inline Type in the previous rule in order to make the grammar LL1 instead
1145-- of LL2. The result is the 3 next rules.
1146
1147PrimaryNoNewArray ::= Name '.' 'class'
1148/.$putCase consumePrimaryNoNewArrayName(); $break ./
1149
1150PrimaryNoNewArray ::= Name Dims '.' 'class'
1151/.$putCase consumePrimaryNoNewArrayArrayType(); $break ./
1152
1153PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class'
1154/.$putCase consumePrimaryNoNewArrayPrimitiveArrayType(); $break ./
1155
1156PrimaryNoNewArray ::= PrimitiveType '.' 'class'
1157/.$putCase consumePrimaryNoNewArrayPrimitiveType(); $break ./
1158
1159PrimaryNoNewArray -> MethodInvocation
1160PrimaryNoNewArray -> ArrayAccess
1161/:$readableName Expression:/
1162--1.1 feature
1163--
1164-- In Java 1.0 a ClassBody could not appear at all in a
1165-- ClassInstanceCreationExpression.
1166--
1167
1168AllocationHeader ::= 'new' ClassType '(' ArgumentListopt ')'
1169/.$putCase consumeAllocationHeader(); $break ./
1170/:$readableName AllocationHeader:/
1171
1172ClassInstanceCreationExpression ::= 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' ClassBodyopt
1173/.$putCase consumeClassInstanceCreationExpressionWithTypeArguments(); $break ./
1174
1175ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt
1176/.$putCase consumeClassInstanceCreationExpression(); $break ./
1177--1.1 feature
1178
1179ClassInstanceCreationExpression ::= Primary '.' 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' ClassBodyopt
1180/.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./
1181
1182ClassInstanceCreationExpression ::= Primary '.' 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt
1183/.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./
1184
1185--1.1 feature
1186ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt
1187/.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./
1188/:$readableName ClassInstanceCreationExpression:/
1189
1190ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' ClassBodyopt
1191/.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./
1192/:$readableName ClassInstanceCreationExpression:/
1193
1194ClassInstanceCreationExpressionName ::= Name '.'
1195/.$putCase consumeClassInstanceCreationExpressionName() ; $break ./
1196/:$readableName ClassInstanceCreationExpressionName:/
1197
1198ClassBodyopt ::= $empty --test made using null as contents
1199/.$putCase consumeClassBodyopt(); $break ./
1200ClassBodyopt ::= EnterAnonymousClassBody ClassBody
1201/:$readableName ClassBody:/
1202/:$no_statements_recovery:/
1203
1204EnterAnonymousClassBody ::= $empty
1205/.$putCase consumeEnterAnonymousClassBody(); $break ./
1206/:$readableName EnterAnonymousClassBody:/
1207
1208ArgumentList ::= Expression
1209ArgumentList ::= ArgumentList ',' Expression
1210/.$putCase consumeArgumentList(); $break ./
1211/:$readableName ArgumentList:/
1212
1213ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs
1214/.$putCase consumeArrayCreationHeader(); $break ./
1215
1216ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1217/.$putCase consumeArrayCreationHeader(); $break ./
1218/:$readableName ArrayCreationHeader:/
1219
1220ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs
1221/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1222/:$readableName ArrayCreationWithoutArrayInitializer:/
1223
1224ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer
1225/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1226/:$readableName ArrayCreationWithArrayInitializer:/
1227
1228ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1229/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1230
1231ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer
1232/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1233
1234DimWithOrWithOutExprs ::= DimWithOrWithOutExpr
1235DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr
1236/.$putCase consumeDimWithOrWithOutExprs(); $break ./
1237/:$readableName Dimensions:/
1238
1239DimWithOrWithOutExpr ::= '[' Expression ']'
1240DimWithOrWithOutExpr ::= '[' ']'
1241/. $putCase consumeDimWithOrWithOutExpr(); $break ./
1242/:$readableName Dimension:/
1243-- -----------------------------------------------
1244
1245Dims ::= DimsLoop
1246/. $putCase consumeDims(); $break ./
1247/:$readableName Dimensions:/
1248DimsLoop -> OneDimLoop
1249DimsLoop ::= DimsLoop OneDimLoop
1250/:$readableName Dimensions:/
1251OneDimLoop ::= '[' ']'
1252/. $putCase consumeOneDimLoop(); $break ./
1253/:$readableName Dimension:/
1254
1255FieldAccess ::= Primary '.' 'Identifier'
1256/.$putCase consumeFieldAccess(false); $break ./
1257
1258FieldAccess ::= 'super' '.' 'Identifier'
1259/.$putCase consumeFieldAccess(true); $break ./
1260/:$readableName FieldAccess:/
1261
1262MethodInvocation ::= Name '(' ArgumentListopt ')'
1263/.$putCase consumeMethodInvocationName(); $break ./
1264
1265MethodInvocation ::= Name '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1266/.$putCase consumeMethodInvocationNameWithTypeArguments(); $break ./
1267
1268MethodInvocation ::= Primary '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1269/.$putCase consumeMethodInvocationPrimaryWithTypeArguments(); $break ./
1270
1271MethodInvocation ::= Primary '.' 'Identifier' '(' ArgumentListopt ')'
1272/.$putCase consumeMethodInvocationPrimary(); $break ./
1273
1274MethodInvocation ::= 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1275/.$putCase consumeMethodInvocationSuperWithTypeArguments(); $break ./
1276
1277MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')'
1278/.$putCase consumeMethodInvocationSuper(); $break ./
1279/:$readableName MethodInvocation:/
1280
1281ArrayAccess ::= Name '[' Expression ']'
1282/.$putCase consumeArrayAccess(true); $break ./
1283ArrayAccess ::= PrimaryNoNewArray '[' Expression ']'
1284/.$putCase consumeArrayAccess(false); $break ./
1285ArrayAccess ::= ArrayCreationWithArrayInitializer '[' Expression ']'
1286/.$putCase consumeArrayAccess(false); $break ./
1287/:$readableName ArrayAccess:/
1288
1289PostfixExpression -> Primary
1290PostfixExpression ::= Name
1291/.$putCase consumePostfixExpression(); $break ./
1292PostfixExpression -> PostIncrementExpression
1293PostfixExpression -> PostDecrementExpression
1294/:$readableName Expression:/
1295
1296PostIncrementExpression ::= PostfixExpression '++'
1297/.$putCase consumeUnaryExpression(OperatorIds.PLUS,true); $break ./
1298/:$readableName PostIncrementExpression:/
1299
1300PostDecrementExpression ::= PostfixExpression '--'
1301/.$putCase consumeUnaryExpression(OperatorIds.MINUS,true); $break ./
1302/:$readableName PostDecrementExpression:/
1303
1304--for source managment purpose
1305PushPosition ::= $empty
1306 /.$putCase consumePushPosition(); $break ./
1307/:$readableName PushPosition:/
1308
1309UnaryExpression -> PreIncrementExpression
1310UnaryExpression -> PreDecrementExpression
1311UnaryExpression ::= '+' PushPosition UnaryExpression
1312/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./
1313UnaryExpression ::= '-' PushPosition UnaryExpression
1314/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./
1315UnaryExpression -> UnaryExpressionNotPlusMinus
1316/:$readableName Expression:/
1317
1318PreIncrementExpression ::= '++' PushPosition UnaryExpression
1319/.$putCase consumeUnaryExpression(OperatorIds.PLUS,false); $break ./
1320/:$readableName PreIncrementExpression:/
1321
1322PreDecrementExpression ::= '--' PushPosition UnaryExpression
1323/.$putCase consumeUnaryExpression(OperatorIds.MINUS,false); $break ./
1324/:$readableName PreDecrementExpression:/
1325
1326UnaryExpressionNotPlusMinus -> PostfixExpression
1327UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression
1328/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./
1329UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression
1330/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./
1331UnaryExpressionNotPlusMinus -> CastExpression
1332/:$readableName Expression:/
1333
1334CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
1335/.$putCase consumeCastExpressionWithPrimitiveType(); $break ./
1336CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1337/.$putCase consumeCastExpressionWithGenericsArray(); $break ./
1338CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus
1339/.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./
1340CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
1341/.$putCase consumeCastExpressionLL1(); $break ./
1342CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1343/.$putCase consumeCastExpressionWithNameArray(); $break ./
1344/:$readableName CastExpression:/
1345
1346OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
1347/.$putCase consumeOnlyTypeArgumentsForCastExpression(); $break ./
1348/:$readableName TypeArguments:/
1349
1350InsideCastExpression ::= $empty
1351/.$putCase consumeInsideCastExpression(); $break ./
1352/:$readableName InsideCastExpression:/
1353InsideCastExpressionLL1 ::= $empty
1354/.$putCase consumeInsideCastExpressionLL1(); $break ./
1355/:$readableName InsideCastExpression:/
1356InsideCastExpressionWithQualifiedGenerics ::= $empty
1357/.$putCase consumeInsideCastExpressionWithQualifiedGenerics(); $break ./
1358/:$readableName InsideCastExpression:/
1359
1360MultiplicativeExpression -> UnaryExpression
1361MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression
1362/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./
1363MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression
1364/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./
1365MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression
1366/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./
1367/:$readableName Expression:/
1368
1369AdditiveExpression -> MultiplicativeExpression
1370AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression
1371/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./
1372AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression
1373/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./
1374/:$readableName Expression:/
1375
1376ShiftExpression -> AdditiveExpression
1377ShiftExpression ::= ShiftExpression '<<' AdditiveExpression
1378/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./
1379ShiftExpression ::= ShiftExpression '>>' AdditiveExpression
1380/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./
1381ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression
1382/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
1383/:$readableName Expression:/
1384
1385RelationalExpression -> ShiftExpression
1386RelationalExpression ::= RelationalExpression '<' ShiftExpression
1387/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./
1388RelationalExpression ::= RelationalExpression '>' ShiftExpression
1389/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./
1390RelationalExpression ::= RelationalExpression '<=' ShiftExpression
1391/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./
1392RelationalExpression ::= RelationalExpression '>=' ShiftExpression
1393/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./
1394/:$readableName Expression:/
1395
1396InstanceofExpression -> RelationalExpression
1397InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType
1398/.$putCase consumeInstanceOfExpression(); $break ./
1399/:$readableName Expression:/
1400
1401EqualityExpression -> InstanceofExpression
1402EqualityExpression ::= EqualityExpression '==' InstanceofExpression
1403/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./
1404EqualityExpression ::= EqualityExpression '!=' InstanceofExpression
1405/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./
1406/:$readableName Expression:/
1407
1408AndExpression -> EqualityExpression
1409AndExpression ::= AndExpression '&' EqualityExpression
1410/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./
1411/:$readableName Expression:/
1412
1413ExclusiveOrExpression -> AndExpression
1414ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression
1415/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./
1416/:$readableName Expression:/
1417
1418InclusiveOrExpression -> ExclusiveOrExpression
1419InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression
1420/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./
1421/:$readableName Expression:/
1422
1423ConditionalAndExpression -> InclusiveOrExpression
1424ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression
1425/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./
1426/:$readableName Expression:/
1427
1428ConditionalOrExpression -> ConditionalAndExpression
1429ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression
1430/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./
1431/:$readableName Expression:/
1432
1433ConditionalExpression -> ConditionalOrExpression
1434ConditionalExpression ::= ConditionalOrExpression '?' Expression ':' ConditionalExpression
1435/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./
1436/:$readableName Expression:/
1437
1438AssignmentExpression -> ConditionalExpression
1439AssignmentExpression -> Assignment
1440/:$readableName Expression:/
1441/:$recovery_template Identifier:/
1442
1443Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression
1444/.$putCase consumeAssignment(); $break ./
1445/:$readableName Assignment:/
1446
1447-- this rule is added to parse an array initializer in a assigment and then report a syntax error knowing the exact senario
1448InvalidArrayInitializerAssignement ::= PostfixExpression AssignmentOperator ArrayInitializer
1449/:$readableName ArrayInitializerAssignment:/
1450/:$recovery:/
1451Assignment ::= InvalidArrayInitializerAssignement
1452/.$putcase ignoreExpressionAssignment();$break ./
1453/:$recovery:/
1454
1455AssignmentOperator ::= '='
1456/.$putCase consumeAssignmentOperator(EQUAL); $break ./
1457AssignmentOperator ::= '*='
1458/.$putCase consumeAssignmentOperator(MULTIPLY); $break ./
1459AssignmentOperator ::= '/='
1460/.$putCase consumeAssignmentOperator(DIVIDE); $break ./
1461AssignmentOperator ::= '%='
1462/.$putCase consumeAssignmentOperator(REMAINDER); $break ./
1463AssignmentOperator ::= '+='
1464/.$putCase consumeAssignmentOperator(PLUS); $break ./
1465AssignmentOperator ::= '-='
1466/.$putCase consumeAssignmentOperator(MINUS); $break ./
1467AssignmentOperator ::= '<<='
1468/.$putCase consumeAssignmentOperator(LEFT_SHIFT); $break ./
1469AssignmentOperator ::= '>>='
1470/.$putCase consumeAssignmentOperator(RIGHT_SHIFT); $break ./
1471AssignmentOperator ::= '>>>='
1472/.$putCase consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); $break ./
1473AssignmentOperator ::= '&='
1474/.$putCase consumeAssignmentOperator(AND); $break ./
1475AssignmentOperator ::= '^='
1476/.$putCase consumeAssignmentOperator(XOR); $break ./
1477AssignmentOperator ::= '|='
1478/.$putCase consumeAssignmentOperator(OR); $break ./
1479/:$readableName AssignmentOperator:/
1480/:$recovery_template =:/
1481
1482Expression -> AssignmentExpression
1483/:$readableName Expression:/
1484/:$recovery_template Identifier:/
1485
1486-- The following rules are for optional nonterminals.
1487--
1488ClassHeaderExtendsopt ::= $empty
1489ClassHeaderExtendsopt -> ClassHeaderExtends
1490/:$readableName ClassHeaderExtends:/
1491
1492Expressionopt ::= $empty
1493/.$putCase consumeEmptyExpression(); $break ./
1494Expressionopt -> Expression
1495/:$readableName Expression:/
1496
1497ConstantExpression -> Expression
1498/:$readableName ConstantExpression:/
1499
1500---------------------------------------------------------------------------------------
1501--
1502-- The rules below are for optional terminal symbols. An optional comma,
1503-- is only used in the context of an array initializer - It is a
1504-- "syntactic sugar" that otherwise serves no other purpose. By contrast,
1505-- an optional identifier is used in the definition of a break and
1506-- continue statement. When the identifier does not appear, a NULL
1507-- is produced. When the identifier is present, the user should use the
1508-- corresponding TOKEN(i) method. See break statement as an example.
1509--
1510---------------------------------------------------------------------------------------
1511
1512,opt -> $empty
1513,opt -> ,
1514/:$readableName ,:/
1515
1516ClassBodyDeclarationsopt ::= $empty
1517/.$putCase consumeEmptyClassBodyDeclarationsopt(); $break ./
1518ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations
1519/.$putCase consumeClassBodyDeclarationsopt(); $break ./
1520/:$readableName ClassBodyDeclarations:/
1521
1522Modifiersopt ::= $empty
1523/. $putCase consumeDefaultModifiers(); $break ./
1524Modifiersopt ::= Modifiers
1525/.$putCase consumeModifiers(); $break ./
1526/:$readableName Modifiers:/
1527
1528BlockStatementsopt ::= $empty
1529/.$putCase consumeEmptyBlockStatementsopt(); $break ./
1530BlockStatementsopt -> BlockStatements
1531/:$readableName BlockStatements:/
1532
1533Dimsopt ::= $empty
1534/. $putCase consumeEmptyDimsopt(); $break ./
1535Dimsopt -> Dims
1536/:$readableName Dimensions:/
1537
1538ArgumentListopt ::= $empty
1539/. $putCase consumeEmptyArgumentListopt(); $break ./
1540ArgumentListopt -> ArgumentList
1541/:$readableName ArgumentList:/
1542
1543MethodHeaderThrowsClauseopt ::= $empty
1544MethodHeaderThrowsClauseopt -> MethodHeaderThrowsClause
1545/:$readableName MethodHeaderThrowsClause:/
1546
1547FormalParameterListopt ::= $empty
1548/.$putcase consumeFormalParameterListopt(); $break ./
1549FormalParameterListopt -> FormalParameterList
1550/:$readableName FormalParameterList:/
1551
1552ClassHeaderImplementsopt ::= $empty
1553ClassHeaderImplementsopt -> ClassHeaderImplements
1554/:$readableName ClassHeaderImplements:/
1555
1556InterfaceMemberDeclarationsopt ::= $empty
1557/. $putCase consumeEmptyInterfaceMemberDeclarationsopt(); $break ./
1558InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations
1559/. $putCase consumeInterfaceMemberDeclarationsopt(); $break ./
1560/:$readableName InterfaceMemberDeclarations:/
1561
1562NestedType ::= $empty
1563/.$putCase consumeNestedType(); $break./
1564/:$readableName NestedType:/
1565
1566ForInitopt ::= $empty
1567/. $putCase consumeEmptyForInitopt(); $break ./
1568ForInitopt -> ForInit
1569/:$readableName ForInit:/
1570
1571ForUpdateopt ::= $empty
1572/. $putCase consumeEmptyForUpdateopt(); $break ./
1573ForUpdateopt -> ForUpdate
1574/:$readableName ForUpdate:/
1575
1576InterfaceHeaderExtendsopt ::= $empty
1577InterfaceHeaderExtendsopt -> InterfaceHeaderExtends
1578/:$readableName InterfaceHeaderExtends:/
1579
1580Catchesopt ::= $empty
1581/. $putCase consumeEmptyCatchesopt(); $break ./
1582Catchesopt -> Catches
1583/:$readableName Catches:/
1584
1585-----------------------------------------------
1586-- 1.5 features : enum type
1587-----------------------------------------------
1588EnumDeclaration ::= EnumHeader EnumBody
1589/. $putCase consumeEnumDeclaration(); $break ./
1590/:$readableName EnumDeclaration:/
1591
1592EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt
1593/. $putCase consumeEnumHeader(); $break ./
1594/:$readableName EnumHeader:/
1595
1596EnumHeaderName ::= Modifiersopt 'enum' Identifier
1597/. $putCase consumeEnumHeaderName(); $break ./
1598/:$compliance 1.5:/
1599EnumHeaderName ::= Modifiersopt 'enum' Identifier TypeParameters
1600/. $putCase consumeEnumHeaderNameWithTypeParameters(); $break ./
1601/:$readableName EnumHeaderName:/
1602/:$compliance 1.5:/
1603
1604EnumBody ::= '{' EnumBodyDeclarationsopt '}'
1605/. $putCase consumeEnumBodyNoConstants(); $break ./
1606EnumBody ::= '{' ',' EnumBodyDeclarationsopt '}'
1607/. $putCase consumeEnumBodyNoConstants(); $break ./
1608EnumBody ::= '{' EnumConstants ',' EnumBodyDeclarationsopt '}'
1609/. $putCase consumeEnumBodyWithConstants(); $break ./
1610EnumBody ::= '{' EnumConstants EnumBodyDeclarationsopt '}'
1611/. $putCase consumeEnumBodyWithConstants(); $break ./
1612/:$readableName EnumBody:/
1613
1614EnumConstants -> EnumConstant
1615EnumConstants ::= EnumConstants ',' EnumConstant
1616/.$putCase consumeEnumConstants(); $break ./
1617/:$readableName EnumConstants:/
1618
1619EnumConstantHeaderName ::= Modifiersopt Identifier
1620/.$putCase consumeEnumConstantHeaderName(); $break ./
1621/:$readableName EnumConstantHeaderName:/
1622
1623EnumConstantHeader ::= EnumConstantHeaderName ForceNoDiet Argumentsopt RestoreDiet
1624/.$putCase consumeEnumConstantHeader(); $break ./
1625/:$readableName EnumConstantHeader:/
1626
1627EnumConstant ::= EnumConstantHeader ForceNoDiet ClassBody RestoreDiet
1628/.$putCase consumeEnumConstantWithClassBody(); $break ./
1629EnumConstant ::= EnumConstantHeader
1630/.$putCase consumeEnumConstantNoClassBody(); $break ./
1631/:$readableName EnumConstant:/
1632
1633Arguments ::= '(' ArgumentListopt ')'
1634/.$putCase consumeArguments(); $break ./
1635/:$readableName Arguments:/
1636
1637Argumentsopt ::= $empty
1638/.$putCase consumeEmptyArguments(); $break ./
1639Argumentsopt -> Arguments
1640/:$readableName Argumentsopt:/
1641
1642EnumDeclarations ::= ';' ClassBodyDeclarationsopt
1643/.$putCase consumeEnumDeclarations(); $break ./
1644/:$readableName EnumDeclarations:/
1645
1646EnumBodyDeclarationsopt ::= $empty
1647/.$putCase consumeEmptyEnumDeclarations(); $break ./
1648EnumBodyDeclarationsopt -> EnumDeclarations
1649/:$readableName EnumBodyDeclarationsopt:/
1650
1651-----------------------------------------------
1652-- 1.5 features : enhanced for statement
1653-----------------------------------------------
1654EnhancedForStatement ::= EnhancedForStatementHeader Statement
1655/.$putCase consumeEnhancedForStatement(); $break ./
1656/:$readableName EnhancedForStatement:/
1657
1658EnhancedForStatementNoShortIf ::= EnhancedForStatementHeader StatementNoShortIf
1659/.$putCase consumeEnhancedForStatement(); $break ./
1660/:$readableName EnhancedForStatementNoShortIf:/
1661
1662EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt
1663/.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./
1664/:$readableName EnhancedForStatementHeaderInit:/
1665
1666EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt
1667/.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./
1668/:$readableName EnhancedForStatementHeaderInit:/
1669
1670EnhancedForStatementHeader ::= EnhancedForStatementHeaderInit ':' Expression ')'
1671/.$putCase consumeEnhancedForStatementHeader(); $break ./
1672/:$readableName EnhancedForStatementHeader:/
1673/:$compliance 1.5:/
1674
1675-----------------------------------------------
1676-- 1.5 features : static imports
1677-----------------------------------------------
1678SingleStaticImportDeclaration ::= SingleStaticImportDeclarationName ';'
1679/.$putCase consumeImportDeclaration(); $break ./
1680/:$readableName SingleStaticImportDeclaration:/
1681
1682SingleStaticImportDeclarationName ::= 'import' 'static' Name
1683/.$putCase consumeSingleStaticImportDeclarationName(); $break ./
1684/:$readableName SingleStaticImportDeclarationName:/
1685/:$compliance 1.5:/
1686
1687StaticImportOnDemandDeclaration ::= StaticImportOnDemandDeclarationName ';'
1688/.$putCase consumeImportDeclaration(); $break ./
1689/:$readableName StaticImportOnDemandDeclaration:/
1690
1691StaticImportOnDemandDeclarationName ::= 'import' 'static' Name '.' '*'
1692/.$putCase consumeStaticImportOnDemandDeclarationName(); $break ./
1693/:$readableName StaticImportOnDemandDeclarationName:/
1694/:$compliance 1.5:/
1695
1696-----------------------------------------------
1697-- 1.5 features : generics
1698-----------------------------------------------
1699TypeArguments ::= '<' TypeArgumentList1
1700/.$putCase consumeTypeArguments(); $break ./
1701/:$readableName TypeArguments:/
1702/:$compliance 1.5:/
1703
1704OnlyTypeArguments ::= '<' TypeArgumentList1
1705/.$putCase consumeOnlyTypeArguments(); $break ./
1706/:$readableName TypeArguments:/
1707/:$compliance 1.5:/
1708
1709TypeArgumentList1 -> TypeArgument1
1710/:$compliance 1.5:/
1711TypeArgumentList1 ::= TypeArgumentList ',' TypeArgument1
1712/.$putCase consumeTypeArgumentList1(); $break ./
1713/:$readableName TypeArgumentList1:/
1714/:$compliance 1.5:/
1715
1716TypeArgumentList -> TypeArgument
1717/:$compliance 1.5:/
1718TypeArgumentList ::= TypeArgumentList ',' TypeArgument
1719/.$putCase consumeTypeArgumentList(); $break ./
1720/:$readableName TypeArgumentList:/
1721/:$compliance 1.5:/
1722
1723TypeArgument ::= ReferenceType
1724/.$putCase consumeTypeArgument(); $break ./
1725/:$compliance 1.5:/
1726TypeArgument -> Wildcard
1727/:$readableName TypeArgument:/
1728/:$compliance 1.5:/
1729
1730TypeArgument1 -> ReferenceType1
1731/:$compliance 1.5:/
1732TypeArgument1 -> Wildcard1
1733/:$readableName TypeArgument1:/
1734/:$compliance 1.5:/
1735
1736ReferenceType1 ::= ReferenceType '>'
1737/.$putCase consumeReferenceType1(); $break ./
1738/:$compliance 1.5:/
1739ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2
1740/.$putCase consumeTypeArgumentReferenceType1(); $break ./
1741/:$readableName ReferenceType1:/
1742/:$compliance 1.5:/
1743
1744TypeArgumentList2 -> TypeArgument2
1745/:$compliance 1.5:/
1746TypeArgumentList2 ::= TypeArgumentList ',' TypeArgument2
1747/.$putCase consumeTypeArgumentList2(); $break ./
1748/:$readableName TypeArgumentList2:/
1749/:$compliance 1.5:/
1750
1751TypeArgument2 -> ReferenceType2
1752/:$compliance 1.5:/
1753TypeArgument2 -> Wildcard2
1754/:$readableName TypeArgument2:/
1755/:$compliance 1.5:/
1756
1757ReferenceType2 ::= ReferenceType '>>'
1758/.$putCase consumeReferenceType2(); $break ./
1759/:$compliance 1.5:/
1760ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3
1761/.$putCase consumeTypeArgumentReferenceType2(); $break ./
1762/:$readableName ReferenceType2:/
1763/:$compliance 1.5:/
1764
1765TypeArgumentList3 -> TypeArgument3
1766TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3
1767/.$putCase consumeTypeArgumentList3(); $break ./
1768/:$readableName TypeArgumentList3:/
1769/:$compliance 1.5:/
1770
1771TypeArgument3 -> ReferenceType3
1772TypeArgument3 -> Wildcard3
1773/:$readableName TypeArgument3:/
1774/:$compliance 1.5:/
1775
1776ReferenceType3 ::= ReferenceType '>>>'
1777/.$putCase consumeReferenceType3(); $break ./
1778/:$readableName ReferenceType3:/
1779/:$compliance 1.5:/
1780
1781Wildcard ::= '?'
1782/.$putCase consumeWildcard(); $break ./
1783/:$compliance 1.5:/
1784Wildcard ::= '?' WildcardBounds
1785/.$putCase consumeWildcardWithBounds(); $break ./
1786/:$readableName Wildcard:/
1787/:$compliance 1.5:/
1788
1789WildcardBounds ::= 'extends' ReferenceType
1790/.$putCase consumeWildcardBoundsExtends(); $break ./
1791/:$compliance 1.5:/
1792WildcardBounds ::= 'super' ReferenceType
1793/.$putCase consumeWildcardBoundsSuper(); $break ./
1794/:$readableName WildcardBounds:/
1795/:$compliance 1.5:/
1796
1797Wildcard1 ::= '?' '>'
1798/.$putCase consumeWildcard1(); $break ./
1799/:$compliance 1.5:/
1800Wildcard1 ::= '?' WildcardBounds1
1801/.$putCase consumeWildcard1WithBounds(); $break ./
1802/:$readableName Wildcard1:/
1803/:$compliance 1.5:/
1804
1805WildcardBounds1 ::= 'extends' ReferenceType1
1806/.$putCase consumeWildcardBounds1Extends(); $break ./
1807/:$compliance 1.5:/
1808WildcardBounds1 ::= 'super' ReferenceType1
1809/.$putCase consumeWildcardBounds1Super(); $break ./
1810/:$readableName WildcardBounds1:/
1811/:$compliance 1.5:/
1812
1813Wildcard2 ::= '?' '>>'
1814/.$putCase consumeWildcard2(); $break ./
1815/:$compliance 1.5:/
1816Wildcard2 ::= '?' WildcardBounds2
1817/.$putCase consumeWildcard2WithBounds(); $break ./
1818/:$readableName Wildcard2:/
1819/:$compliance 1.5:/
1820
1821WildcardBounds2 ::= 'extends' ReferenceType2
1822/.$putCase consumeWildcardBounds2Extends(); $break ./
1823/:$compliance 1.5:/
1824WildcardBounds2 ::= 'super' ReferenceType2
1825/.$putCase consumeWildcardBounds2Super(); $break ./
1826/:$readableName WildcardBounds2:/
1827/:$compliance 1.5:/
1828
1829Wildcard3 ::= '?' '>>>'
1830/.$putCase consumeWildcard3(); $break ./
1831/:$compliance 1.5:/
1832Wildcard3 ::= '?' WildcardBounds3
1833/.$putCase consumeWildcard3WithBounds(); $break ./
1834/:$readableName Wildcard3:/
1835/:$compliance 1.5:/
1836
1837WildcardBounds3 ::= 'extends' ReferenceType3
1838/.$putCase consumeWildcardBounds3Extends(); $break ./
1839/:$compliance 1.5:/
1840WildcardBounds3 ::= 'super' ReferenceType3
1841/.$putCase consumeWildcardBounds3Super(); $break ./
1842/:$readableName WildcardBound3:/
1843/:$compliance 1.5:/
1844
1845TypeParameterHeader ::= Identifier
1846/.$putCase consumeTypeParameterHeader(); $break ./
1847/:$readableName TypeParameter:/
1848/:$compliance 1.5:/
1849
1850TypeParameters ::= '<' TypeParameterList1
1851/.$putCase consumeTypeParameters(); $break ./
1852/:$readableName TypeParameters:/
1853/:$compliance 1.5:/
1854
1855TypeParameterList -> TypeParameter
1856/:$compliance 1.5:/
1857TypeParameterList ::= TypeParameterList ',' TypeParameter
1858/.$putCase consumeTypeParameterList(); $break ./
1859/:$readableName TypeParameterList:/
1860/:$compliance 1.5:/
1861
1862TypeParameter -> TypeParameterHeader
1863/:$compliance 1.5:/
1864TypeParameter ::= TypeParameterHeader 'extends' ReferenceType
1865/.$putCase consumeTypeParameterWithExtends(); $break ./
1866/:$compliance 1.5:/
1867TypeParameter ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList
1868/.$putCase consumeTypeParameterWithExtendsAndBounds(); $break ./
1869/:$readableName TypeParameter:/
1870/:$compliance 1.5:/
1871
1872AdditionalBoundList -> AdditionalBound
1873/:$compliance 1.5:/
1874AdditionalBoundList ::= AdditionalBoundList AdditionalBound
1875/.$putCase consumeAdditionalBoundList(); $break ./
1876/:$readableName AdditionalBoundList:/
1877
1878AdditionalBound ::= '&' ReferenceType
1879/.$putCase consumeAdditionalBound(); $break ./
1880/:$readableName AdditionalBound:/
1881/:$compliance 1.5:/
1882
1883TypeParameterList1 -> TypeParameter1
1884/:$compliance 1.5:/
1885TypeParameterList1 ::= TypeParameterList ',' TypeParameter1
1886/.$putCase consumeTypeParameterList1(); $break ./
1887/:$readableName TypeParameterList1:/
1888/:$compliance 1.5:/
1889
1890TypeParameter1 ::= TypeParameterHeader '>'
1891/.$putCase consumeTypeParameter1(); $break ./
1892/:$compliance 1.5:/
1893TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType1
1894/.$putCase consumeTypeParameter1WithExtends(); $break ./
1895/:$compliance 1.5:/
1896TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList1
1897/.$putCase consumeTypeParameter1WithExtendsAndBounds(); $break ./
1898/:$readableName TypeParameter1:/
1899/:$compliance 1.5:/
1900
1901AdditionalBoundList1 -> AdditionalBound1
1902/:$compliance 1.5:/
1903AdditionalBoundList1 ::= AdditionalBoundList AdditionalBound1
1904/.$putCase consumeAdditionalBoundList1(); $break ./
1905/:$readableName AdditionalBoundList1:/
1906/:$compliance 1.5:/
1907
1908AdditionalBound1 ::= '&' ReferenceType1
1909/.$putCase consumeAdditionalBound1(); $break ./
1910/:$readableName AdditionalBound1:/
1911/:$compliance 1.5:/
1912
1913-------------------------------------------------
1914-- Duplicate rules to remove ambiguity for (x) --
1915-------------------------------------------------
1916PostfixExpression_NotName -> Primary
1917PostfixExpression_NotName -> PostIncrementExpression
1918PostfixExpression_NotName -> PostDecrementExpression
1919/:$readableName Expression:/
1920
1921UnaryExpression_NotName -> PreIncrementExpression
1922UnaryExpression_NotName -> PreDecrementExpression
1923UnaryExpression_NotName ::= '+' PushPosition UnaryExpression
1924/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./
1925UnaryExpression_NotName ::= '-' PushPosition UnaryExpression
1926/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./
1927UnaryExpression_NotName -> UnaryExpressionNotPlusMinus_NotName
1928/:$readableName Expression:/
1929
1930UnaryExpressionNotPlusMinus_NotName -> PostfixExpression_NotName
1931UnaryExpressionNotPlusMinus_NotName ::= '~' PushPosition UnaryExpression
1932/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./
1933UnaryExpressionNotPlusMinus_NotName ::= '!' PushPosition UnaryExpression
1934/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./
1935UnaryExpressionNotPlusMinus_NotName -> CastExpression
1936/:$readableName Expression:/
1937
1938MultiplicativeExpression_NotName -> UnaryExpression_NotName
1939MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '*' UnaryExpression
1940/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./
1941MultiplicativeExpression_NotName ::= Name '*' UnaryExpression
1942/.$putCase consumeBinaryExpressionWithName(OperatorIds.MULTIPLY); $break ./
1943MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '/' UnaryExpression
1944/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./
1945MultiplicativeExpression_NotName ::= Name '/' UnaryExpression
1946/.$putCase consumeBinaryExpressionWithName(OperatorIds.DIVIDE); $break ./
1947MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '%' UnaryExpression
1948/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./
1949MultiplicativeExpression_NotName ::= Name '%' UnaryExpression
1950/.$putCase consumeBinaryExpressionWithName(OperatorIds.REMAINDER); $break ./
1951/:$readableName Expression:/
1952
1953AdditiveExpression_NotName -> MultiplicativeExpression_NotName
1954AdditiveExpression_NotName ::= AdditiveExpression_NotName '+' MultiplicativeExpression
1955/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./
1956AdditiveExpression_NotName ::= Name '+' MultiplicativeExpression
1957/.$putCase consumeBinaryExpressionWithName(OperatorIds.PLUS); $break ./
1958AdditiveExpression_NotName ::= AdditiveExpression_NotName '-' MultiplicativeExpression
1959/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./
1960AdditiveExpression_NotName ::= Name '-' MultiplicativeExpression
1961/.$putCase consumeBinaryExpressionWithName(OperatorIds.MINUS); $break ./
1962/:$readableName Expression:/
1963
1964ShiftExpression_NotName -> AdditiveExpression_NotName
1965ShiftExpression_NotName ::= ShiftExpression_NotName '<<' AdditiveExpression
1966/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./
1967ShiftExpression_NotName ::= Name '<<' AdditiveExpression
1968/.$putCase consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT); $break ./
1969ShiftExpression_NotName ::= ShiftExpression_NotName '>>' AdditiveExpression
1970/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./
1971ShiftExpression_NotName ::= Name '>>' AdditiveExpression
1972/.$putCase consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT); $break ./
1973ShiftExpression_NotName ::= ShiftExpression_NotName '>>>' AdditiveExpression
1974/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
1975ShiftExpression_NotName ::= Name '>>>' AdditiveExpression
1976/.$putCase consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
1977/:$readableName Expression:/
1978
1979RelationalExpression_NotName -> ShiftExpression_NotName
1980RelationalExpression_NotName ::= ShiftExpression_NotName '<' ShiftExpression
1981/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./
1982RelationalExpression_NotName ::= Name '<' ShiftExpression
1983/.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS); $break ./
1984RelationalExpression_NotName ::= ShiftExpression_NotName '>' ShiftExpression
1985/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./
1986RelationalExpression_NotName ::= Name '>' ShiftExpression
1987/.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER); $break ./
1988RelationalExpression_NotName ::= RelationalExpression_NotName '<=' ShiftExpression
1989/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./
1990RelationalExpression_NotName ::= Name '<=' ShiftExpression
1991/.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL); $break ./
1992RelationalExpression_NotName ::= RelationalExpression_NotName '>=' ShiftExpression
1993/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./
1994RelationalExpression_NotName ::= Name '>=' ShiftExpression
1995/.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL); $break ./
1996/:$readableName Expression:/
1997
1998InstanceofExpression_NotName -> RelationalExpression_NotName
1999InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType
2000/.$putCase consumeInstanceOfExpressionWithName(); $break ./
2001InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType
2002/.$putCase consumeInstanceOfExpression(); $break ./
2003/:$readableName Expression:/
2004
2005EqualityExpression_NotName -> InstanceofExpression_NotName
2006EqualityExpression_NotName ::= EqualityExpression_NotName '==' InstanceofExpression
2007/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./
2008EqualityExpression_NotName ::= Name '==' InstanceofExpression
2009/.$putCase consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL); $break ./
2010EqualityExpression_NotName ::= EqualityExpression_NotName '!=' InstanceofExpression
2011/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./
2012EqualityExpression_NotName ::= Name '!=' InstanceofExpression
2013/.$putCase consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL); $break ./
2014/:$readableName Expression:/
2015
2016AndExpression_NotName -> EqualityExpression_NotName
2017AndExpression_NotName ::= AndExpression_NotName '&' EqualityExpression
2018/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./
2019AndExpression_NotName ::= Name '&' EqualityExpression
2020/.$putCase consumeBinaryExpressionWithName(OperatorIds.AND); $break ./
2021/:$readableName Expression:/
2022
2023ExclusiveOrExpression_NotName -> AndExpression_NotName
2024ExclusiveOrExpression_NotName ::= ExclusiveOrExpression_NotName '^' AndExpression
2025/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./
2026ExclusiveOrExpression_NotName ::= Name '^' AndExpression
2027/.$putCase consumeBinaryExpressionWithName(OperatorIds.XOR); $break ./
2028/:$readableName Expression:/
2029
2030InclusiveOrExpression_NotName -> ExclusiveOrExpression_NotName
2031InclusiveOrExpression_NotName ::= InclusiveOrExpression_NotName '|' ExclusiveOrExpression
2032/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./
2033InclusiveOrExpression_NotName ::= Name '|' ExclusiveOrExpression
2034/.$putCase consumeBinaryExpressionWithName(OperatorIds.OR); $break ./
2035/:$readableName Expression:/
2036
2037ConditionalAndExpression_NotName -> InclusiveOrExpression_NotName
2038ConditionalAndExpression_NotName ::= ConditionalAndExpression_NotName '&&' InclusiveOrExpression
2039/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./
2040ConditionalAndExpression_NotName ::= Name '&&' InclusiveOrExpression
2041/.$putCase consumeBinaryExpressionWithName(OperatorIds.AND_AND); $break ./
2042/:$readableName Expression:/
2043
2044ConditionalOrExpression_NotName -> ConditionalAndExpression_NotName
2045ConditionalOrExpression_NotName ::= ConditionalOrExpression_NotName '||' ConditionalAndExpression
2046/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./
2047ConditionalOrExpression_NotName ::= Name '||' ConditionalAndExpression
2048/.$putCase consumeBinaryExpressionWithName(OperatorIds.OR_OR); $break ./
2049/:$readableName Expression:/
2050
2051ConditionalExpression_NotName -> ConditionalOrExpression_NotName
2052ConditionalExpression_NotName ::= ConditionalOrExpression_NotName '?' Expression ':' ConditionalExpression
2053/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./
2054ConditionalExpression_NotName ::= Name '?' Expression ':' ConditionalExpression
2055/.$putCase consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ; $break ./
2056/:$readableName Expression:/
2057
2058AssignmentExpression_NotName -> ConditionalExpression_NotName
2059AssignmentExpression_NotName -> Assignment
2060/:$readableName Expression:/
2061
2062Expression_NotName -> AssignmentExpression_NotName
2063/:$readableName Expression:/
2064-----------------------------------------------
2065-- 1.5 features : end of generics
2066-----------------------------------------------
2067-----------------------------------------------
2068-- 1.5 features : annotation - Metadata feature jsr175
2069-----------------------------------------------
2070AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier
2071/.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./
2072/:$compliance 1.5:/
2073AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier TypeParameters
2074/.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./
2075/:$compliance 1.5:/
2076AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier TypeParameters
2077/.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./
2078/:$compliance 1.5:/
2079AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier
2080/.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./
2081/:$readableName AnnotationTypeDeclarationHeaderName:/
2082/:$compliance 1.5:/
2083
2084AnnotationTypeDeclarationHeader ::= AnnotationTypeDeclarationHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt
2085/.$putCase consumeAnnotationTypeDeclarationHeader() ; $break ./
2086/:$readableName AnnotationTypeDeclarationHeader:/
2087/:$compliance 1.5:/
2088
2089AnnotationTypeDeclaration ::= AnnotationTypeDeclarationHeader AnnotationTypeBody
2090/.$putCase consumeAnnotationTypeDeclaration() ; $break ./
2091/:$readableName AnnotationTypeDeclaration:/
2092/:$compliance 1.5:/
2093
2094AnnotationTypeBody ::= '{' AnnotationTypeMemberDeclarationsopt '}'
2095/:$readableName AnnotationTypeBody:/
2096/:$compliance 1.5:/
2097
2098AnnotationTypeMemberDeclarationsopt ::= $empty
2099/.$putCase consumeEmptyAnnotationTypeMemberDeclarationsopt() ; $break ./
2100/:$compliance 1.5:/
2101AnnotationTypeMemberDeclarationsopt ::= NestedType AnnotationTypeMemberDeclarations
2102/.$putCase consumeAnnotationTypeMemberDeclarationsopt() ; $break ./
2103/:$readableName AnnotationTypeMemberDeclarations:/
2104/:$compliance 1.5:/
2105
2106AnnotationTypeMemberDeclarations -> AnnotationTypeMemberDeclaration
2107/:$compliance 1.5:/
2108AnnotationTypeMemberDeclarations ::= AnnotationTypeMemberDeclarations AnnotationTypeMemberDeclaration
2109/.$putCase consumeAnnotationTypeMemberDeclarations() ; $break ./
2110/:$readableName AnnotationTypeMemberDeclarations:/
2111/:$compliance 1.5:/
2112
2113AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
2114/.$putCase consumeMethodHeaderNameWithTypeParameters(true); $break ./
2115AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
2116/.$putCase consumeMethodHeaderName(true); $break ./
2117/:$readableName MethodHeaderName:/
2118/:$compliance 1.5:/
2119
2120AnnotationMethodHeaderDefaultValueopt ::= $empty
2121/.$putCase consumeEmptyMethodHeaderDefaultValue() ; $break ./
2122/:$readableName MethodHeaderDefaultValue:/
2123/:$compliance 1.5:/
2124AnnotationMethodHeaderDefaultValueopt ::= DefaultValue
2125/.$putCase consumeMethodHeaderDefaultValue(); $break ./
2126/:$readableName MethodHeaderDefaultValue:/
2127/:$compliance 1.5:/
2128
2129AnnotationMethodHeader ::= AnnotationMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims AnnotationMethodHeaderDefaultValueopt
2130/.$putCase consumeMethodHeader(); $break ./
2131/:$readableName AnnotationMethodHeader:/
2132/:$compliance 1.5:/
2133
2134AnnotationTypeMemberDeclaration ::= AnnotationMethodHeader ';'
2135/.$putCase consumeAnnotationTypeMemberDeclaration() ; $break ./
2136/:$compliance 1.5:/
2137AnnotationTypeMemberDeclaration -> ConstantDeclaration
2138/:$compliance 1.5:/
2139AnnotationTypeMemberDeclaration -> ConstructorDeclaration
2140/:$compliance 1.5:/
2141AnnotationTypeMemberDeclaration -> TypeDeclaration
2142/:$readableName AnnotationTypeMemberDeclaration:/
2143/:$compliance 1.5:/
2144
2145DefaultValue ::= 'default' MemberValue
2146/:$readableName DefaultValue:/
2147/:$compliance 1.5:/
2148
2149Annotation -> NormalAnnotation
2150/:$compliance 1.5:/
2151Annotation -> MarkerAnnotation
2152/:$compliance 1.5:/
2153Annotation -> SingleMemberAnnotation
2154/:$readableName Annotation:/
2155/:$compliance 1.5:/
2156
2157AnnotationName ::= '@' Name
2158/.$putCase consumeAnnotationName() ; $break ./
2159/:$readableName AnnotationName:/
2160/:$compliance 1.5:/
2161
2162NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')'
2163/.$putCase consumeNormalAnnotation() ; $break ./
2164/:$readableName NormalAnnotation:/
2165/:$compliance 1.5:/
2166
2167MemberValuePairsopt ::= $empty
2168/.$putCase consumeEmptyMemberValuePairsopt() ; $break ./
2169/:$compliance 1.5:/
2170MemberValuePairsopt -> MemberValuePairs
2171/:$readableName MemberValuePairsopt:/
2172/:$compliance 1.5:/
2173
2174MemberValuePairs -> MemberValuePair
2175/:$compliance 1.5:/
2176MemberValuePairs ::= MemberValuePairs ',' MemberValuePair
2177/.$putCase consumeMemberValuePairs() ; $break ./
2178/:$readableName MemberValuePairs:/
2179/:$compliance 1.5:/
2180
2181MemberValuePair ::= SimpleName '=' EnterMemberValue MemberValue ExitMemberValue
2182/.$putCase consumeMemberValuePair() ; $break ./
2183/:$readableName MemberValuePair:/
2184/:$compliance 1.5:/
2185
2186EnterMemberValue ::= $empty
2187/.$putCase consumeEnterMemberValue() ; $break ./
2188/:$readableName EnterMemberValue:/
2189/:$compliance 1.5:/
2190
2191ExitMemberValue ::= $empty
2192/.$putCase consumeExitMemberValue() ; $break ./
2193/:$readableName ExitMemberValue:/
2194/:$compliance 1.5:/
2195
2196MemberValue -> ConditionalExpression_NotName
2197/:$compliance 1.5:/
2198MemberValue ::= Name
2199/.$putCase consumeMemberValueAsName() ; $break ./
2200/:$compliance 1.5:/
2201MemberValue -> Annotation
2202/:$compliance 1.5:/
2203MemberValue -> MemberValueArrayInitializer
2204/:$readableName MemberValue:/
2205/:$recovery_template Identifier:/
2206/:$compliance 1.5:/
2207
2208MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues ',' '}'
2209/.$putCase consumeMemberValueArrayInitializer() ; $break ./
2210/:$compliance 1.5:/
2211MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues '}'
2212/.$putCase consumeMemberValueArrayInitializer() ; $break ./
2213/:$compliance 1.5:/
2214MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace ',' '}'
2215/.$putCase consumeEmptyMemberValueArrayInitializer() ; $break ./
2216/:$compliance 1.5:/
2217MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace '}'
2218/.$putCase consumeEmptyMemberValueArrayInitializer() ; $break ./
2219/:$readableName MemberValueArrayInitializer:/
2220/:$compliance 1.5:/
2221
2222EnterMemberValueArrayInitializer ::= $empty
2223/.$putCase consumeEnterMemberValueArrayInitializer() ; $break ./
2224/:$readableName EnterMemberValueArrayInitializer:/
2225/:$compliance 1.5:/
2226
2227MemberValues -> MemberValue
2228/:$compliance 1.5:/
2229MemberValues ::= MemberValues ',' MemberValue
2230/.$putCase consumeMemberValues() ; $break ./
2231/:$readableName MemberValues:/
2232/:$compliance 1.5:/
2233
2234MarkerAnnotation ::= AnnotationName
2235/.$putCase consumeMarkerAnnotation() ; $break ./
2236/:$readableName MarkerAnnotation:/
2237/:$compliance 1.5:/
2238
2239SingleMemberAnnotationMemberValue ::= MemberValue
2240/.$putCase consumeSingleMemberAnnotationMemberValue() ; $break ./
2241/:$readableName MemberValue:/
2242/:$compliance 1.5:/
2243
2244SingleMemberAnnotation ::= AnnotationName '(' SingleMemberAnnotationMemberValue ')'
2245/.$putCase consumeSingleMemberAnnotation() ; $break ./
2246/:$readableName SingleMemberAnnotation:/
2247/:$compliance 1.5:/
2248--------------------------------------
2249-- 1.5 features : end of annotation --
2250--------------------------------------
2251
2252-----------------------------------
2253-- 1.5 features : recovery rules --
2254-----------------------------------
2255RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
2256/.$putCase consumeRecoveryMethodHeaderNameWithTypeParameters(); $break ./
2257/:$compliance 1.5:/
2258RecoveryMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
2259/.$putCase consumeRecoveryMethodHeaderName(); $break ./
2260/:$readableName MethodHeaderName:/
2261
2262RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims AnnotationMethodHeaderDefaultValueopt
2263/.$putCase consumeMethodHeader(); $break ./
2264RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClause
2265/.$putCase consumeMethodHeader(); $break ./
2266/:$readableName MethodHeader:/
2267-----------------------------------
2268-- 1.5 features : recovery rules --
2269-----------------------------------
2270
2271/. }
2272}./
2273
2274$names
2275
2276PLUS_PLUS ::= '++'
2277MINUS_MINUS ::= '--'
2278EQUAL_EQUAL ::= '=='
2279LESS_EQUAL ::= '<='
2280GREATER_EQUAL ::= '>='
2281NOT_EQUAL ::= '!='
2282LEFT_SHIFT ::= '<<'
2283RIGHT_SHIFT ::= '>>'
2284UNSIGNED_RIGHT_SHIFT ::= '>>>'
2285PLUS_EQUAL ::= '+='
2286MINUS_EQUAL ::= '-='
2287MULTIPLY_EQUAL ::= '*='
2288DIVIDE_EQUAL ::= '/='
2289AND_EQUAL ::= '&='
2290OR_EQUAL ::= '|='
2291XOR_EQUAL ::= '^='
2292REMAINDER_EQUAL ::= '%='
2293LEFT_SHIFT_EQUAL ::= '<<='
2294RIGHT_SHIFT_EQUAL ::= '>>='
2295UNSIGNED_RIGHT_SHIFT_EQUAL ::= '>>>='
2296OR_OR ::= '||'
2297AND_AND ::= '&&'
2298PLUS ::= '+'
2299MINUS ::= '-'
2300NOT ::= '!'
2301REMAINDER ::= '%'
2302XOR ::= '^'
2303AND ::= '&'
2304MULTIPLY ::= '*'
2305OR ::= '|'
2306TWIDDLE ::= '~'
2307DIVIDE ::= '/'
2308GREATER ::= '>'
2309LESS ::= '<'
2310LPAREN ::= '('
2311RPAREN ::= ')'
2312LBRACE ::= '{'
2313RBRACE ::= '}'
2314LBRACKET ::= '['
2315RBRACKET ::= ']'
2316SEMICOLON ::= ';'
2317QUESTION ::= '?'
2318COLON ::= ':'
2319COMMA ::= ','
2320DOT ::= '.'
2321EQUAL ::= '='
2322AT ::= '@'
2323ELLIPSIS ::= '...'
2324
2325$end
2326-- need a carriage return after the $end