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