blob: 3c4973665c6e0320864dd6ce7925d49174f9afdd [file] [log] [blame]
Stephan Herrmann234bfec2011-04-26 08:26:58 +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-- {ObjectTeams: keywords
54 as base callin playedBy precedence readonly team tsuper when with within
55
56-- The following symbols are recoknized as keywords only in specific contexts:
57-- After "<-":
58 replace after before
59-- After "->":
60 get set
61
62-- Markus Witte}
63
64 IntegerLiteral
65 LongLiteral
66 FloatingPointLiteral
67 DoubleLiteral
68 CharacterLiteral
69 StringLiteral
70
71 PLUS_PLUS
72 MINUS_MINUS
73 EQUAL_EQUAL
74 LESS_EQUAL
75 GREATER_EQUAL
76 NOT_EQUAL
77 LEFT_SHIFT
78 RIGHT_SHIFT
79 UNSIGNED_RIGHT_SHIFT
80 PLUS_EQUAL
81 MINUS_EQUAL
82 MULTIPLY_EQUAL
83 DIVIDE_EQUAL
84 AND_EQUAL
85 OR_EQUAL
86 XOR_EQUAL
87 REMAINDER_EQUAL
88 LEFT_SHIFT_EQUAL
89 RIGHT_SHIFT_EQUAL
90 UNSIGNED_RIGHT_SHIFT_EQUAL
91 OR_OR
92 AND_AND
93 PLUS
94 MINUS
95 NOT
96 REMAINDER
97 XOR
98 AND
99 MULTIPLY
100 OR
101 TWIDDLE
102 DIVIDE
103 GREATER
104 LESS
105 LPAREN
106 RPAREN
107 LBRACE
108 RBRACE
109 LBRACKET
110 RBRACKET
111 SEMICOLON
112 QUESTION
113 COLON
114 COMMA
115 DOT
116 EQUAL
117 AT
118 ELLIPSIS
119-- {ObjectTeams
120 BINDIN
121 BINDOUT
122 CALLOUT_OVERRIDE
123-- Markus Witte}
124-- BodyMarker
125
126$Alias
127
128 '++' ::= PLUS_PLUS
129 '--' ::= MINUS_MINUS
130 '==' ::= EQUAL_EQUAL
131 '<=' ::= LESS_EQUAL
132 '>=' ::= GREATER_EQUAL
133 '!=' ::= NOT_EQUAL
134 '<<' ::= LEFT_SHIFT
135 '>>' ::= RIGHT_SHIFT
136 '>>>' ::= UNSIGNED_RIGHT_SHIFT
137 '+=' ::= PLUS_EQUAL
138 '-=' ::= MINUS_EQUAL
139 '*=' ::= MULTIPLY_EQUAL
140 '/=' ::= DIVIDE_EQUAL
141 '&=' ::= AND_EQUAL
142 '|=' ::= OR_EQUAL
143 '^=' ::= XOR_EQUAL
144 '%=' ::= REMAINDER_EQUAL
145 '<<=' ::= LEFT_SHIFT_EQUAL
146 '>>=' ::= RIGHT_SHIFT_EQUAL
147 '>>>=' ::= UNSIGNED_RIGHT_SHIFT_EQUAL
148 '||' ::= OR_OR
149 '&&' ::= AND_AND
150 '+' ::= PLUS
151 '-' ::= MINUS
152 '!' ::= NOT
153 '%' ::= REMAINDER
154 '^' ::= XOR
155 '&' ::= AND
156 '*' ::= MULTIPLY
157 '|' ::= OR
158 '~' ::= TWIDDLE
159 '/' ::= DIVIDE
160 '>' ::= GREATER
161 '<' ::= LESS
162 '(' ::= LPAREN
163 ')' ::= RPAREN
164 '{' ::= LBRACE
165 '}' ::= RBRACE
166 '[' ::= LBRACKET
167 ']' ::= RBRACKET
168 ';' ::= SEMICOLON
169 '?' ::= QUESTION
170 ':' ::= COLON
171 ',' ::= COMMA
172 '.' ::= DOT
173 '=' ::= EQUAL
174 '@' ::= AT
175 '...' ::= ELLIPSIS
176
177-- {ObjectTeams
178 '<-' ::= BINDIN
179 '->' ::= BINDOUT
180 '=>' ::= CALLOUT_OVERRIDE
181-- Markus Witte}
182
183$Start
184 Goal
185
186$Rules
187
188/.// This method is part of an automatic generation : do NOT edit-modify
189protected void consumeRule(int act) {
190 switch ( act ) {
191./
192
193
194
195Goal ::= '++' CompilationUnit
196Goal ::= '--' MethodBody
197-- Initializer
198Goal ::= '>>' StaticInitializer
199Goal ::= '>>' Initializer
200-- error recovery
201-- Modifiersopt is used to properly consume a header and exit the rule reduction at the end of the parse() method
202Goal ::= '>>>' Header1 Modifiersopt
203Goal ::= '!' Header2 Modifiersopt
204Goal ::= '*' BlockStatements
205Goal ::= '*' CatchHeader
206-- JDOM
207Goal ::= '&&' FieldDeclaration
208Goal ::= '||' ImportDeclaration
209Goal ::= '?' PackageDeclaration
210Goal ::= '+' TypeDeclaration
211Goal ::= '/' GenericMethodDeclaration
212Goal ::= '&' ClassBodyDeclarations
213-- code snippet
214Goal ::= '%' Expression
215Goal ::= '%' ArrayInitializer
216-- completion parser
217Goal ::= '~' BlockStatementsopt
218-- source type converter
219Goal ::= '||' MemberValue
220-- syntax diagnosis
221Goal ::= '?' AnnotationTypeMemberDeclaration
222--{ObjectTeams new goals:
223Goal ::= ':' CallinParameterMappings
224Goal ::= ';' CalloutParameterMappings
225Goal ::= '^' ParameterMapping
226Goal ::= '<' MethodSpecShort
227Goal ::= '>' MethodSpecLong
228-- SH}
229/:$readableName Goal:/
230
231-- {ObjectTeams
232-- insert new Goals for Delta-Compiling
233-- for Callin/Callout-Binding
234-- Markus Witte}
235
236Literal -> IntegerLiteral
237Literal -> LongLiteral
238Literal -> FloatingPointLiteral
239Literal -> DoubleLiteral
240Literal -> CharacterLiteral
241Literal -> StringLiteral
242Literal -> null
243Literal -> BooleanLiteral
244/:$readableName Literal:/
245BooleanLiteral -> true
246BooleanLiteral -> false
247/:$readableName BooleanLiteral:/
248
249Type ::= PrimitiveType
250/.$putCase consumePrimitiveType(); $break ./
251Type -> ReferenceType
252-- {ObjectTeams
253Type -> LiftingType
254Type -> ArrayLiftingType
255Type -> InvalidDeclaredArrayLifting
256-- Markus Witte}
257/:$readableName Type:/
258
259PrimitiveType -> NumericType
260/:$readableName PrimitiveType:/
261NumericType -> IntegralType
262NumericType -> FloatingPointType
263/:$readableName NumericType:/
264
265PrimitiveType -> 'boolean'
266PrimitiveType -> 'void'
267IntegralType -> 'byte'
268IntegralType -> 'short'
269IntegralType -> 'int'
270IntegralType -> 'long'
271IntegralType -> 'char'
272/:$readableName IntegralType:/
273FloatingPointType -> 'float'
274FloatingPointType -> 'double'
275/:$readableName FloatingPointType:/
276
277ReferenceType ::= ClassOrInterfaceType
278/.$putCase consumeReferenceType(); $break ./
279ReferenceType -> ArrayType
280/:$readableName ReferenceType:/
281
282---------------------------------------------------------------
283-- 1.5 feature
284---------------------------------------------------------------
285ClassOrInterfaceType -> ClassOrInterface
286ClassOrInterfaceType -> GenericType
287/:$readableName Type:/
288
289ClassOrInterface ::= Name
290/.$putCase consumeClassOrInterfaceName(); $break ./
291ClassOrInterface ::= GenericType '.' Name
292/.$putCase consumeClassOrInterface(); $break ./
293/:$readableName Type:/
294
295GenericType ::= ClassOrInterface TypeArguments
296/.$putCase consumeGenericType(); $break ./
297/:$readableName GenericType:/
298
299-- {ObjectTeams: "Base as Role" types:
300
301LiftingType ::= ClassType 'as' ClassType
302/.$putCase consumeLiftingType(); $break ./
303/:$readableName LiftingType:/
304
305ArrayLiftingType ::= ArrayType 'as' ArrayType
306/.$putCase consumeLiftingTypeArray(); $break ./
307/:$readableName ArrayLiftingType:/
308
309-- handle invalid array liftings: "Type as Array" and "Array as Type"
310InvalidDeclaredArrayLifting ::= ClassType 'as' ArrayType
311/.$putCase consumeLiftingTypeArrayInvalid(); $break ./
312/:$readableName InvalidDeclaredArrayLifting:/
313
314InvalidDeclaredArrayLifting ::= ArrayType 'as' ClassType
315/.$putCase consumeLiftingTypeArrayInvalid(); $break ./
316/:$readableName InvalidDeclaredArrayLifting:/
317-- SH}
318
319-- {ObjectTeams: "base.R" types:
320
321BaseAnchoredType ::= 'base' '.' SimpleName
322/.$putCase consumeBaseAnchoredType(); $break ./
323/:$readableName QualifiedName:/
324
325-- Connecting BaseAnchoredType to other rules (2 variants):
326-- 1.) connect via Type->ReferenceType->ClassOrInterfaceType
327-- as well as via ClassType->ClassOrInterfaceType
328ClassOrInterfaceType -> BaseAnchoredType
329/:$readableName BaseAnchoredType:/
330
331-- 2.) via ReferenceType we may add dimensions:
332ReferenceType -> BaseAnchoredType Dims
333/:$readableName ArrayOfBaseAnchoredType:/
334-- SH}
335
336--
337-- These rules have been rewritten to avoid some conflicts introduced
338-- by adding the 1.1 features
339--
340-- ArrayType ::= PrimitiveType '[' ']'
341-- ArrayType ::= Name '[' ']'
342-- ArrayType ::= ArrayType '[' ']'
343--
344
345ArrayTypeWithTypeArgumentsName ::= GenericType '.' Name
346/.$putCase consumeArrayTypeWithTypeArgumentsName(); $break ./
347/:$readableName ArrayTypeWithTypeArgumentsName:/
348
349ArrayType ::= PrimitiveType Dims
350/.$putCase consumePrimitiveArrayType(); $break ./
351ArrayType ::= Name Dims
352/.$putCase consumeNameArrayType(); $break ./
353ArrayType ::= ArrayTypeWithTypeArgumentsName Dims
354/.$putCase consumeGenericTypeNameArrayType(); $break ./
355ArrayType ::= GenericType Dims
356/.$putCase consumeGenericTypeArrayType(); $break ./
357/:$readableName ArrayType:/
358
359ClassType -> ClassOrInterfaceType
360/:$readableName ClassType:/
361
362--------------------------------------------------------------
363--------------------------------------------------------------
364
365Name -> SimpleName
366Name -> QualifiedName
367/:$readableName Name:/
368/:$recovery_template Identifier:/
369
370SimpleName -> 'Identifier'
371/:$readableName SimpleName:/
372
373QualifiedName ::= Name '.' SimpleName
374/.$putCase consumeQualifiedName(); $break ./
375/:$readableName QualifiedName:/
376
377CompilationUnit ::= EnterCompilationUnit InternalCompilationUnit
378/.$putCase consumeCompilationUnit(); $break ./
379/:$readableName CompilationUnit:/
380
381InternalCompilationUnit ::= PackageDeclaration
382/.$putCase consumeInternalCompilationUnit(); $break ./
383InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports
384/.$putCase consumeInternalCompilationUnit(); $break ./
385InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports TypeDeclarations
386/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
387InternalCompilationUnit ::= PackageDeclaration TypeDeclarations
388/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
389InternalCompilationUnit ::= ImportDeclarations ReduceImports
390/.$putCase consumeInternalCompilationUnit(); $break ./
391InternalCompilationUnit ::= TypeDeclarations
392/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
393InternalCompilationUnit ::= ImportDeclarations ReduceImports TypeDeclarations
394/.$putCase consumeInternalCompilationUnitWithTypes(); $break ./
395InternalCompilationUnit ::= $empty
396/.$putCase consumeEmptyInternalCompilationUnit(); $break ./
397/:$readableName CompilationUnit:/
398
399ReduceImports ::= $empty
400/.$putCase consumeReduceImports(); $break ./
401/:$readableName ReduceImports:/
402
403EnterCompilationUnit ::= $empty
404/.$putCase consumeEnterCompilationUnit(); $break ./
405/:$readableName EnterCompilationUnit:/
406
407Header -> ImportDeclaration
408Header -> PackageDeclaration
409Header -> ClassHeader
410Header -> InterfaceHeader
411Header -> EnumHeader
412Header -> AnnotationTypeDeclarationHeader
413Header -> StaticInitializer
414Header -> RecoveryMethodHeader
415Header -> FieldDeclaration
416Header -> AllocationHeader
417Header -> ArrayCreationHeader
418--{ObjectTeams:
419Header -> RecoveryBindingHeader
420Header -> PrecedenceDeclaration
421-- SH}
422/:$readableName Header:/
423
424Header1 -> Header
425Header1 -> ConstructorHeader
426/:$readableName Header1:/
427
428Header2 -> Header
429Header2 -> EnumConstantHeader
430/:$readableName Header2:/
431
Stephan Herrmann29b019c2011-04-26 10:30:44 +0000432CatchHeader ::= 'catch' '(' CatchFormalParameter ')' '{'
Stephan Herrmann234bfec2011-04-26 08:26:58 +0000433/.$putCase consumeCatchHeader(); $break ./
434/:$readableName CatchHeader:/
435
Stephan Herrmann29b019c2011-04-26 10:30:44 +0000436CatchFormalParameter ::= Modifiersopt Type VariableDeclaratorId
437/.$putCase consumeCatchFormalParameter(false); $break ./
438CatchFormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId
439/.$putCase consumeCatchFormalParameter(true); $break ./
440/:$readableName FormalParameter:/
441/:$compliance 1.5:/
442/:$recovery_template Identifier Identifier:/
443
Stephan Herrmann234bfec2011-04-26 08:26:58 +0000444ImportDeclarations -> ImportDeclaration
445ImportDeclarations ::= ImportDeclarations ImportDeclaration
446/.$putCase consumeImportDeclarations(); $break ./
447/:$readableName ImportDeclarations:/
448
449TypeDeclarations -> TypeDeclaration
450TypeDeclarations ::= TypeDeclarations TypeDeclaration
451/.$putCase consumeTypeDeclarations(); $break ./
452/:$readableName TypeDeclarations:/
453
454PackageDeclaration ::= PackageDeclarationName ';'
455/.$putCase consumePackageDeclaration(); $break ./
456/:$readableName PackageDeclaration:/
457
458PackageDeclarationName ::= Modifiers 'package' PushRealModifiers Name
459/.$putCase consumePackageDeclarationNameWithModifiers(); $break ./
460/:$readableName PackageDeclarationName:/
461/:$compliance 1.5:/
462
463PackageDeclarationName ::= PackageComment 'package' Name
464/.$putCase consumePackageDeclarationName(); $break ./
465/:$readableName PackageDeclarationName:/
466
467PackageComment ::= $empty
468/.$putCase consumePackageComment(); $break ./
469/:$readableName PackageComment:/
470
471ImportDeclaration -> SingleTypeImportDeclaration
472ImportDeclaration -> TypeImportOnDemandDeclaration
473-----------------------------------------------
474-- 1.5 feature
475-----------------------------------------------
476ImportDeclaration -> SingleStaticImportDeclaration
477--{ObjectTeams: base import:
478ImportDeclaration -> SingleBaseImportDeclaration
479-- SH}
480ImportDeclaration -> StaticImportOnDemandDeclaration
481/:$readableName ImportDeclaration:/
482
483SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';'
484/.$putCase consumeImportDeclaration(); $break ./
485/:$readableName SingleTypeImportDeclaration:/
486
487-- {ObjectTeams: special case: allow 'team' in imported package/type name:
488-- orig: SingleTypeImportDeclarationName ::= 'import' Name
489SingleTypeImportDeclarationName ::= 'import' ImportName
490/.$putCase consumeSingleTypeImportDeclarationName(); $break ./
491/:$readableName SingleTypeImportDeclarationName:/
492
493ImportName -> Name
494ImportName ::= Name '.' 'team' '.' Name
495/.$putCase consumeNameContainingTeam(); $break ./
496/:$readableName Name:/
497-- SH}
498
499TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName ';'
500/.$putCase consumeImportDeclaration(); $break ./
501/:$readableName TypeImportOnDemandDeclaration:/
502
503TypeImportOnDemandDeclarationName ::= 'import' Name '.' '*'
504/.$putCase consumeTypeImportOnDemandDeclarationName(); $break ./
505/:$readableName TypeImportOnDemandDeclarationName:/
506
507TypeDeclaration -> ClassDeclaration
508TypeDeclaration -> InterfaceDeclaration
509-- this declaration in part of a list od declaration and we will
510-- use and optimized list length calculation process
511-- thus we decrement the number while it will be incremend.....
512TypeDeclaration ::= ';'
513/. $putCase consumeEmptyTypeDeclaration(); $break ./
514-----------------------------------------------
515-- 1.5 feature
516-----------------------------------------------
517TypeDeclaration -> EnumDeclaration
518TypeDeclaration -> AnnotationTypeDeclaration
519/:$readableName TypeDeclaration:/
520
521--18.7 Only in the LALR(1) Grammar
522
523Modifiers -> Modifier
524Modifiers ::= Modifiers Modifier
525/.$putCase consumeModifiers2(); $break ./
526/:$readableName Modifiers:/
527
528Modifier -> 'public'
529Modifier -> 'protected'
530Modifier -> 'private'
531Modifier -> 'static'
532Modifier -> 'abstract'
533Modifier -> 'final'
534Modifier -> 'native'
535Modifier -> 'synchronized'
536Modifier -> 'transient'
537Modifier -> 'volatile'
538Modifier -> 'strictfp'
539Modifier ::= Annotation
540/.$putCase consumeAnnotationAsModifier(); $break ./
541-- {ObjectTeams
542Modifier -> 'team'
543Modifier -> 'callin'
544Modifier -> 'readonly'
545-- Markus Witte}
546/:$readableName Modifier:/
547
548--18.8 Productions from 8: Class Declarations
549--ClassModifier ::=
550-- 'abstract'
551-- | 'final'
552-- | 'public'
553--18.8.1 Productions from 8.1: Class Declarations
554
555ClassDeclaration ::= ClassHeader ClassBody
556/.$putCase consumeClassDeclaration(); $break ./
557/:$readableName ClassDeclaration:/
558
559--{ObjectTeams: playedBy & guard predicate support:
560-- orig: ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt
561ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt ClassHeaderPlayedByopt Predicateopt
562-- MW+SH}
563/.$putCase consumeClassHeader(); $break ./
564/:$readableName ClassHeader:/
565
566-----------------------------------------------
567-- 1.5 features : generics
568-----------------------------------------------
569ClassHeaderName ::= ClassHeaderName1 TypeParameters
570/.$putCase consumeTypeHeaderNameWithTypeParameters(); $break ./
571
572ClassHeaderName -> ClassHeaderName1
573/:$readableName ClassHeaderName:/
574
575ClassHeaderName1 ::= Modifiersopt 'class' 'Identifier'
576/.$putCase consumeClassHeaderName1(); $break ./
577/:$readableName ClassHeaderName:/
578
579ClassHeaderExtends ::= 'extends' ClassType
580/.$putCase consumeClassHeaderExtends(); $break ./
581/:$readableName ClassHeaderExtends:/
582
583ClassHeaderImplements ::= 'implements' InterfaceTypeList
584/.$putCase consumeClassHeaderImplements(); $break ./
585/:$readableName ClassHeaderImplements:/
586
587-- {ObjectTeams: ==== playedBy ====
588ClassHeaderPlayedByopt ::= $empty
589ClassHeaderPlayedByopt -> ClassHeaderPlayedBy
590/:$readableName ClassHeaderPlayedBy:/
591
592ClassHeaderPlayedBy ::= 'playedBy' ClassType
593/.$putCase consumeClassHeaderPlayedBy(); $break ./
594/:$readableName ClassHeaderPlayedBy:/
595
596-- Markus Witte}
597
598--{ObjectTeams: ==== predicates ====
599Predicateopt ::= $empty
600Predicateopt -> Predicate
601
602Predicate -> RolePredicate
603Predicate -> BasePredicate
604
605RolePredicate ::= PredicateHeader PredicateBody
606/:$readableName Predicate:/
607
608PredicateHeader ::= 'when'
609/.$putCase consumePredicate(false); $break ./
610/:$readableName PredicateHeader:/
611
612BasePredicate ::= BasePredicateHeader ForceBaseIsIdentifier PredicateBody RestoreBaseKeyword
613/:$readableName Predicate:/
614
615BasePredicateHeader ::= 'base' 'when'
616/.$putCase consumePredicate(true); $break ./
617/:$readableName PredicateHeader:/
618
619PredicateBody ::= '(' ForceNoDiet Expression RestoreDiet ')'
620/.$putCase consumePredicateExpression(); $break ./
621/:$readableName PredicateBody:/
622
623PredicateBody ::= '(' ')'
624/.$putCase consumePredicateMissingExpression(); $break ./
625
626
627ForceBaseIsIdentifier ::= $empty
628/.$putCase consumeForceBaseIsIdentifier(); $break ./
629/:$readableName ForceBaseIsIdentifier:/
630
631RestoreBaseKeyword ::= $empty
632/.$putCase consumeRestoreBaseKeyword(); $break ./
633/:$readableName RestoreBaseKeyword:/
634-- SH}
635
636InterfaceTypeList -> InterfaceType
637InterfaceTypeList ::= InterfaceTypeList ',' InterfaceType
638/.$putCase consumeInterfaceTypeList(); $break ./
639/:$readableName InterfaceTypeList:/
640
641InterfaceType ::= ClassOrInterfaceType
642/.$putCase consumeInterfaceType(); $break ./
643/:$readableName InterfaceType:/
644
645ClassBody ::= '{' ClassBodyDeclarationsopt '}'
646/:$readableName ClassBody:/
647/:$no_statements_recovery:/
648
649ClassBodyDeclarations ::= ClassBodyDeclaration
650ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration
651/.$putCase consumeClassBodyDeclarations(); $break ./
652/:$readableName ClassBodyDeclarations:/
653
654ClassBodyDeclaration -> ClassMemberDeclaration
655ClassBodyDeclaration -> StaticInitializer
656ClassBodyDeclaration -> ConstructorDeclaration
657--1.1 feature
658ClassBodyDeclaration ::= Diet NestedMethod CreateInitializer Block
659/.$putCase consumeClassBodyDeclaration(); $break ./
660/:$readableName ClassBodyDeclaration:/
661
662Diet ::= $empty
663/.$putCase consumeDiet(); $break./
664/:$readableName Diet:/
665
666Initializer ::= Diet NestedMethod CreateInitializer Block
667/.$putCase consumeClassBodyDeclaration(); $break ./
668/:$readableName Initializer:/
669
670CreateInitializer ::= $empty
671/.$putCase consumeCreateInitializer(); $break./
672/:$readableName CreateInitializer:/
673
674ClassMemberDeclaration -> FieldDeclaration
675ClassMemberDeclaration -> MethodDeclaration
676
677-- {ObjectTeams
678ClassMemberDeclaration -> BindingDeclaration
679ClassMemberDeclaration -> PrecedenceDeclaration
680-- Markus Witte}
681
682--1.1 feature
683ClassMemberDeclaration -> ClassDeclaration
684--1.1 feature
685ClassMemberDeclaration -> InterfaceDeclaration
686-- 1.5 feature
687ClassMemberDeclaration -> EnumDeclaration
688ClassMemberDeclaration -> AnnotationTypeDeclaration
689/:$readableName ClassMemberDeclaration:/
690
691-- Empty declarations are not valid Java ClassMemberDeclarations.
692-- However, since the current (2/14/97) Java compiler accepts them
693-- (in fact, some of the official tests contain this erroneous
694-- syntax)
695ClassMemberDeclaration ::= ';'
696/.$putCase consumeEmptyTypeDeclaration(); $break./
697
698GenericMethodDeclaration -> MethodDeclaration
699GenericMethodDeclaration -> ConstructorDeclaration
700/:$readableName GenericMethodDeclaration:/
701
702--18.8.2 Productions from 8.3: Field Declarations
703--VariableModifier ::=
704-- 'public'
705-- | 'protected'
706-- | 'private'
707-- | 'static'
708-- | 'final'
709-- | 'transient'
710-- | 'volatile'
711
712FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';'
713/.$putCase consumeFieldDeclaration(); $break ./
714/:$readableName FieldDeclaration:/
715
716VariableDeclarators -> VariableDeclarator
717VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator
718/.$putCase consumeVariableDeclarators(); $break ./
719/:$readableName VariableDeclarators:/
720
721VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization
722VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
723/:$readableName VariableDeclarator:/
724/:$recovery_template Identifier:/
725
726EnterVariable ::= $empty
727/.$putCase consumeEnterVariable(); $break ./
728/:$readableName EnterVariable:/
729
730ExitVariableWithInitialization ::= $empty
731/.$putCase consumeExitVariableWithInitialization(); $break ./
732/:$readableName ExitVariableWithInitialization:/
733
734ExitVariableWithoutInitialization ::= $empty
735/.$putCase consumeExitVariableWithoutInitialization(); $break ./
736/:$readableName ExitVariableWithoutInitialization:/
737
738ForceNoDiet ::= $empty
739/.$putCase consumeForceNoDiet(); $break ./
740/:$readableName ForceNoDiet:/
741RestoreDiet ::= $empty
742/.$putCase consumeRestoreDiet(); $break ./
743/:$readableName RestoreDiet:/
744
745VariableDeclaratorId ::= 'Identifier' Dimsopt
746/:$readableName VariableDeclaratorId:/
747/:$recovery_template Identifier:/
748
749VariableInitializer -> Expression
750VariableInitializer -> ArrayInitializer
751/:$readableName VariableInitializer:/
752/:$recovery_template Identifier:/
753
754--18.8.3 Productions from 8.4: Method Declarations
755--MethodModifier ::=
756-- 'public'
757-- | 'protected'
758-- | 'private'
759-- | 'static'
760-- | 'abstract'
761-- | 'final'
762-- | 'native'
763-- | 'synchronized'
764--
765
766MethodDeclaration -> AbstractMethodDeclaration
767MethodDeclaration ::= MethodHeader MethodBody
768/.$putCase // set to true to consume a method with a body
769 consumeMethodDeclaration(true); $break ./
770/:$readableName MethodDeclaration:/
771
772AbstractMethodDeclaration ::= MethodHeader ';'
773/.$putCase // set to false to consume a method without body
774 consumeMethodDeclaration(false); $break ./
775/:$readableName MethodDeclaration:/
776
777MethodHeader ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClauseopt
778/.$putCase consumeMethodHeader(); $break ./
779/:$readableName MethodDeclaration:/
780
781MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
782/.$putCase consumeMethodHeaderNameWithTypeParameters(false); $break ./
783MethodHeaderName ::= Modifiersopt Type 'Identifier' '('
784/.$putCase consumeMethodHeaderName(false); $break ./
785/:$readableName MethodHeaderName:/
786
787MethodHeaderRightParen ::= ')'
788/.$putCase consumeMethodHeaderRightParen(); $break ./
789/:$readableName ):/
790/:$recovery_template ):/
791
792MethodHeaderExtendedDims ::= Dimsopt
793/.$putCase consumeMethodHeaderExtendedDims(); $break ./
794/:$readableName MethodHeaderExtendedDims:/
795
796MethodHeaderThrowsClause ::= 'throws' ClassTypeList
797/.$putCase consumeMethodHeaderThrowsClause(); $break ./
798/:$readableName MethodHeaderThrowsClause:/
799
800ConstructorHeader ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderThrowsClauseopt
801/.$putCase consumeConstructorHeader(); $break ./
802/:$readableName ConstructorDeclaration:/
803
804ConstructorHeaderName ::= Modifiersopt TypeParameters 'Identifier' '('
805/.$putCase consumeConstructorHeaderNameWithTypeParameters(); $break ./
806ConstructorHeaderName ::= Modifiersopt 'Identifier' '('
807/.$putCase consumeConstructorHeaderName(); $break ./
808/:$readableName ConstructorHeaderName:/
809
810FormalParameterList -> FormalParameter
811FormalParameterList ::= FormalParameterList ',' FormalParameter
812/.$putCase consumeFormalParameterList(); $break ./
813/:$readableName FormalParameterList:/
814
815--1.1 feature
816FormalParameter ::= Modifiersopt Type VariableDeclaratorId
817/.$putCase consumeFormalParameter(false); $break ./
818FormalParameter ::= Modifiersopt Type '...' VariableDeclaratorId
819/.$putCase consumeFormalParameter(true); $break ./
820/:$readableName FormalParameter:/
821/:$compliance 1.5:/
822/:$recovery_template Identifier Identifier:/
823
824ClassTypeList -> ClassTypeElt
825ClassTypeList ::= ClassTypeList ',' ClassTypeElt
826/.$putCase consumeClassTypeList(); $break ./
827/:$readableName ClassTypeList:/
828
829ClassTypeElt ::= ClassType
830/.$putCase consumeClassTypeElt(); $break ./
831/:$readableName ClassType:/
832
833-- {ObjectTeams: added Predicateopt
834MethodBody ::= Predicateopt NestedMethod '{' BlockStatementsopt '}'
835/.$putCase consumeMethodBody(); $break ./
836/:$readableName MethodBody:/
837/:$no_statements_recovery:/
838-- SH}
839
840NestedMethod ::= $empty
841/.$putCase consumeNestedMethod(); $break ./
842/:$readableName NestedMethod:/
843
844-- {ObjectTeams ========== METHOD BINDINGS ==========
845BindingDeclaration -> CalloutBinding
846BindingDeclaration -> CallinBinding
847BindingDeclaration -> InvalidCallinBinding
848/:$readableName BindingDeclaration:/
849
850-- ==== CALLOUT: ====
851
852-- LONG:
853CalloutBinding ::= CalloutHeaderLong CalloutParameterMappingsopt
854/.$putCase consumeCalloutBindingLong(); $break ./
855/:$readableName CalloutBinding:/
856
857CalloutHeaderLong ::= CalloutBindingLeftLong MethodSpecLong
858/.$putCase consumeCalloutHeader(); $break ./
859/:$readableName CalloutHeader:/
860
861CalloutHeaderLong ::= CalloutBindingLeftLong CalloutFieldSpecLong
862/.$putCase consumeCalloutHeader(); $break ./
863/:$readableName CalloutHeader:/
864
865CalloutBindingLeftLong ::= MethodSpecLong CalloutKind
866/.$putCase consumeCalloutBindingLeft(true); $break ./
867/:$readableName CalloutBindingLeft:/
868
869
870-- SHORT:
871-- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty
872-- Note(SH): This rule includes callout to field short (there cannot be a distinct FieldSpecShort)
873CalloutBinding ::= Modifiersopt CalloutBindingLeftShort CalloutModifieropt MethodSpecShort ';'
874/.$putCase consumeCalloutHeader(); $break ./
875/:$readableName CalloutHeader:/
876
877CalloutBindingLeftShort ::= MethodSpecShort CalloutKind
878/.$putCase consumeCalloutBindingLeft(false); $break ./
879/:$readableName CalloutBindingLeft:/
880
881-- this one added to give better message for parameter mappings despite of missing signatures:
882-- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty
883CalloutBinding ::= Modifiersopt CalloutBindingLeftShort CalloutModifieropt MethodSpecShort CalloutParameterMappings
884/.$putCase consumeCalloutParameterMappingsInvalid(); $break ./
885
886-- SYMBOLS:
887CalloutKind -> '->'
888CalloutKind -> '=>'
889/:$readableName CalloutKind:/
890
891CalloutModifieropt ::= $empty
892CalloutModifieropt -> CalloutModifier
893/:$readableName CalloutModifier:/
894-- get set
895CalloutModifier ::= 'get'
896/.$putCase consumeCalloutModifier(TokenNameget); $break ./
897/:$readableName CalloutModifier:/
898CalloutModifier ::= 'set'
899/.$putCase consumeCalloutModifier(TokenNameset); $break ./
900/:$readableName CalloutModifier:/
901
902
903---- CALLOUT-BINDING-PARAMETERMAPPING
904CalloutParameterMappingsopt -> CalloutParameterMappings
905CalloutParameterMappingsopt ::= ';'
906/.$putCase consumeParameterMappingsEmpty(); $break ./
907/:$readableName EmptyParameterMappings:/
908
909
910CalloutParameterMappings ::= 'with' NestedParamMappings '{' CalloutParameterMappingList ,opt '}'
911/:$readableName CalloutParameterMappings:/
912
913-- note that this rule is needed for diagnose parsing where bodies of parameter mappings are ignored
914CalloutParameterMappingList ::= $empty
915/:$readableName EmptyParameterMappings:/
916
917CalloutParameterMappingList -> ParameterMapping
918CalloutParameterMappingList ::= CalloutParameterMappingList ',' ParameterMapping
919/.$putCase consumeParameterMappingList(); $break ./
920/:$readableName CalloutParameterMappingList:/
921
922ParameterMapping ::= Expression '->' 'Identifier'
923/.$putCase consumeParameterMappingOut(); $break ./
924
925ParameterMapping ::= 'Identifier' '<-' ForceBaseIsIdentifier Expression RestoreBaseKeyword
926/.$putCase consumeParameterMappingIn(); $break ./
927/:$readableName ParameterMapping:/
928
929
930NestedParamMappings ::= $empty
931/.$putCase consumeNestedParamMappings(); $break ./
932/:$readableName NestedParameterMappings:/
933
934-- ==== CALLIN-BINDING: ====
935
936-- LONG:
937CallinBinding ::= CallinHeaderLong CallinParameterMappingsopt
938/.$putCase consumeCallinBindingLong(); $break ./
939/:$readableName CallinBinding:/
940
941CallinHeaderLong ::= CallinBindingLeftLong CallinModifier MethodSpecsLong Predicateopt
942/.$putCase consumeCallinHeader(); $break ./
943/:$readableName CallinHeader:/
944
945-- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty
946CallinHeaderLong ::= Modifiersopt CallinLabel CallinBindingLeftLong CallinModifier MethodSpecsLong Predicateopt
947/.$putCase consumeCallinHeader(); $break ./
948
949CallinBindingLeftLong ::= MethodSpecLong '<-'
950/.$putCase consumeCallinBindingLeft(true); $break ./
951/:$readableName CallinBindingLeft:/
952
953-- SHORT:
954-- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty
955CallinBinding ::= Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort Predicateopt ';'
956/.$putCase consumeCallinHeader(); $break ./
957
958-- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty (2 OCCURENCES!)
959CallinBinding ::= Modifiersopt CallinLabel Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort Predicateopt ';'
960/.$putCase consumeCallinHeader(); $break ./
961
962CallinBindingLeftShort ::= MethodSpecShort '<-'
963/.$putCase consumeCallinBindingLeft(false); $break ./
964/:$readableName CallinBindingLeft:/
965
966-- LABEL:
967CallinLabel ::= SimpleName ':'
968/.$putCase consumeCallinLabel(); $break ./
969/:$readableName CallinLabel:/
970
971-- MODIFIER:
972CallinModifier ::= 'replace'
973/.$putCase consumeCallinModifier(TokenNamereplace); $break ./
974/:$readableName CallinModifier:/
975
976CallinModifier ::= 'before'
977/.$putCase consumeCallinModifier(TokenNamebefore); $break ./
978/:$readableName CallinModifier:/
979
980CallinModifier ::= 'after'
981/.$putCase consumeCallinModifier(TokenNameafter); $break ./
982/:$readableName CallinModifier:/
983
984
985-- These rules are added to parse invalid callin-bindings without replace/before/after modifier
986InvalidCallinModifier ::= $empty
987/.$putCase consumeCallinModifierMissing(); $break ./
988/:$readableName InvalidCallinModifier:/
989
990-- Note(SH): Modifiersopt is needed to make grammar LALR(1), in real life modifiers must be empty
991InvalidCallinBinding ::= Modifiersopt CallinBindingLeftShort InvalidCallinModifier BaseMethodSpecsShort
992/.$putCase consumeCallinBindingInvalid(false,false); $break ./
993/:$readableName InvalidCallinBinding:/
994
995InvalidCallinBinding ::= Modifiersopt CallinLabel Modifiersopt CallinBindingLeftShort InvalidCallinModifier BaseMethodSpecsShort
996/.$putCase consumeCallinBindingInvalid(false,false); $break ./
997/:$readableName InvalidCallinBinding:/
998
999InvalidCallinBinding ::= Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort CallinParameterMappings
1000/.$putCase consumeCallinBindingInvalid(false,true); $break ./
1001/:$readableName InvalidCallinBinding:/
1002
1003InvalidCallinBinding ::= Modifiersopt CallinLabel Modifiersopt CallinBindingLeftShort CallinModifier BaseMethodSpecsShort CallinParameterMappings
1004/.$putCase consumeCallinBindingInvalid(false,true); $break ./
1005/:$readableName InvalidCallinBinding:/
1006
1007InvalidCallinBinding ::= CallinBindingLeftLong InvalidCallinModifier MethodSpecsLong CallinParameterMappingsopt
1008/.$putCase consumeCallinBindingInvalid(true,false); $break ./
1009/:$readableName InvalidCallinBinding:/
1010
1011InvalidCallinBinding ::= Modifiersopt CallinLabel CallinBindingLeftLong InvalidCallinModifier MethodSpecsLong CallinParameterMappingsopt
1012/.$putCase consumeCallinBindingInvalid(true,false); $break ./
1013/:$readableName InvalidCallinBinding:/
1014
1015
1016---- CALLIN-BINDING-PARAMETERMAPPING
1017CallinParameterMappingsopt -> CallinParameterMappings
1018CallinParameterMappingsopt ::= ';'
1019/.$putCase consumeParameterMappingsEmpty(); $break ./
1020/:$readableName EmptyParameterMappings:/
1021
1022CallinParameterMappings ::= 'with' NestedParamMappings '{' CallinParameterMappingList ,opt '}'
1023/:$readableName CallinParameterMappings:/
1024
1025-- note that this rule is needed for diagnose parsing where bodies of parameter mappings are ignored
1026CallinParameterMappingList ::= $empty
1027/:$readableName EmptyParameterMappings:/
1028
1029CallinParameterMappingList -> ParameterMapping
1030CallinParameterMappingList ::= CallinParameterMappingList ',' ParameterMapping
1031/.$putCase consumeParameterMappingList(); $break ./
1032/:$readableName ParameterMappingList:/
1033
1034-- ==== METHOD_SPEC: ====
1035
1036MethodSpecShort ::= SimpleName
1037/.$putCase consumeMethodSpecShort(); $break ./
1038/:$readableName MethodSpecShort:/
1039
1040MethodSpecLong ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen
1041/.$putCase consumeMethodSpecLong(false); $break ./
1042/:$readableName MethodSpecLong:/
1043
1044-- explicitly handle this error case:
1045MethodSpecLong ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen
1046/.$putCase consumeMethodSpecLongCtor(); $break ./
1047/:$readableName IllegalMethodSpecLong:/
1048
1049-- base of callin can use '+' after return type:
1050BaseMethodSpecLong ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen
1051/.$putCase consumeMethodSpecLong(false); $break ./
1052/:$readableName MethodSpecLong:/
1053
1054BaseMethodSpecLong ::= MethodSpecNamePlus FormalParameterListopt MethodHeaderRightParen
1055/.$putCase consumeMethodSpecLong(true); $break ./
1056/:$readableName MethodSpecLong:/
1057
1058MethodSpecNamePlus ::= Modifiersopt Type '+' 'Identifier' '('
1059/.$putCase consumeMethodHeaderName(false); $break ./
1060/:$readableName MethodSpecName:/
1061
1062CalloutFieldSpecLong ::= CalloutModifier Type 'Identifier'
1063/.$putCase consumeFieldSpecLong(); $break ./
1064/:$readableName CallloutFieldSpec:/
1065
1066BaseMethodSpecsShort -> BaseMethodSpecListShort
1067/:$readableName MethodSpecsShort:/
1068
1069BaseMethodSpecListShort -> BaseMethodSpecShort
1070BaseMethodSpecListShort ::= BaseMethodSpecListShort ',' BaseMethodSpecShort
1071/.$putCase consumeMethodSpecList(); $break ./
1072/:$readableName MethodSpecListShort:/
1073
1074BaseMethodSpecShort -> MethodSpecShort
1075
1076MethodSpecsLong -> MethodSpecListLong
1077/:$readableName MethodSpecsLong:/
1078
1079MethodSpecListLong -> BaseMethodSpecLong
1080MethodSpecListLong ::= MethodSpecListLong ',' BaseMethodSpecLong
1081/.$putCase consumeMethodSpecList(); $break ./
1082/:$readableName MethodSpecListLong:/
1083
1084-- ==== PRECEDENCE DECLARATION ====
1085PrecedenceDeclaration ::= 'precedence' BindingNames ';'
1086/.$putCase consumePrecedenceDeclaration(false); $break ./
1087/:$readableName PrecedenceDeclaration:/
1088
1089PrecedenceDeclaration ::= 'precedence' 'after' BindingNames ';'
1090/.$putCase consumePrecedenceDeclaration(true); $break ./
1091/:$readableName PrecedenceAfterDeclaration:/
1092
1093BindingNames -> BindingName
1094BindingNames ::= BindingNames ',' BindingName
1095/.$putCase consumeBindingNames(); $break ./
1096/:$readableName CallinBindingNames:/
1097
1098BindingName ::= Name
1099/.$putCase consumeBindingName(); $break ./
1100/:$readableName CallinBindingName:/
1101-- Markus Witte}
1102
1103--18.8.4 Productions from 8.5: Static Initializers
1104
1105StaticInitializer ::= StaticOnly Block
1106/.$putCase consumeStaticInitializer(); $break./
1107/:$readableName StaticInitializer:/
1108
1109StaticOnly ::= 'static'
1110/.$putCase consumeStaticOnly(); $break ./
1111/:$readableName StaticOnly:/
1112
1113--18.8.5 Productions from 8.6: Constructor Declarations
1114--ConstructorModifier ::=
1115-- 'public'
1116-- | 'protected'
1117-- | 'private'
1118--
1119--
1120ConstructorDeclaration ::= ConstructorHeader MethodBody
1121/.$putCase consumeConstructorDeclaration() ; $break ./
1122-- These rules are added to be able to parse constructors with no body
1123ConstructorDeclaration ::= ConstructorHeader ';'
1124/.$putCase consumeInvalidConstructorDeclaration() ; $break ./
1125/:$readableName ConstructorDeclaration:/
1126
1127-- the rules ExplicitConstructorInvocationopt has been expanded
1128-- in the rule below in order to make the grammar lalr(1).
1129
1130ExplicitConstructorInvocation ::= 'this' '(' ArgumentListopt ')' ';'
1131/.$putCase consumeExplicitConstructorInvocation(0, THIS_CALL); $break ./
1132
1133ExplicitConstructorInvocation ::= OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
1134/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(0,THIS_CALL); $break ./
1135
1136ExplicitConstructorInvocation ::= 'super' '(' ArgumentListopt ')' ';'
1137/.$putCase consumeExplicitConstructorInvocation(0,SUPER_CALL); $break ./
1138
1139ExplicitConstructorInvocation ::= OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
1140/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(0,SUPER_CALL); $break ./
1141
1142-- {ObjectTeams
1143ExplicitConstructorInvocation ::= 'tsuper' '(' ArgumentListopt ')' ';'
1144/.$putCase consumeExplicitConstructorInvocation(0,TSUPER_CALL); $break ./
1145
1146ExplicitConstructorInvocation ::= Name '.' 'tsuper' '(' ArgumentListopt ')' ';'
1147/.$putCase consumeExplicitConstructorInvocation(2,TSUPER_CALL); $break ./
1148-- Markus Witte}
1149
1150--1.1 feature
1151ExplicitConstructorInvocation ::= Primary '.' 'super' '(' ArgumentListopt ')' ';'
1152/.$putCase consumeExplicitConstructorInvocation(1, SUPER_CALL); $break ./
1153
1154ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
1155/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(1, SUPER_CALL); $break ./
1156
1157--1.1 feature
1158ExplicitConstructorInvocation ::= Name '.' 'super' '(' ArgumentListopt ')' ';'
1159/.$putCase consumeExplicitConstructorInvocation(2, SUPER_CALL); $break ./
1160
1161ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
1162/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(2, SUPER_CALL); $break ./
1163
1164--1.1 feature
1165ExplicitConstructorInvocation ::= Primary '.' 'this' '(' ArgumentListopt ')' ';'
1166/.$putCase consumeExplicitConstructorInvocation(1, THIS_CALL); $break ./
1167
1168ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
1169/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(1, THIS_CALL); $break ./
1170
1171--1.1 feature
1172ExplicitConstructorInvocation ::= Name '.' 'this' '(' ArgumentListopt ')' ';'
1173/.$putCase consumeExplicitConstructorInvocation(2, THIS_CALL); $break ./
1174
1175ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
1176/.$putCase consumeExplicitConstructorInvocationWithTypeArguments(2, THIS_CALL); $break ./
1177/:$readableName ExplicitConstructorInvocation:/
1178
1179-- {ObjectTeams
1180BaseConstructorExpression ::= 'base' '(' ArgumentListopt ')'
1181/.$putCase consumeExplicitConstructorInvocationBase(0); $break ./
1182/:$readableName BaseConstructorInvocation:/
1183
1184BaseConstructorInvocation ::= 'base' '(' ArgumentListopt ')'
1185/.$putCase consumeExplicitConstructorInvocationBase(1); $break ./
1186/:$readableName BaseConstructorInvocation:/
1187
1188BaseConstructorInvocation ::= Primary . 'base' '(' ArgumentListopt ')'
1189/.$putCase consumeExplicitConstructorInvocationBase(2); $break ./
1190/:$readableName QualifiedBaseConstructorInvocation:/
1191
1192BaseConstructorInvocation ::= Name . 'base' '(' ArgumentListopt ')'
1193/.$putCase consumeExplicitConstructorInvocationBase(3); $break ./
1194/:$readableName QualifiedBaseConstructorInvocation:/
1195-- Markus Witte}
1196
1197--18.9 Productions from 9: Interface Declarations
1198
1199--18.9.1 Productions from 9.1: Interface Declarations
1200--InterfaceModifier ::=
1201-- 'public'
1202-- | 'abstract'
1203--
1204InterfaceDeclaration ::= InterfaceHeader InterfaceBody
1205/.$putCase consumeInterfaceDeclaration(); $break ./
1206/:$readableName InterfaceDeclaration:/
1207
1208-- {ObjectTeams
1209-- orig: InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt
1210InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt ClassHeaderPlayedByopt
1211-- SH}
1212/.$putCase consumeInterfaceHeader(); $break ./
1213/:$readableName InterfaceHeader:/
1214
1215-----------------------------------------------
1216-- 1.5 features : generics
1217-----------------------------------------------
1218InterfaceHeaderName ::= InterfaceHeaderName1 TypeParameters
1219/.$putCase consumeTypeHeaderNameWithTypeParameters(); $break ./
1220
1221InterfaceHeaderName -> InterfaceHeaderName1
1222/:$readableName InterfaceHeaderName:/
1223
1224InterfaceHeaderName1 ::= Modifiersopt interface Identifier
1225/.$putCase consumeInterfaceHeaderName1(); $break ./
1226/:$readableName InterfaceHeaderName:/
1227
1228InterfaceHeaderExtends ::= 'extends' InterfaceTypeList
1229/.$putCase consumeInterfaceHeaderExtends(); $break ./
1230/:$readableName InterfaceHeaderExtends:/
1231
1232InterfaceBody ::= '{' InterfaceMemberDeclarationsopt '}'
1233/:$readableName InterfaceBody:/
1234
1235InterfaceMemberDeclarations -> InterfaceMemberDeclaration
1236InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration
1237/.$putCase consumeInterfaceMemberDeclarations(); $break ./
1238/:$readableName InterfaceMemberDeclarations:/
1239
1240--same as for class members
1241InterfaceMemberDeclaration ::= ';'
1242/.$putCase consumeEmptyTypeDeclaration(); $break ./
1243/:$readableName InterfaceMemberDeclaration:/
1244
1245InterfaceMemberDeclaration -> ConstantDeclaration
1246InterfaceMemberDeclaration ::= MethodHeader MethodBody
1247/.$putCase consumeInvalidMethodDeclaration(); $break ./
1248/:$readableName InterfaceMemberDeclaration:/
1249
1250-- These rules are added to be able to parse constructors inside interface and then report a relevent error message
1251InvalidConstructorDeclaration ::= ConstructorHeader MethodBody
1252/.$putCase consumeInvalidConstructorDeclaration(true); $break ./
1253InvalidConstructorDeclaration ::= ConstructorHeader ';'
1254/.$putCase consumeInvalidConstructorDeclaration(false); $break ./
1255/:$readableName InvalidConstructorDeclaration:/
1256
1257-- These rules are added to be able to parse initializers inside an interface and then report a relevent error message (bug 212713)
1258InvalidInitializer -> StaticInitializer
1259InvalidInitializer -> Initializer
1260/:$readableName InvalidInitializer:/
1261
1262
1263InterfaceMemberDeclaration -> AbstractMethodDeclaration
1264InterfaceMemberDeclaration -> InvalidConstructorDeclaration
1265InterfaceMemberDeclaration -> InvalidInitializer
1266--1.1 feature
1267InterfaceMemberDeclaration -> ClassDeclaration
1268--1.1 feature
1269InterfaceMemberDeclaration -> InterfaceDeclaration
1270InterfaceMemberDeclaration -> EnumDeclaration
1271InterfaceMemberDeclaration -> AnnotationTypeDeclaration
1272--{ObjectTeams: bindings in role interfaces:
1273InterfaceMemberDeclaration -> BindingDeclaration
1274-- SH}
1275/:$readableName InterfaceMemberDeclaration:/
1276
1277ConstantDeclaration -> FieldDeclaration
1278/:$readableName ConstantDeclaration:/
1279
1280PushLeftBrace ::= $empty
1281/.$putCase consumePushLeftBrace(); $break ./
1282/:$readableName PushLeftBrace:/
1283
1284ArrayInitializer ::= '{' PushLeftBrace ,opt '}'
1285/.$putCase consumeEmptyArrayInitializer(); $break ./
1286ArrayInitializer ::= '{' PushLeftBrace VariableInitializers '}'
1287/.$putCase consumeArrayInitializer(); $break ./
1288ArrayInitializer ::= '{' PushLeftBrace VariableInitializers , '}'
1289/.$putCase consumeArrayInitializer(); $break ./
1290/:$readableName ArrayInitializer:/
1291/:$recovery_template Identifier:/
1292
1293VariableInitializers ::= VariableInitializer
1294VariableInitializers ::= VariableInitializers ',' VariableInitializer
1295/.$putCase consumeVariableInitializers(); $break ./
1296/:$readableName VariableInitializers:/
1297
1298Block ::= OpenBlock '{' BlockStatementsopt '}'
1299/.$putCase consumeBlock(); $break ./
1300/:$readableName Block:/
1301
1302OpenBlock ::= $empty
1303/.$putCase consumeOpenBlock() ; $break ./
1304/:$readableName OpenBlock:/
1305
1306BlockStatements -> BlockStatement
1307BlockStatements ::= BlockStatements BlockStatement
1308/.$putCase consumeBlockStatements() ; $break ./
1309/:$readableName BlockStatements:/
1310
1311BlockStatement -> LocalVariableDeclarationStatement
1312BlockStatement -> Statement
1313--1.1 feature
1314BlockStatement -> ClassDeclaration
1315BlockStatement ::= InterfaceDeclaration
1316/.$putCase consumeInvalidInterfaceDeclaration(); $break ./
1317/:$readableName BlockStatement:/
1318BlockStatement ::= AnnotationTypeDeclaration
1319/.$putCase consumeInvalidAnnotationTypeDeclaration(); $break ./
1320/:$readableName BlockStatement:/
1321BlockStatement ::= EnumDeclaration
1322/.$putCase consumeInvalidEnumDeclaration(); $break ./
1323/:$readableName BlockStatement:/
1324
1325LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';'
1326/.$putCase consumeLocalVariableDeclarationStatement(); $break ./
1327/:$readableName LocalVariableDeclarationStatement:/
1328
1329LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators
1330/.$putCase consumeLocalVariableDeclaration(); $break ./
1331-- 1.1 feature
1332-- The modifiers part of this rule makes the grammar more permissive.
1333-- The only modifier here is final. We put Modifiers to allow multiple modifiers
1334-- This will require to check the validity of the modifier
1335LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators
1336/.$putCase consumeLocalVariableDeclaration(); $break ./
1337/:$readableName LocalVariableDeclaration:/
1338
1339PushModifiers ::= $empty
1340/.$putCase consumePushModifiers(); $break ./
1341/:$readableName PushModifiers:/
1342
1343PushModifiersForHeader ::= $empty
1344/.$putCase consumePushModifiersForHeader(); $break ./
1345/:$readableName PushModifiersForHeader:/
1346
1347PushRealModifiers ::= $empty
1348/.$putCase consumePushRealModifiers(); $break ./
1349/:$readableName PushRealModifiers:/
1350
1351Statement -> StatementWithoutTrailingSubstatement
1352Statement -> LabeledStatement
1353Statement -> IfThenStatement
1354Statement -> IfThenElseStatement
1355Statement -> WhileStatement
1356Statement -> ForStatement
1357-- {ObjectTeams
1358Statement -> WithinStatement
1359-- Markus Witte}
1360-----------------------------------------------
1361-- 1.5 feature
1362-----------------------------------------------
1363Statement -> EnhancedForStatement
1364/:$readableName Statement:/
1365/:$recovery_template ;:/
1366
1367StatementNoShortIf -> StatementWithoutTrailingSubstatement
1368StatementNoShortIf -> LabeledStatementNoShortIf
1369StatementNoShortIf -> IfThenElseStatementNoShortIf
1370StatementNoShortIf -> WhileStatementNoShortIf
1371StatementNoShortIf -> ForStatementNoShortIf
1372-----------------------------------------------
1373-- 1.5 feature
1374-----------------------------------------------
1375StatementNoShortIf -> EnhancedForStatementNoShortIf
1376/:$readableName Statement:/
1377
1378StatementWithoutTrailingSubstatement -> AssertStatement
1379StatementWithoutTrailingSubstatement -> Block
1380StatementWithoutTrailingSubstatement -> EmptyStatement
1381StatementWithoutTrailingSubstatement -> ExpressionStatement
1382StatementWithoutTrailingSubstatement -> SwitchStatement
1383StatementWithoutTrailingSubstatement -> DoStatement
1384StatementWithoutTrailingSubstatement -> BreakStatement
1385StatementWithoutTrailingSubstatement -> ContinueStatement
1386StatementWithoutTrailingSubstatement -> ReturnStatement
1387StatementWithoutTrailingSubstatement -> SynchronizedStatement
1388StatementWithoutTrailingSubstatement -> ThrowStatement
1389StatementWithoutTrailingSubstatement -> TryStatement
1390/:$readableName Statement:/
1391
1392EmptyStatement ::= ';'
1393/.$putCase consumeEmptyStatement(); $break ./
1394/:$readableName EmptyStatement:/
1395
1396LabeledStatement ::= Label ':' Statement
1397/.$putCase consumeStatementLabel() ; $break ./
1398/:$readableName LabeledStatement:/
1399
1400LabeledStatementNoShortIf ::= Label ':' StatementNoShortIf
1401/.$putCase consumeStatementLabel() ; $break ./
1402/:$readableName LabeledStatement:/
1403
1404Label ::= 'Identifier'
1405/.$putCase consumeLabel() ; $break ./
1406/:$readableName Label:/
1407
1408ExpressionStatement ::= StatementExpression ';'
1409/. $putCase consumeExpressionStatement(); $break ./
1410ExpressionStatement ::= ExplicitConstructorInvocation
1411/:$readableName Statement:/
1412
1413StatementExpression ::= Assignment
1414StatementExpression ::= PreIncrementExpression
1415StatementExpression ::= PreDecrementExpression
1416StatementExpression ::= PostIncrementExpression
1417StatementExpression ::= PostDecrementExpression
1418StatementExpression ::= MethodInvocation
1419StatementExpression ::= ClassInstanceCreationExpression
1420-- {ObjectTeams
1421StatementExpression ::= BaseConstructorInvocation
1422-- SH}
1423/:$readableName Expression:/
1424
1425IfThenStatement ::= 'if' '(' Expression ')' Statement
1426/.$putCase consumeStatementIfNoElse(); $break ./
1427/:$readableName IfStatement:/
1428
1429IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' Statement
1430/.$putCase consumeStatementIfWithElse(); $break ./
1431/:$readableName IfStatement:/
1432
1433IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf
1434/.$putCase consumeStatementIfWithElse(); $break ./
1435/:$readableName IfStatement:/
1436
1437SwitchStatement ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock
1438/.$putCase consumeStatementSwitch() ; $break ./
1439/:$readableName SwitchStatement:/
1440
1441SwitchBlock ::= '{' '}'
1442/.$putCase consumeEmptySwitchBlock() ; $break ./
1443
1444SwitchBlock ::= '{' SwitchBlockStatements '}'
1445SwitchBlock ::= '{' SwitchLabels '}'
1446SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}'
1447/.$putCase consumeSwitchBlock() ; $break ./
1448/:$readableName SwitchBlock:/
1449
1450SwitchBlockStatements -> SwitchBlockStatement
1451SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement
1452/.$putCase consumeSwitchBlockStatements() ; $break ./
1453/:$readableName SwitchBlockStatements:/
1454
1455SwitchBlockStatement ::= SwitchLabels BlockStatements
1456/.$putCase consumeSwitchBlockStatement() ; $break ./
1457/:$readableName SwitchBlockStatement:/
1458
1459SwitchLabels -> SwitchLabel
1460SwitchLabels ::= SwitchLabels SwitchLabel
1461/.$putCase consumeSwitchLabels() ; $break ./
1462/:$readableName SwitchLabels:/
1463
1464SwitchLabel ::= 'case' ConstantExpression ':'
1465/. $putCase consumeCaseLabel(); $break ./
1466
1467SwitchLabel ::= 'default' ':'
1468/. $putCase consumeDefaultLabel(); $break ./
1469/:$readableName SwitchLabel:/
1470
1471WhileStatement ::= 'while' '(' Expression ')' Statement
1472/.$putCase consumeStatementWhile() ; $break ./
1473/:$readableName WhileStatement:/
1474
1475WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf
1476/.$putCase consumeStatementWhile() ; $break ./
1477/:$readableName WhileStatement:/
1478
1479DoStatement ::= 'do' Statement 'while' '(' Expression ')' ';'
1480/.$putCase consumeStatementDo() ; $break ./
1481/:$readableName DoStatement:/
1482
1483ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' Statement
1484/.$putCase consumeStatementFor() ; $break ./
1485/:$readableName ForStatement:/
1486
1487ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf
1488/.$putCase consumeStatementFor() ; $break ./
1489/:$readableName ForStatement:/
1490
1491--the minus one allows to avoid a stack-to-stack transfer
1492ForInit ::= StatementExpressionList
1493/.$putCase consumeForInit() ; $break ./
1494ForInit -> LocalVariableDeclaration
1495/:$readableName ForInit:/
1496
1497ForUpdate -> StatementExpressionList
1498/:$readableName ForUpdate:/
1499
1500StatementExpressionList -> StatementExpression
1501StatementExpressionList ::= StatementExpressionList ',' StatementExpression
1502/.$putCase consumeStatementExpressionList() ; $break ./
1503/:$readableName StatementExpressionList:/
1504
1505-- {ObjectTeams
1506WithinStatement ::= 'within' '(' Expression ')' Statement
1507/.$putCase consumeWithinStatement(); $break ./
1508/:$readableName WithinStatement:/
1509-- Markus Witte}
1510
1511-- 1.4 feature
1512AssertStatement ::= 'assert' Expression ';'
1513/.$putCase consumeSimpleAssertStatement() ; $break ./
1514/:$compliance 1.4:/
1515
1516AssertStatement ::= 'assert' Expression ':' Expression ';'
1517/.$putCase consumeAssertStatement() ; $break ./
1518/:$readableName AssertStatement:/
1519/:$compliance 1.4:/
1520
1521BreakStatement ::= 'break' ';'
1522/.$putCase consumeStatementBreak() ; $break ./
1523
1524BreakStatement ::= 'break' Identifier ';'
1525/.$putCase consumeStatementBreakWithLabel() ; $break ./
1526/:$readableName BreakStatement:/
1527
1528ContinueStatement ::= 'continue' ';'
1529/.$putCase consumeStatementContinue() ; $break ./
1530
1531ContinueStatement ::= 'continue' Identifier ';'
1532/.$putCase consumeStatementContinueWithLabel() ; $break ./
1533/:$readableName ContinueStatement:/
1534
1535ReturnStatement ::= 'return' Expressionopt ';'
1536/.$putCase consumeStatementReturn() ; $break ./
1537/:$readableName ReturnStatement:/
1538
1539ThrowStatement ::= 'throw' Expression ';'
1540/.$putCase consumeStatementThrow(); $break ./
1541/:$readableName ThrowStatement:/
1542
1543SynchronizedStatement ::= OnlySynchronized '(' Expression ')' Block
1544/.$putCase consumeStatementSynchronized(); $break ./
1545/:$readableName SynchronizedStatement:/
1546
1547OnlySynchronized ::= 'synchronized'
1548/.$putCase consumeOnlySynchronized(); $break ./
1549/:$readableName OnlySynchronized:/
1550
1551TryStatement ::= 'try' TryBlock Catches
1552/.$putCase consumeStatementTry(false); $break ./
1553TryStatement ::= 'try' TryBlock Catchesopt Finally
1554/.$putCase consumeStatementTry(true); $break ./
1555/:$readableName TryStatement:/
1556
1557TryBlock ::= Block ExitTryBlock
1558/:$readableName Block:/
1559
1560ExitTryBlock ::= $empty
1561/.$putCase consumeExitTryBlock(); $break ./
1562/:$readableName ExitTryBlock:/
1563
1564Catches -> CatchClause
1565Catches ::= Catches CatchClause
1566/.$putCase consumeCatches(); $break ./
1567/:$readableName Catches:/
1568
Stephan Herrmann29b019c2011-04-26 10:30:44 +00001569CatchClause ::= 'catch' '(' CatchFormalParameter ')' Block
Stephan Herrmann234bfec2011-04-26 08:26:58 +00001570/.$putCase consumeStatementCatch() ; $break ./
1571/:$readableName CatchClause:/
1572
1573Finally ::= 'finally' Block
1574/:$readableName Finally:/
1575/:$recovery_template finally { }:/
1576
1577--18.12 Productions from 14: Expressions
1578
1579--for source positioning purpose
1580PushLPAREN ::= '('
1581/.$putCase consumeLeftParen(); $break ./
1582/:$readableName (:/
1583/:$recovery_template (:/
1584PushRPAREN ::= ')'
1585/.$putCase consumeRightParen(); $break ./
1586/:$readableName ):/
1587/:$recovery_template ):/
1588
1589Primary -> PrimaryNoNewArray
1590Primary -> ArrayCreationWithArrayInitializer
1591Primary -> ArrayCreationWithoutArrayInitializer
1592/:$readableName Expression:/
1593
1594PrimaryNoNewArray -> Literal
1595PrimaryNoNewArray ::= 'this'
1596/.$putCase consumePrimaryNoNewArrayThis(); $break ./
1597
1598PrimaryNoNewArray ::= PushLPAREN Expression_NotName PushRPAREN
1599/.$putCase consumePrimaryNoNewArray(); $break ./
1600
1601PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN
1602/.$putCase consumePrimaryNoNewArrayWithName(); $break ./
1603
1604PrimaryNoNewArray -> ClassInstanceCreationExpression
1605--{ObjectTeams:
1606PrimaryNoNewArray -> BaseConstructorExpression
1607-- SH}
1608PrimaryNoNewArray -> FieldAccess
1609--1.1 feature
1610PrimaryNoNewArray ::= Name '.' 'this'
1611/.$putCase consumePrimaryNoNewArrayNameThis(); $break ./
1612PrimaryNoNewArray ::= Name '.' 'super'
1613/.$putCase consumePrimaryNoNewArrayNameSuper(); $break ./
1614
1615--1.1 feature
1616--PrimaryNoNewArray ::= Type '.' 'class'
1617--inline Type in the previous rule in order to make the grammar LL1 instead
1618-- of LL2. The result is the 3 next rules.
1619
1620PrimaryNoNewArray ::= Name '.' 'class'
1621/.$putCase consumePrimaryNoNewArrayName(); $break ./
1622
1623PrimaryNoNewArray ::= Name Dims '.' 'class'
1624/.$putCase consumePrimaryNoNewArrayArrayType(); $break ./
1625
1626PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class'
1627/.$putCase consumePrimaryNoNewArrayPrimitiveArrayType(); $break ./
1628
1629PrimaryNoNewArray ::= PrimitiveType '.' 'class'
1630/.$putCase consumePrimaryNoNewArrayPrimitiveType(); $break ./
1631
1632--{ObjectTeams: R<@t>.class
1633-- (start with RelationalExpression to make the grammer LL1, further syntax checking in Parser)
1634RelationalExpression ::= RelationalExpression '<' TypeAnchor '>' '.' 'class'
1635/.$putCase consumeRoleClassLiteral(); $break ./
1636-- SH}
1637
1638PrimaryNoNewArray -> MethodInvocation
1639PrimaryNoNewArray -> ArrayAccess
1640/:$readableName Expression:/
1641--1.1 feature
1642--
1643-- In Java 1.0 a ClassBody could not appear at all in a
1644-- ClassInstanceCreationExpression.
1645--
1646
1647AllocationHeader ::= 'new' ClassType '(' ArgumentListopt ')'
1648/.$putCase consumeAllocationHeader(); $break ./
1649/:$readableName AllocationHeader:/
1650
1651ClassInstanceCreationExpression ::= 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' UnqualifiedClassBodyopt
1652/.$putCase consumeClassInstanceCreationExpressionWithTypeArguments(); $break ./
1653
1654ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' UnqualifiedClassBodyopt
1655/.$putCase consumeClassInstanceCreationExpression(); $break ./
1656--1.1 feature
1657
1658ClassInstanceCreationExpression ::= Primary '.' 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1659/.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./
1660
1661ClassInstanceCreationExpression ::= Primary '.' 'new' ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1662/.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./
1663
1664--1.1 feature
1665ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1666/.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./
1667/:$readableName ClassInstanceCreationExpression:/
1668
1669ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1670/.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./
1671/:$readableName ClassInstanceCreationExpression:/
1672
1673ClassInstanceCreationExpressionName ::= Name '.'
1674/.$putCase consumeClassInstanceCreationExpressionName() ; $break ./
1675/:$readableName ClassInstanceCreationExpressionName:/
1676
1677UnqualifiedClassBodyopt ::= $empty --test made using null as contents
1678/.$putCase consumeClassBodyopt(); $break ./
1679UnqualifiedClassBodyopt ::= UnqualifiedEnterAnonymousClassBody ClassBody
1680/:$readableName ClassBody:/
1681/:$no_statements_recovery:/
1682
1683UnqualifiedEnterAnonymousClassBody ::= $empty
1684/.$putCase consumeEnterAnonymousClassBody(false); $break ./
1685/:$readableName EnterAnonymousClassBody:/
1686
1687QualifiedClassBodyopt ::= $empty --test made using null as contents
1688/.$putCase consumeClassBodyopt(); $break ./
1689QualifiedClassBodyopt ::= QualifiedEnterAnonymousClassBody ClassBody
1690/:$readableName ClassBody:/
1691/:$no_statements_recovery:/
1692
1693QualifiedEnterAnonymousClassBody ::= $empty
1694/.$putCase consumeEnterAnonymousClassBody(true); $break ./
1695/:$readableName EnterAnonymousClassBody:/
1696
1697ArgumentList ::= Expression
1698ArgumentList ::= ArgumentList ',' Expression
1699/.$putCase consumeArgumentList(); $break ./
1700/:$readableName ArgumentList:/
1701
1702ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs
1703/.$putCase consumeArrayCreationHeader(); $break ./
1704
1705ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1706/.$putCase consumeArrayCreationHeader(); $break ./
1707/:$readableName ArrayCreationHeader:/
1708
1709ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs
1710/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1711/:$readableName ArrayCreationWithoutArrayInitializer:/
1712
1713ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer
1714/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1715/:$readableName ArrayCreationWithArrayInitializer:/
1716
1717ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1718/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1719
1720ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer
1721/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1722
1723DimWithOrWithOutExprs ::= DimWithOrWithOutExpr
1724DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr
1725/.$putCase consumeDimWithOrWithOutExprs(); $break ./
1726/:$readableName Dimensions:/
1727
1728DimWithOrWithOutExpr ::= '[' Expression ']'
1729DimWithOrWithOutExpr ::= '[' ']'
1730/. $putCase consumeDimWithOrWithOutExpr(); $break ./
1731/:$readableName Dimension:/
1732-- -----------------------------------------------
1733
1734Dims ::= DimsLoop
1735/. $putCase consumeDims(); $break ./
1736/:$readableName Dimensions:/
1737DimsLoop -> OneDimLoop
1738DimsLoop ::= DimsLoop OneDimLoop
1739/:$readableName Dimensions:/
1740OneDimLoop ::= '[' ']'
1741/. $putCase consumeOneDimLoop(); $break ./
1742/:$readableName Dimension:/
1743
1744FieldAccess ::= Primary '.' 'Identifier'
1745/.$putCase consumeFieldAccess(false); $break ./
1746
1747FieldAccess ::= 'super' '.' 'Identifier'
1748/.$putCase consumeFieldAccess(true); $break ./
1749/:$readableName FieldAccess:/
1750
1751MethodInvocation ::= Name '(' ArgumentListopt ')'
1752/.$putCase consumeMethodInvocationName(); $break ./
1753
1754MethodInvocation ::= Name '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1755/.$putCase consumeMethodInvocationNameWithTypeArguments(); $break ./
1756
1757MethodInvocation ::= Primary '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1758/.$putCase consumeMethodInvocationPrimaryWithTypeArguments(); $break ./
1759
1760MethodInvocation ::= Primary '.' 'Identifier' '(' ArgumentListopt ')'
1761/.$putCase consumeMethodInvocationPrimary(); $break ./
1762
1763MethodInvocation ::= 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1764/.$putCase consumeMethodInvocationSuperWithTypeArguments(); $break ./
1765
1766MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')'
1767/.$putCase consumeMethodInvocationSuper(); $break ./
1768
1769-- {ObjectTeams
1770MethodInvocation ::= 'tsuper' '.' 'Identifier' '(' ArgumentListopt ')'
1771/.$putCase consumeMethodInvocationTSuper(UNQUALIFIED); $break ./
1772
1773MethodInvocation ::= 'tsuper' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1774/.$putCase consumeMethodInvocationTSuperWithTypeArguments(0); $break ./
1775
1776MethodInvocation ::= Name '.' 'tsuper' '.' 'Identifier' '(' ArgumentListopt ')'
1777/.$putCase consumeMethodInvocationTSuper(QUALIFIED); $break ./
1778
1779MethodInvocation ::= Name '.' 'tsuper' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1780/.$putCase consumeMethodInvocationTSuperWithTypeArguments(2); $break ./
1781
1782MethodInvocation ::= 'base' '.' 'Identifier' '(' ArgumentListopt ')'
1783/.$putCase consumeMethodInvocationBase(false); $break ./
1784
1785MethodInvocation ::= 'base' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1786/.$putCase consumeMethodInvocationBaseWithTypeArguments(false); $break ./
1787
1788MethodInvocation ::= 'base' '.' 'super' '.' 'Identifier' '(' ArgumentListopt ')'
1789/.$putCase consumeMethodInvocationBase(true); $break ./
1790
1791MethodInvocation ::= 'base' '.' 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1792/.$putCase consumeMethodInvocationBaseWithTypeArguments(true); $break ./
1793-- Markus Witte}
1794
1795/:$readableName MethodInvocation:/
1796
1797ArrayAccess ::= Name '[' Expression ']'
1798/.$putCase consumeArrayAccess(true); $break ./
1799ArrayAccess ::= PrimaryNoNewArray '[' Expression ']'
1800/.$putCase consumeArrayAccess(false); $break ./
1801ArrayAccess ::= ArrayCreationWithArrayInitializer '[' Expression ']'
1802/.$putCase consumeArrayAccess(false); $break ./
1803/:$readableName ArrayAccess:/
1804
1805PostfixExpression -> Primary
1806PostfixExpression ::= Name
1807/.$putCase consumePostfixExpression(); $break ./
1808PostfixExpression -> PostIncrementExpression
1809PostfixExpression -> PostDecrementExpression
1810/:$readableName Expression:/
1811
1812PostIncrementExpression ::= PostfixExpression '++'
1813/.$putCase consumeUnaryExpression(OperatorIds.PLUS,true); $break ./
1814/:$readableName PostIncrementExpression:/
1815
1816PostDecrementExpression ::= PostfixExpression '--'
1817/.$putCase consumeUnaryExpression(OperatorIds.MINUS,true); $break ./
1818/:$readableName PostDecrementExpression:/
1819
1820--for source managment purpose
1821PushPosition ::= $empty
1822 /.$putCase consumePushPosition(); $break ./
1823/:$readableName PushPosition:/
1824
1825UnaryExpression -> PreIncrementExpression
1826UnaryExpression -> PreDecrementExpression
1827UnaryExpression ::= '+' PushPosition UnaryExpression
1828/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./
1829UnaryExpression ::= '-' PushPosition UnaryExpression
1830/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./
1831UnaryExpression -> UnaryExpressionNotPlusMinus
1832/:$readableName Expression:/
1833
1834PreIncrementExpression ::= '++' PushPosition UnaryExpression
1835/.$putCase consumeUnaryExpression(OperatorIds.PLUS,false); $break ./
1836/:$readableName PreIncrementExpression:/
1837
1838PreDecrementExpression ::= '--' PushPosition UnaryExpression
1839/.$putCase consumeUnaryExpression(OperatorIds.MINUS,false); $break ./
1840/:$readableName PreDecrementExpression:/
1841
1842UnaryExpressionNotPlusMinus -> PostfixExpression
1843UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression
1844/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./
1845UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression
1846/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./
1847UnaryExpressionNotPlusMinus -> CastExpression
1848/:$readableName Expression:/
1849
1850CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
1851/.$putCase consumeCastExpressionWithPrimitiveType(); $break ./
1852CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1853/.$putCase consumeCastExpressionWithGenericsArray(); $break ./
1854CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus
1855/.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./
1856CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
1857/.$putCase consumeCastExpressionLL1(); $break ./
1858CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1859/.$putCase consumeCastExpressionWithNameArray(); $break ./
1860/:$readableName CastExpression:/
1861
1862OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
1863/.$putCase consumeOnlyTypeArgumentsForCastExpression(); $break ./
1864/:$readableName TypeArguments:/
1865
1866InsideCastExpression ::= $empty
1867/.$putCase consumeInsideCastExpression(); $break ./
1868/:$readableName InsideCastExpression:/
1869InsideCastExpressionLL1 ::= $empty
1870/.$putCase consumeInsideCastExpressionLL1(); $break ./
1871/:$readableName InsideCastExpression:/
1872InsideCastExpressionWithQualifiedGenerics ::= $empty
1873/.$putCase consumeInsideCastExpressionWithQualifiedGenerics(); $break ./
1874/:$readableName InsideCastExpression:/
1875
1876MultiplicativeExpression -> UnaryExpression
1877MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression
1878/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./
1879MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression
1880/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./
1881MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression
1882/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./
1883/:$readableName Expression:/
1884
1885AdditiveExpression -> MultiplicativeExpression
1886AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression
1887/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./
1888AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression
1889/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./
1890/:$readableName Expression:/
1891
1892ShiftExpression -> AdditiveExpression
1893ShiftExpression ::= ShiftExpression '<<' AdditiveExpression
1894/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./
1895ShiftExpression ::= ShiftExpression '>>' AdditiveExpression
1896/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./
1897ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression
1898/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
1899/:$readableName Expression:/
1900
1901RelationalExpression -> ShiftExpression
1902RelationalExpression ::= RelationalExpression '<' ShiftExpression
1903/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./
1904RelationalExpression ::= RelationalExpression '>' ShiftExpression
1905/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./
1906RelationalExpression ::= RelationalExpression '<=' ShiftExpression
1907/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./
1908RelationalExpression ::= RelationalExpression '>=' ShiftExpression
1909/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./
1910/:$readableName Expression:/
1911
1912InstanceofExpression -> RelationalExpression
1913InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType
1914/.$putCase consumeInstanceOfExpression(); $break ./
1915/:$readableName Expression:/
1916
1917EqualityExpression -> InstanceofExpression
1918EqualityExpression ::= EqualityExpression '==' InstanceofExpression
1919/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./
1920EqualityExpression ::= EqualityExpression '!=' InstanceofExpression
1921/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./
1922/:$readableName Expression:/
1923
1924AndExpression -> EqualityExpression
1925AndExpression ::= AndExpression '&' EqualityExpression
1926/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./
1927/:$readableName Expression:/
1928
1929ExclusiveOrExpression -> AndExpression
1930ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression
1931/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./
1932/:$readableName Expression:/
1933
1934InclusiveOrExpression -> ExclusiveOrExpression
1935InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression
1936/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./
1937/:$readableName Expression:/
1938
1939ConditionalAndExpression -> InclusiveOrExpression
1940ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression
1941/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./
1942/:$readableName Expression:/
1943
1944ConditionalOrExpression -> ConditionalAndExpression
1945ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression
1946/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./
1947/:$readableName Expression:/
1948
1949ConditionalExpression -> ConditionalOrExpression
1950ConditionalExpression ::= ConditionalOrExpression '?' Expression ':' ConditionalExpression
1951/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./
1952/:$readableName Expression:/
1953
1954AssignmentExpression -> ConditionalExpression
1955AssignmentExpression -> Assignment
1956/:$readableName Expression:/
1957/:$recovery_template Identifier:/
1958
1959Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression
1960/.$putCase consumeAssignment(); $break ./
1961/:$readableName Assignment:/
1962
1963-- this rule is added to parse an array initializer in a assigment and then report a syntax error knowing the exact senario
1964InvalidArrayInitializerAssignement ::= PostfixExpression AssignmentOperator ArrayInitializer
1965/:$readableName ArrayInitializerAssignment:/
1966/:$recovery:/
1967Assignment ::= InvalidArrayInitializerAssignement
1968/.$putcase ignoreExpressionAssignment();$break ./
1969/:$recovery:/
1970
1971AssignmentOperator ::= '='
1972/.$putCase consumeAssignmentOperator(EQUAL); $break ./
1973AssignmentOperator ::= '*='
1974/.$putCase consumeAssignmentOperator(MULTIPLY); $break ./
1975AssignmentOperator ::= '/='
1976/.$putCase consumeAssignmentOperator(DIVIDE); $break ./
1977AssignmentOperator ::= '%='
1978/.$putCase consumeAssignmentOperator(REMAINDER); $break ./
1979AssignmentOperator ::= '+='
1980/.$putCase consumeAssignmentOperator(PLUS); $break ./
1981AssignmentOperator ::= '-='
1982/.$putCase consumeAssignmentOperator(MINUS); $break ./
1983AssignmentOperator ::= '<<='
1984/.$putCase consumeAssignmentOperator(LEFT_SHIFT); $break ./
1985AssignmentOperator ::= '>>='
1986/.$putCase consumeAssignmentOperator(RIGHT_SHIFT); $break ./
1987AssignmentOperator ::= '>>>='
1988/.$putCase consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); $break ./
1989AssignmentOperator ::= '&='
1990/.$putCase consumeAssignmentOperator(AND); $break ./
1991AssignmentOperator ::= '^='
1992/.$putCase consumeAssignmentOperator(XOR); $break ./
1993AssignmentOperator ::= '|='
1994/.$putCase consumeAssignmentOperator(OR); $break ./
1995/:$readableName AssignmentOperator:/
1996/:$recovery_template =:/
1997
1998Expression -> AssignmentExpression
1999/:$readableName Expression:/
2000/:$recovery_template Identifier:/
2001
2002-- The following rules are for optional nonterminals.
2003--
2004ClassHeaderExtendsopt ::= $empty
2005ClassHeaderExtendsopt -> ClassHeaderExtends
2006/:$readableName ClassHeaderExtends:/
2007
2008Expressionopt ::= $empty
2009/.$putCase consumeEmptyExpression(); $break ./
2010Expressionopt -> Expression
2011/:$readableName Expression:/
2012
2013ConstantExpression -> Expression
2014/:$readableName ConstantExpression:/
2015
2016---------------------------------------------------------------------------------------
2017--
2018-- The rules below are for optional terminal symbols. An optional comma,
2019-- is only used in the context of an array initializer - It is a
2020-- "syntactic sugar" that otherwise serves no other purpose. By contrast,
2021-- an optional identifier is used in the definition of a break and
2022-- continue statement. When the identifier does not appear, a NULL
2023-- is produced. When the identifier is present, the user should use the
2024-- corresponding TOKEN(i) method. See break statement as an example.
2025--
2026---------------------------------------------------------------------------------------
2027
2028,opt -> $empty
2029,opt -> ,
2030/:$readableName ,:/
2031
2032ClassBodyDeclarationsopt ::= $empty
2033/.$putCase consumeEmptyClassBodyDeclarationsopt(); $break ./
2034ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations
2035/.$putCase consumeClassBodyDeclarationsopt(); $break ./
2036/:$readableName ClassBodyDeclarations:/
2037
2038Modifiersopt ::= $empty
2039/. $putCase consumeDefaultModifiers(); $break ./
2040Modifiersopt ::= Modifiers
2041/.$putCase consumeModifiers(); $break ./
2042/:$readableName Modifiers:/
2043
2044BlockStatementsopt ::= $empty
2045/.$putCase consumeEmptyBlockStatementsopt(); $break ./
2046BlockStatementsopt -> BlockStatements
2047/:$readableName BlockStatements:/
2048
2049Dimsopt ::= $empty
2050/. $putCase consumeEmptyDimsopt(); $break ./
2051Dimsopt -> Dims
2052/:$readableName Dimensions:/
2053
2054ArgumentListopt ::= $empty
2055/. $putCase consumeEmptyArgumentListopt(); $break ./
2056ArgumentListopt -> ArgumentList
2057/:$readableName ArgumentList:/
2058
2059MethodHeaderThrowsClauseopt ::= $empty
2060MethodHeaderThrowsClauseopt -> MethodHeaderThrowsClause
2061/:$readableName MethodHeaderThrowsClause:/
2062
2063FormalParameterListopt ::= $empty
2064/.$putcase consumeFormalParameterListopt(); $break ./
2065FormalParameterListopt -> FormalParameterList
2066/:$readableName FormalParameterList:/
2067
2068ClassHeaderImplementsopt ::= $empty
2069ClassHeaderImplementsopt -> ClassHeaderImplements
2070/:$readableName ClassHeaderImplements:/
2071
2072InterfaceMemberDeclarationsopt ::= $empty
2073/. $putCase consumeEmptyInterfaceMemberDeclarationsopt(); $break ./
2074InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations
2075/. $putCase consumeInterfaceMemberDeclarationsopt(); $break ./
2076/:$readableName InterfaceMemberDeclarations:/
2077
2078NestedType ::= $empty
2079/.$putCase consumeNestedType(); $break./
2080/:$readableName NestedType:/
2081
2082ForInitopt ::= $empty
2083/. $putCase consumeEmptyForInitopt(); $break ./
2084ForInitopt -> ForInit
2085/:$readableName ForInit:/
2086
2087ForUpdateopt ::= $empty
2088/. $putCase consumeEmptyForUpdateopt(); $break ./
2089ForUpdateopt -> ForUpdate
2090/:$readableName ForUpdate:/
2091
2092InterfaceHeaderExtendsopt ::= $empty
2093InterfaceHeaderExtendsopt -> InterfaceHeaderExtends
2094/:$readableName InterfaceHeaderExtends:/
2095
2096Catchesopt ::= $empty
2097/. $putCase consumeEmptyCatchesopt(); $break ./
2098Catchesopt -> Catches
2099/:$readableName Catches:/
2100
2101-----------------------------------------------
2102-- 1.5 features : enum type
2103-----------------------------------------------
2104EnumDeclaration ::= EnumHeader EnumBody
2105/. $putCase consumeEnumDeclaration(); $break ./
2106/:$readableName EnumDeclaration:/
2107
2108EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt
2109/. $putCase consumeEnumHeader(); $break ./
2110/:$readableName EnumHeader:/
2111
2112EnumHeaderName ::= Modifiersopt 'enum' Identifier
2113/. $putCase consumeEnumHeaderName(); $break ./
2114/:$compliance 1.5:/
2115EnumHeaderName ::= Modifiersopt 'enum' Identifier TypeParameters
2116/. $putCase consumeEnumHeaderNameWithTypeParameters(); $break ./
2117/:$readableName EnumHeaderName:/
2118/:$compliance 1.5:/
2119
2120EnumBody ::= '{' EnumBodyDeclarationsopt '}'
2121/. $putCase consumeEnumBodyNoConstants(); $break ./
2122EnumBody ::= '{' ',' EnumBodyDeclarationsopt '}'
2123/. $putCase consumeEnumBodyNoConstants(); $break ./
2124EnumBody ::= '{' EnumConstants ',' EnumBodyDeclarationsopt '}'
2125/. $putCase consumeEnumBodyWithConstants(); $break ./
2126EnumBody ::= '{' EnumConstants EnumBodyDeclarationsopt '}'
2127/. $putCase consumeEnumBodyWithConstants(); $break ./
2128/:$readableName EnumBody:/
2129
2130EnumConstants -> EnumConstant
2131EnumConstants ::= EnumConstants ',' EnumConstant
2132/.$putCase consumeEnumConstants(); $break ./
2133/:$readableName EnumConstants:/
2134
2135EnumConstantHeaderName ::= Modifiersopt Identifier
2136/.$putCase consumeEnumConstantHeaderName(); $break ./
2137/:$readableName EnumConstantHeaderName:/
2138
2139EnumConstantHeader ::= EnumConstantHeaderName ForceNoDiet Argumentsopt RestoreDiet
2140/.$putCase consumeEnumConstantHeader(); $break ./
2141/:$readableName EnumConstantHeader:/
2142
2143EnumConstant ::= EnumConstantHeader ForceNoDiet ClassBody RestoreDiet
2144/.$putCase consumeEnumConstantWithClassBody(); $break ./
2145EnumConstant ::= EnumConstantHeader
2146/.$putCase consumeEnumConstantNoClassBody(); $break ./
2147/:$readableName EnumConstant:/
2148
2149Arguments ::= '(' ArgumentListopt ')'
2150/.$putCase consumeArguments(); $break ./
2151/:$readableName Arguments:/
2152
2153Argumentsopt ::= $empty
2154/.$putCase consumeEmptyArguments(); $break ./
2155Argumentsopt -> Arguments
2156/:$readableName Argumentsopt:/
2157
2158EnumDeclarations ::= ';' ClassBodyDeclarationsopt
2159/.$putCase consumeEnumDeclarations(); $break ./
2160/:$readableName EnumDeclarations:/
2161
2162EnumBodyDeclarationsopt ::= $empty
2163/.$putCase consumeEmptyEnumDeclarations(); $break ./
2164EnumBodyDeclarationsopt -> EnumDeclarations
2165/:$readableName EnumBodyDeclarationsopt:/
2166
2167-----------------------------------------------
2168-- 1.5 features : enhanced for statement
2169-----------------------------------------------
2170EnhancedForStatement ::= EnhancedForStatementHeader Statement
2171/.$putCase consumeEnhancedForStatement(); $break ./
2172/:$readableName EnhancedForStatement:/
2173
2174EnhancedForStatementNoShortIf ::= EnhancedForStatementHeader StatementNoShortIf
2175/.$putCase consumeEnhancedForStatement(); $break ./
2176/:$readableName EnhancedForStatementNoShortIf:/
2177
2178EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt
2179/.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./
2180/:$readableName EnhancedForStatementHeaderInit:/
2181
2182EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt
2183/.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./
2184/:$readableName EnhancedForStatementHeaderInit:/
2185
2186EnhancedForStatementHeader ::= EnhancedForStatementHeaderInit ':' Expression ')'
2187/.$putCase consumeEnhancedForStatementHeader(); $break ./
2188/:$readableName EnhancedForStatementHeader:/
2189/:$compliance 1.5:/
2190
2191--{ObjectTeams: base import:
2192SingleBaseImportDeclaration ::= SingleBaseImportDeclarationName ';'
2193/.$putCase consumeImportDeclaration(); $break ./
2194/:$readableName SingleBaseImportDeclaration:/
2195
2196SingleBaseImportDeclarationName ::= 'import' 'base' Name
2197/.$putCase consumeSingleBaseImportDeclarationName(); $break ./
2198/:$readableName SingleBaseImportDeclarationName:/
2199-- SH}
2200-----------------------------------------------
2201-- 1.5 features : static imports
2202-----------------------------------------------
2203SingleStaticImportDeclaration ::= SingleStaticImportDeclarationName ';'
2204/.$putCase consumeImportDeclaration(); $break ./
2205/:$readableName SingleStaticImportDeclaration:/
2206
2207SingleStaticImportDeclarationName ::= 'import' 'static' Name
2208/.$putCase consumeSingleStaticImportDeclarationName(); $break ./
2209/:$readableName SingleStaticImportDeclarationName:/
2210/:$compliance 1.5:/
2211
2212StaticImportOnDemandDeclaration ::= StaticImportOnDemandDeclarationName ';'
2213/.$putCase consumeImportDeclaration(); $break ./
2214/:$readableName StaticImportOnDemandDeclaration:/
2215
2216StaticImportOnDemandDeclarationName ::= 'import' 'static' Name '.' '*'
2217/.$putCase consumeStaticImportOnDemandDeclarationName(); $break ./
2218/:$readableName StaticImportOnDemandDeclarationName:/
2219/:$compliance 1.5:/
2220
2221-----------------------------------------------
2222-- 1.5 features : generics
2223-----------------------------------------------
2224TypeArguments ::= '<' TypeArgumentList1
2225/.$putCase consumeTypeArguments(); $break ./
2226/:$readableName TypeArguments:/
2227/:$compliance 1.5:/
2228
2229OnlyTypeArguments ::= '<' TypeArgumentList1
2230/.$putCase consumeOnlyTypeArguments(); $break ./
2231/:$readableName TypeArguments:/
2232/:$compliance 1.5:/
2233
2234TypeArgumentList1 -> TypeArgument1
2235/:$compliance 1.5:/
2236TypeArgumentList1 ::= TypeArgumentList ',' TypeArgument1
2237/.$putCase consumeTypeArgumentList1(); $break ./
2238/:$readableName TypeArgumentList1:/
2239/:$compliance 1.5:/
2240
2241TypeArgumentList -> TypeArgument
2242/:$compliance 1.5:/
2243TypeArgumentList ::= TypeArgumentList ',' TypeArgument
2244/.$putCase consumeTypeArgumentList(); $break ./
2245/:$readableName TypeArgumentList:/
2246/:$compliance 1.5:/
2247
2248TypeArgument ::= ReferenceType
2249/.$putCase consumeTypeArgument(); $break ./
2250/:$compliance 1.5:/
2251TypeArgument -> Wildcard
2252/:$readableName TypeArgument:/
2253/:$compliance 1.5:/
2254
2255--{ObjectTeams: anchored types:
2256TypeArgument -> TypeAnchor
2257TypeArgument1 -> TypeAnchor '>'
2258TypeArgument2 -> TypeAnchor '>>'
2259
2260TypeAnchor ::= '@' Name
2261/.$putCase consumeTypeAnchor(false); $break ./
2262/:$readableName typeAnchor:/
2263
2264-- base is a keyword in this mode, so explicitly expect it:
2265TypeAnchor ::= '@' 'base'
2266/.$putCase consumeTypeAnchor(true); $break ./
2267/:$readableName typeAnchor:/
2268
2269-- also 'this' requires special treatment (skip because redundant):
2270TypeAnchor ::= '@' 'this'
2271/.$putCase skipThisAnchor(); $break ./
2272/:$readableName typeAnchor:/
2273
2274TypeAnchor ::= '@' Name '.' 'base'
2275/:$readableName typeAnchor:/
2276/.$putCase consumeQualifiedBaseTypeAnchor(); $break ./
2277
2278--SH}
2279
2280TypeArgument1 -> ReferenceType1
2281/:$compliance 1.5:/
2282TypeArgument1 -> Wildcard1
2283/:$readableName TypeArgument1:/
2284/:$compliance 1.5:/
2285
2286ReferenceType1 ::= ReferenceType '>'
2287/.$putCase consumeReferenceType1(); $break ./
2288/:$compliance 1.5:/
2289ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2
2290/.$putCase consumeTypeArgumentReferenceType1(); $break ./
2291/:$readableName ReferenceType1:/
2292/:$compliance 1.5:/
2293
2294TypeArgumentList2 -> TypeArgument2
2295/:$compliance 1.5:/
2296TypeArgumentList2 ::= TypeArgumentList ',' TypeArgument2
2297/.$putCase consumeTypeArgumentList2(); $break ./
2298/:$readableName TypeArgumentList2:/
2299/:$compliance 1.5:/
2300
2301TypeArgument2 -> ReferenceType2
2302/:$compliance 1.5:/
2303TypeArgument2 -> Wildcard2
2304/:$readableName TypeArgument2:/
2305/:$compliance 1.5:/
2306
2307ReferenceType2 ::= ReferenceType '>>'
2308/.$putCase consumeReferenceType2(); $break ./
2309/:$compliance 1.5:/
2310ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3
2311/.$putCase consumeTypeArgumentReferenceType2(); $break ./
2312/:$readableName ReferenceType2:/
2313/:$compliance 1.5:/
2314
2315TypeArgumentList3 -> TypeArgument3
2316TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3
2317/.$putCase consumeTypeArgumentList3(); $break ./
2318/:$readableName TypeArgumentList3:/
2319/:$compliance 1.5:/
2320
2321TypeArgument3 -> ReferenceType3
2322TypeArgument3 -> Wildcard3
2323/:$readableName TypeArgument3:/
2324/:$compliance 1.5:/
2325
2326ReferenceType3 ::= ReferenceType '>>>'
2327/.$putCase consumeReferenceType3(); $break ./
2328/:$readableName ReferenceType3:/
2329/:$compliance 1.5:/
2330
2331Wildcard ::= '?'
2332/.$putCase consumeWildcard(); $break ./
2333/:$compliance 1.5:/
2334Wildcard ::= '?' WildcardBounds
2335/.$putCase consumeWildcardWithBounds(); $break ./
2336/:$readableName Wildcard:/
2337/:$compliance 1.5:/
2338
2339WildcardBounds ::= 'extends' ReferenceType
2340/.$putCase consumeWildcardBoundsExtends(); $break ./
2341/:$compliance 1.5:/
2342WildcardBounds ::= 'super' ReferenceType
2343/.$putCase consumeWildcardBoundsSuper(); $break ./
2344/:$readableName WildcardBounds:/
2345/:$compliance 1.5:/
2346
2347Wildcard1 ::= '?' '>'
2348/.$putCase consumeWildcard1(); $break ./
2349/:$compliance 1.5:/
2350Wildcard1 ::= '?' WildcardBounds1
2351/.$putCase consumeWildcard1WithBounds(); $break ./
2352/:$readableName Wildcard1:/
2353/:$compliance 1.5:/
2354
2355WildcardBounds1 ::= 'extends' ReferenceType1
2356/.$putCase consumeWildcardBounds1Extends(); $break ./
2357/:$compliance 1.5:/
2358WildcardBounds1 ::= 'super' ReferenceType1
2359/.$putCase consumeWildcardBounds1Super(); $break ./
2360/:$readableName WildcardBounds1:/
2361/:$compliance 1.5:/
2362
2363Wildcard2 ::= '?' '>>'
2364/.$putCase consumeWildcard2(); $break ./
2365/:$compliance 1.5:/
2366Wildcard2 ::= '?' WildcardBounds2
2367/.$putCase consumeWildcard2WithBounds(); $break ./
2368/:$readableName Wildcard2:/
2369/:$compliance 1.5:/
2370
2371WildcardBounds2 ::= 'extends' ReferenceType2
2372/.$putCase consumeWildcardBounds2Extends(); $break ./
2373/:$compliance 1.5:/
2374WildcardBounds2 ::= 'super' ReferenceType2
2375/.$putCase consumeWildcardBounds2Super(); $break ./
2376/:$readableName WildcardBounds2:/
2377/:$compliance 1.5:/
2378
2379Wildcard3 ::= '?' '>>>'
2380/.$putCase consumeWildcard3(); $break ./
2381/:$compliance 1.5:/
2382Wildcard3 ::= '?' WildcardBounds3
2383/.$putCase consumeWildcard3WithBounds(); $break ./
2384/:$readableName Wildcard3:/
2385/:$compliance 1.5:/
2386
2387WildcardBounds3 ::= 'extends' ReferenceType3
2388/.$putCase consumeWildcardBounds3Extends(); $break ./
2389/:$compliance 1.5:/
2390WildcardBounds3 ::= 'super' ReferenceType3
2391/.$putCase consumeWildcardBounds3Super(); $break ./
2392/:$readableName WildcardBound3:/
2393/:$compliance 1.5:/
2394
2395TypeParameterHeader ::= Identifier
2396/.$putCase consumeTypeParameterHeader(); $break ./
2397/:$readableName TypeParameter:/
2398/:$compliance 1.5:/
2399
2400TypeParameters ::= '<' TypeParameterList1
2401/.$putCase consumeTypeParameters(); $break ./
2402/:$readableName TypeParameters:/
2403/:$compliance 1.5:/
2404
2405TypeParameterList -> TypeParameter
2406/:$compliance 1.5:/
2407TypeParameterList ::= TypeParameterList ',' TypeParameter
2408/.$putCase consumeTypeParameterList(); $break ./
2409/:$readableName TypeParameterList:/
2410/:$compliance 1.5:/
2411
2412TypeParameter -> TypeParameterHeader
2413/:$compliance 1.5:/
2414TypeParameter ::= TypeParameterHeader 'extends' ReferenceType
2415/.$putCase consumeTypeParameterWithExtends(); $break ./
2416/:$compliance 1.5:/
2417TypeParameter ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList
2418/.$putCase consumeTypeParameterWithExtendsAndBounds(); $break ./
2419/:$readableName TypeParameter:/
2420/:$compliance 1.5:/
2421
2422--{ObjectTeams:
2423-- <B base R>
2424TypeParameter ::= TypeParameterHeader 'base' ReferenceType
2425/.$putCase consumeTypeParameterWithBase(); $break ./
2426/:$compliance 1.5:/
2427
2428-- <... Team t ...>
2429TypeParameter -> TypeValueParameter
2430TypeParameter1 -> TypeValueParameter1
2431
2432TypeValueParameter1 -> TypeValueParameter '>'
2433
2434TypeValueParameter ::= TypeParameterHeader Identifier
2435/.$putCase consumeTypeValueParameter(); $break ./
2436/:$compliance 1.5:/
2437/:$readableName TypeValueParameter:/
2438
2439TypeParameter -> AnchoredTypeParameterHeader0 '>' TypeBoundOpt
2440TypeParameter1 -> AnchoredTypeParameterHeader0 '>' TypeBoundOpt1
2441TypeParameter1 -> AnchoredTypeParameterHeader0 '>>'
2442
2443TypeBoundOpt -> $empty
2444TypeBoundOpt ::= 'extends' ReferenceType
2445/.$putCase consumeBoundsOfAnchoredTypeParameter(); $break ./
2446/:$compliance 1.5:/
2447/:$readableName TypeParameterBound:/
2448
2449TypeBoundOpt1 -> '>'
2450TypeBoundOpt1 ::= 'extends' ReferenceType1
2451/.$putCase consumeBoundsOfAnchoredTypeParameter(); $break ./
2452/:$compliance 1.5:/
2453/:$readableName TypeParameterBound:/
2454
2455AnchoredTypeParameterHeader0 ::= TypeParameterHeader '<' TypeAnchor
2456/.$putCase consumeAnchoredTypeParameter(); $break ./
2457/:$compliance 1.5:/
2458/:$readableName AnchoredTypeParameter:/
2459-- SH}
2460
2461AdditionalBoundList -> AdditionalBound
2462/:$compliance 1.5:/
2463AdditionalBoundList ::= AdditionalBoundList AdditionalBound
2464/.$putCase consumeAdditionalBoundList(); $break ./
2465/:$readableName AdditionalBoundList:/
2466
2467AdditionalBound ::= '&' ReferenceType
2468/.$putCase consumeAdditionalBound(); $break ./
2469/:$readableName AdditionalBound:/
2470/:$compliance 1.5:/
2471
2472TypeParameterList1 -> TypeParameter1
2473/:$compliance 1.5:/
2474TypeParameterList1 ::= TypeParameterList ',' TypeParameter1
2475/.$putCase consumeTypeParameterList1(); $break ./
2476/:$readableName TypeParameterList1:/
2477/:$compliance 1.5:/
2478
2479TypeParameter1 ::= TypeParameterHeader '>'
2480/.$putCase consumeTypeParameter1(); $break ./
2481/:$compliance 1.5:/
2482TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType1
2483/.$putCase consumeTypeParameter1WithExtends(); $break ./
2484/:$compliance 1.5:/
2485
2486--{ObjectTeams: <B base R>
2487TypeParameter1 ::= TypeParameterHeader 'base' ReferenceType1
2488/.$putCase consumeTypeParameter1WithBase(); $break ./
2489/:$compliance 1.5:/
2490-- SH}
2491
2492TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList1
2493/.$putCase consumeTypeParameter1WithExtendsAndBounds(); $break ./
2494/:$readableName TypeParameter1:/
2495/:$compliance 1.5:/
2496
2497AdditionalBoundList1 -> AdditionalBound1
2498/:$compliance 1.5:/
2499AdditionalBoundList1 ::= AdditionalBoundList AdditionalBound1
2500/.$putCase consumeAdditionalBoundList1(); $break ./
2501/:$readableName AdditionalBoundList1:/
2502/:$compliance 1.5:/
2503
2504AdditionalBound1 ::= '&' ReferenceType1
2505/.$putCase consumeAdditionalBound1(); $break ./
2506/:$readableName AdditionalBound1:/
2507/:$compliance 1.5:/
2508
2509-------------------------------------------------
2510-- Duplicate rules to remove ambiguity for (x) --
2511-------------------------------------------------
2512PostfixExpression_NotName -> Primary
2513PostfixExpression_NotName -> PostIncrementExpression
2514PostfixExpression_NotName -> PostDecrementExpression
2515/:$readableName Expression:/
2516
2517UnaryExpression_NotName -> PreIncrementExpression
2518UnaryExpression_NotName -> PreDecrementExpression
2519UnaryExpression_NotName ::= '+' PushPosition UnaryExpression
2520/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./
2521UnaryExpression_NotName ::= '-' PushPosition UnaryExpression
2522/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./
2523UnaryExpression_NotName -> UnaryExpressionNotPlusMinus_NotName
2524/:$readableName Expression:/
2525
2526UnaryExpressionNotPlusMinus_NotName -> PostfixExpression_NotName
2527UnaryExpressionNotPlusMinus_NotName ::= '~' PushPosition UnaryExpression
2528/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./
2529UnaryExpressionNotPlusMinus_NotName ::= '!' PushPosition UnaryExpression
2530/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./
2531UnaryExpressionNotPlusMinus_NotName -> CastExpression
2532/:$readableName Expression:/
2533
2534MultiplicativeExpression_NotName -> UnaryExpression_NotName
2535MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '*' UnaryExpression
2536/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./
2537MultiplicativeExpression_NotName ::= Name '*' UnaryExpression
2538/.$putCase consumeBinaryExpressionWithName(OperatorIds.MULTIPLY); $break ./
2539MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '/' UnaryExpression
2540/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./
2541MultiplicativeExpression_NotName ::= Name '/' UnaryExpression
2542/.$putCase consumeBinaryExpressionWithName(OperatorIds.DIVIDE); $break ./
2543MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '%' UnaryExpression
2544/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./
2545MultiplicativeExpression_NotName ::= Name '%' UnaryExpression
2546/.$putCase consumeBinaryExpressionWithName(OperatorIds.REMAINDER); $break ./
2547/:$readableName Expression:/
2548
2549AdditiveExpression_NotName -> MultiplicativeExpression_NotName
2550AdditiveExpression_NotName ::= AdditiveExpression_NotName '+' MultiplicativeExpression
2551/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./
2552AdditiveExpression_NotName ::= Name '+' MultiplicativeExpression
2553/.$putCase consumeBinaryExpressionWithName(OperatorIds.PLUS); $break ./
2554AdditiveExpression_NotName ::= AdditiveExpression_NotName '-' MultiplicativeExpression
2555/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./
2556AdditiveExpression_NotName ::= Name '-' MultiplicativeExpression
2557/.$putCase consumeBinaryExpressionWithName(OperatorIds.MINUS); $break ./
2558/:$readableName Expression:/
2559
2560ShiftExpression_NotName -> AdditiveExpression_NotName
2561ShiftExpression_NotName ::= ShiftExpression_NotName '<<' AdditiveExpression
2562/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./
2563ShiftExpression_NotName ::= Name '<<' AdditiveExpression
2564/.$putCase consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT); $break ./
2565ShiftExpression_NotName ::= ShiftExpression_NotName '>>' AdditiveExpression
2566/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./
2567ShiftExpression_NotName ::= Name '>>' AdditiveExpression
2568/.$putCase consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT); $break ./
2569ShiftExpression_NotName ::= ShiftExpression_NotName '>>>' AdditiveExpression
2570/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
2571ShiftExpression_NotName ::= Name '>>>' AdditiveExpression
2572/.$putCase consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
2573/:$readableName Expression:/
2574
2575RelationalExpression_NotName -> ShiftExpression_NotName
2576RelationalExpression_NotName ::= ShiftExpression_NotName '<' ShiftExpression
2577/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./
2578RelationalExpression_NotName ::= Name '<' ShiftExpression
2579/.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS); $break ./
2580RelationalExpression_NotName ::= ShiftExpression_NotName '>' ShiftExpression
2581/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./
2582RelationalExpression_NotName ::= Name '>' ShiftExpression
2583/.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER); $break ./
2584RelationalExpression_NotName ::= RelationalExpression_NotName '<=' ShiftExpression
2585/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./
2586RelationalExpression_NotName ::= Name '<=' ShiftExpression
2587/.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL); $break ./
2588RelationalExpression_NotName ::= RelationalExpression_NotName '>=' ShiftExpression
2589/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./
2590RelationalExpression_NotName ::= Name '>=' ShiftExpression
2591/.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL); $break ./
2592/:$readableName Expression:/
2593
2594InstanceofExpression_NotName -> RelationalExpression_NotName
2595InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType
2596/.$putCase consumeInstanceOfExpressionWithName(); $break ./
2597InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType
2598/.$putCase consumeInstanceOfExpression(); $break ./
2599/:$readableName Expression:/
2600
2601EqualityExpression_NotName -> InstanceofExpression_NotName
2602EqualityExpression_NotName ::= EqualityExpression_NotName '==' InstanceofExpression
2603/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./
2604EqualityExpression_NotName ::= Name '==' InstanceofExpression
2605/.$putCase consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL); $break ./
2606EqualityExpression_NotName ::= EqualityExpression_NotName '!=' InstanceofExpression
2607/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./
2608EqualityExpression_NotName ::= Name '!=' InstanceofExpression
2609/.$putCase consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL); $break ./
2610/:$readableName Expression:/
2611
2612AndExpression_NotName -> EqualityExpression_NotName
2613AndExpression_NotName ::= AndExpression_NotName '&' EqualityExpression
2614/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./
2615AndExpression_NotName ::= Name '&' EqualityExpression
2616/.$putCase consumeBinaryExpressionWithName(OperatorIds.AND); $break ./
2617/:$readableName Expression:/
2618
2619ExclusiveOrExpression_NotName -> AndExpression_NotName
2620ExclusiveOrExpression_NotName ::= ExclusiveOrExpression_NotName '^' AndExpression
2621/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./
2622ExclusiveOrExpression_NotName ::= Name '^' AndExpression
2623/.$putCase consumeBinaryExpressionWithName(OperatorIds.XOR); $break ./
2624/:$readableName Expression:/
2625
2626InclusiveOrExpression_NotName -> ExclusiveOrExpression_NotName
2627InclusiveOrExpression_NotName ::= InclusiveOrExpression_NotName '|' ExclusiveOrExpression
2628/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./
2629InclusiveOrExpression_NotName ::= Name '|' ExclusiveOrExpression
2630/.$putCase consumeBinaryExpressionWithName(OperatorIds.OR); $break ./
2631/:$readableName Expression:/
2632
2633ConditionalAndExpression_NotName -> InclusiveOrExpression_NotName
2634ConditionalAndExpression_NotName ::= ConditionalAndExpression_NotName '&&' InclusiveOrExpression
2635/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./
2636ConditionalAndExpression_NotName ::= Name '&&' InclusiveOrExpression
2637/.$putCase consumeBinaryExpressionWithName(OperatorIds.AND_AND); $break ./
2638/:$readableName Expression:/
2639
2640ConditionalOrExpression_NotName -> ConditionalAndExpression_NotName
2641ConditionalOrExpression_NotName ::= ConditionalOrExpression_NotName '||' ConditionalAndExpression
2642/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./
2643ConditionalOrExpression_NotName ::= Name '||' ConditionalAndExpression
2644/.$putCase consumeBinaryExpressionWithName(OperatorIds.OR_OR); $break ./
2645/:$readableName Expression:/
2646
2647ConditionalExpression_NotName -> ConditionalOrExpression_NotName
2648ConditionalExpression_NotName ::= ConditionalOrExpression_NotName '?' Expression ':' ConditionalExpression
2649/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./
2650ConditionalExpression_NotName ::= Name '?' Expression ':' ConditionalExpression
2651/.$putCase consumeConditionalExpressionWithName(OperatorIds.QUESTIONCOLON) ; $break ./
2652/:$readableName Expression:/
2653
2654AssignmentExpression_NotName -> ConditionalExpression_NotName
2655AssignmentExpression_NotName -> Assignment
2656/:$readableName Expression:/
2657
2658Expression_NotName -> AssignmentExpression_NotName
2659/:$readableName Expression:/
2660-----------------------------------------------
2661-- 1.5 features : end of generics
2662-----------------------------------------------
2663-----------------------------------------------
2664-- 1.5 features : annotation - Metadata feature jsr175
2665-----------------------------------------------
2666AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier
2667/.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./
2668/:$compliance 1.5:/
2669AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers interface Identifier TypeParameters
2670/.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./
2671/:$compliance 1.5:/
2672AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier TypeParameters
2673/.$putCase consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters() ; $break ./
2674/:$compliance 1.5:/
2675AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader interface Identifier
2676/.$putCase consumeAnnotationTypeDeclarationHeaderName() ; $break ./
2677/:$readableName AnnotationTypeDeclarationHeaderName:/
2678/:$compliance 1.5:/
2679
2680AnnotationTypeDeclarationHeader ::= AnnotationTypeDeclarationHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt
2681/.$putCase consumeAnnotationTypeDeclarationHeader() ; $break ./
2682/:$readableName AnnotationTypeDeclarationHeader:/
2683/:$compliance 1.5:/
2684
2685AnnotationTypeDeclaration ::= AnnotationTypeDeclarationHeader AnnotationTypeBody
2686/.$putCase consumeAnnotationTypeDeclaration() ; $break ./
2687/:$readableName AnnotationTypeDeclaration:/
2688/:$compliance 1.5:/
2689
2690AnnotationTypeBody ::= '{' AnnotationTypeMemberDeclarationsopt '}'
2691/:$readableName AnnotationTypeBody:/
2692/:$compliance 1.5:/
2693
2694AnnotationTypeMemberDeclarationsopt ::= $empty
2695/.$putCase consumeEmptyAnnotationTypeMemberDeclarationsopt() ; $break ./
2696/:$compliance 1.5:/
2697AnnotationTypeMemberDeclarationsopt ::= NestedType AnnotationTypeMemberDeclarations
2698/.$putCase consumeAnnotationTypeMemberDeclarationsopt() ; $break ./
2699/:$readableName AnnotationTypeMemberDeclarations:/
2700/:$compliance 1.5:/
2701
2702AnnotationTypeMemberDeclarations -> AnnotationTypeMemberDeclaration
2703/:$compliance 1.5:/
2704AnnotationTypeMemberDeclarations ::= AnnotationTypeMemberDeclarations AnnotationTypeMemberDeclaration
2705/.$putCase consumeAnnotationTypeMemberDeclarations() ; $break ./
2706/:$readableName AnnotationTypeMemberDeclarations:/
2707/:$compliance 1.5:/
2708
2709AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
2710/.$putCase consumeMethodHeaderNameWithTypeParameters(true); $break ./
2711AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
2712/.$putCase consumeMethodHeaderName(true); $break ./
2713/:$readableName MethodHeaderName:/
2714/:$compliance 1.5:/
2715
2716AnnotationMethodHeaderDefaultValueopt ::= $empty
2717/.$putCase consumeEmptyMethodHeaderDefaultValue() ; $break ./
2718/:$readableName MethodHeaderDefaultValue:/
2719/:$compliance 1.5:/
2720AnnotationMethodHeaderDefaultValueopt ::= DefaultValue
2721/.$putCase consumeMethodHeaderDefaultValue(); $break ./
2722/:$readableName MethodHeaderDefaultValue:/
2723/:$compliance 1.5:/
2724
2725AnnotationMethodHeader ::= AnnotationMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims AnnotationMethodHeaderDefaultValueopt
2726/.$putCase consumeMethodHeader(); $break ./
2727/:$readableName AnnotationMethodHeader:/
2728/:$compliance 1.5:/
2729
2730AnnotationTypeMemberDeclaration ::= AnnotationMethodHeader ';'
2731/.$putCase consumeAnnotationTypeMemberDeclaration() ; $break ./
2732/:$compliance 1.5:/
2733AnnotationTypeMemberDeclaration -> ConstantDeclaration
2734/:$compliance 1.5:/
2735AnnotationTypeMemberDeclaration -> ConstructorDeclaration
2736/:$compliance 1.5:/
2737AnnotationTypeMemberDeclaration -> TypeDeclaration
2738/:$readableName AnnotationTypeMemberDeclaration:/
2739/:$compliance 1.5:/
2740
2741DefaultValue ::= 'default' MemberValue
2742/:$readableName DefaultValue:/
2743/:$compliance 1.5:/
2744
2745Annotation -> NormalAnnotation
2746/:$compliance 1.5:/
2747Annotation -> MarkerAnnotation
2748/:$compliance 1.5:/
2749Annotation -> SingleMemberAnnotation
2750/:$readableName Annotation:/
2751/:$compliance 1.5:/
2752
2753AnnotationName ::= '@' Name
2754/.$putCase consumeAnnotationName() ; $break ./
2755/:$readableName AnnotationName:/
2756/:$compliance 1.5:/
2757
2758NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')'
2759/.$putCase consumeNormalAnnotation() ; $break ./
2760/:$readableName NormalAnnotation:/
2761/:$compliance 1.5:/
2762
2763MemberValuePairsopt ::= $empty
2764/.$putCase consumeEmptyMemberValuePairsopt() ; $break ./
2765/:$compliance 1.5:/
2766MemberValuePairsopt -> MemberValuePairs
2767/:$readableName MemberValuePairsopt:/
2768/:$compliance 1.5:/
2769
2770MemberValuePairs -> MemberValuePair
2771/:$compliance 1.5:/
2772MemberValuePairs ::= MemberValuePairs ',' MemberValuePair
2773/.$putCase consumeMemberValuePairs() ; $break ./
2774/:$readableName MemberValuePairs:/
2775/:$compliance 1.5:/
2776
2777MemberValuePair ::= SimpleName '=' EnterMemberValue MemberValue ExitMemberValue
2778/.$putCase consumeMemberValuePair() ; $break ./
2779/:$readableName MemberValuePair:/
2780/:$compliance 1.5:/
2781
2782EnterMemberValue ::= $empty
2783/.$putCase consumeEnterMemberValue() ; $break ./
2784/:$readableName EnterMemberValue:/
2785/:$compliance 1.5:/
2786
2787ExitMemberValue ::= $empty
2788/.$putCase consumeExitMemberValue() ; $break ./
2789/:$readableName ExitMemberValue:/
2790/:$compliance 1.5:/
2791
2792MemberValue -> ConditionalExpression_NotName
2793/:$compliance 1.5:/
2794MemberValue ::= Name
2795/.$putCase consumeMemberValueAsName() ; $break ./
2796/:$compliance 1.5:/
2797MemberValue -> Annotation
2798/:$compliance 1.5:/
2799MemberValue -> MemberValueArrayInitializer
2800/:$readableName MemberValue:/
2801/:$recovery_template Identifier:/
2802/:$compliance 1.5:/
2803
2804MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues ',' '}'
2805/.$putCase consumeMemberValueArrayInitializer() ; $break ./
2806/:$compliance 1.5:/
2807MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues '}'
2808/.$putCase consumeMemberValueArrayInitializer() ; $break ./
2809/:$compliance 1.5:/
2810MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace ',' '}'
2811/.$putCase consumeEmptyMemberValueArrayInitializer() ; $break ./
2812/:$compliance 1.5:/
2813MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace '}'
2814/.$putCase consumeEmptyMemberValueArrayInitializer() ; $break ./
2815/:$readableName MemberValueArrayInitializer:/
2816/:$compliance 1.5:/
2817
2818EnterMemberValueArrayInitializer ::= $empty
2819/.$putCase consumeEnterMemberValueArrayInitializer() ; $break ./
2820/:$readableName EnterMemberValueArrayInitializer:/
2821/:$compliance 1.5:/
2822