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