blob: 689e9e2fc50d51458fa3d32574df6c840c7a8a9e [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
1704ClassInstanceCreationExpression ::= 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' UnqualifiedClassBodyopt
1705/.$putCase consumeClassInstanceCreationExpressionWithTypeArguments(); $break ./
1706
1707ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' UnqualifiedClassBodyopt
1708/.$putCase consumeClassInstanceCreationExpression(); $break ./
1709--1.1 feature
1710
1711ClassInstanceCreationExpression ::= Primary '.' 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1712/.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./
1713
1714ClassInstanceCreationExpression ::= Primary '.' 'new' ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1715/.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./
1716
1717--1.1 feature
1718ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1719/.$putCase consumeClassInstanceCreationExpressionQualified() ; $break ./
1720/:$readableName ClassInstanceCreationExpression:/
1721
1722ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' OnlyTypeArguments ClassType '(' ArgumentListopt ')' QualifiedClassBodyopt
1723/.$putCase consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() ; $break ./
1724/:$readableName ClassInstanceCreationExpression:/
1725
1726ClassInstanceCreationExpressionName ::= Name '.'
1727/.$putCase consumeClassInstanceCreationExpressionName() ; $break ./
1728/:$readableName ClassInstanceCreationExpressionName:/
1729
1730UnqualifiedClassBodyopt ::= $empty --test made using null as contents
1731/.$putCase consumeClassBodyopt(); $break ./
1732UnqualifiedClassBodyopt ::= UnqualifiedEnterAnonymousClassBody ClassBody
1733/:$readableName ClassBody:/
1734/:$no_statements_recovery:/
1735
1736UnqualifiedEnterAnonymousClassBody ::= $empty
1737/.$putCase consumeEnterAnonymousClassBody(false); $break ./
1738/:$readableName EnterAnonymousClassBody:/
1739
1740QualifiedClassBodyopt ::= $empty --test made using null as contents
1741/.$putCase consumeClassBodyopt(); $break ./
1742QualifiedClassBodyopt ::= QualifiedEnterAnonymousClassBody ClassBody
1743/:$readableName ClassBody:/
1744/:$no_statements_recovery:/
1745
1746QualifiedEnterAnonymousClassBody ::= $empty
1747/.$putCase consumeEnterAnonymousClassBody(true); $break ./
1748/:$readableName EnterAnonymousClassBody:/
1749
1750ArgumentList ::= Expression
1751ArgumentList ::= ArgumentList ',' Expression
1752/.$putCase consumeArgumentList(); $break ./
1753/:$readableName ArgumentList:/
1754
1755ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs
1756/.$putCase consumeArrayCreationHeader(); $break ./
1757
1758ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1759/.$putCase consumeArrayCreationHeader(); $break ./
1760/:$readableName ArrayCreationHeader:/
1761
1762ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs
1763/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1764/:$readableName ArrayCreationWithoutArrayInitializer:/
1765
1766ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer
1767/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1768/:$readableName ArrayCreationWithArrayInitializer:/
1769
1770ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
1771/.$putCase consumeArrayCreationExpressionWithoutInitializer(); $break ./
1772
1773ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer
1774/.$putCase consumeArrayCreationExpressionWithInitializer(); $break ./
1775
1776DimWithOrWithOutExprs ::= DimWithOrWithOutExpr
1777DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr
1778/.$putCase consumeDimWithOrWithOutExprs(); $break ./
1779/:$readableName Dimensions:/
1780
1781DimWithOrWithOutExpr ::= '[' Expression ']'
1782DimWithOrWithOutExpr ::= '[' ']'
1783/. $putCase consumeDimWithOrWithOutExpr(); $break ./
1784/:$readableName Dimension:/
1785-- -----------------------------------------------
1786
1787Dims ::= DimsLoop
1788/. $putCase consumeDims(); $break ./
1789/:$readableName Dimensions:/
1790DimsLoop -> OneDimLoop
1791DimsLoop ::= DimsLoop OneDimLoop
1792/:$readableName Dimensions:/
1793OneDimLoop ::= '[' ']'
1794/. $putCase consumeOneDimLoop(); $break ./
1795/:$readableName Dimension:/
1796
1797FieldAccess ::= Primary '.' 'Identifier'
1798/.$putCase consumeFieldAccess(false); $break ./
1799
1800FieldAccess ::= 'super' '.' 'Identifier'
1801/.$putCase consumeFieldAccess(true); $break ./
1802/:$readableName FieldAccess:/
1803
1804MethodInvocation ::= Name '(' ArgumentListopt ')'
1805/.$putCase consumeMethodInvocationName(); $break ./
1806
1807MethodInvocation ::= Name '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1808/.$putCase consumeMethodInvocationNameWithTypeArguments(); $break ./
1809
1810MethodInvocation ::= Primary '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1811/.$putCase consumeMethodInvocationPrimaryWithTypeArguments(); $break ./
1812
1813MethodInvocation ::= Primary '.' 'Identifier' '(' ArgumentListopt ')'
1814/.$putCase consumeMethodInvocationPrimary(); $break ./
1815
1816MethodInvocation ::= 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1817/.$putCase consumeMethodInvocationSuperWithTypeArguments(); $break ./
1818
1819MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')'
1820/.$putCase consumeMethodInvocationSuper(); $break ./
1821
1822-- {ObjectTeams
1823MethodInvocation ::= 'tsuper' '.' 'Identifier' '(' ArgumentListopt ')'
1824/.$putCase consumeMethodInvocationTSuper(UNQUALIFIED); $break ./
1825
1826MethodInvocation ::= 'tsuper' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1827/.$putCase consumeMethodInvocationTSuperWithTypeArguments(0); $break ./
1828
1829MethodInvocation ::= Name '.' 'tsuper' '.' 'Identifier' '(' ArgumentListopt ')'
1830/.$putCase consumeMethodInvocationTSuper(QUALIFIED); $break ./
1831
1832MethodInvocation ::= Name '.' 'tsuper' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1833/.$putCase consumeMethodInvocationTSuperWithTypeArguments(2); $break ./
1834
1835MethodInvocation ::= 'base' '.' 'Identifier' '(' ArgumentListopt ')'
1836/.$putCase consumeMethodInvocationBase(false); $break ./
1837
1838MethodInvocation ::= 'base' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1839/.$putCase consumeMethodInvocationBaseWithTypeArguments(false); $break ./
1840
1841MethodInvocation ::= 'base' '.' 'super' '.' 'Identifier' '(' ArgumentListopt ')'
1842/.$putCase consumeMethodInvocationBase(true); $break ./
1843
1844MethodInvocation ::= 'base' '.' 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
1845/.$putCase consumeMethodInvocationBaseWithTypeArguments(true); $break ./
1846-- Markus Witte}
1847
1848/:$readableName MethodInvocation:/
1849
1850ArrayAccess ::= Name '[' Expression ']'
1851/.$putCase consumeArrayAccess(true); $break ./
1852ArrayAccess ::= PrimaryNoNewArray '[' Expression ']'
1853/.$putCase consumeArrayAccess(false); $break ./
1854ArrayAccess ::= ArrayCreationWithArrayInitializer '[' Expression ']'
1855/.$putCase consumeArrayAccess(false); $break ./
1856/:$readableName ArrayAccess:/
1857
1858PostfixExpression -> Primary
1859PostfixExpression ::= Name
1860/.$putCase consumePostfixExpression(); $break ./
1861PostfixExpression -> PostIncrementExpression
1862PostfixExpression -> PostDecrementExpression
1863/:$readableName Expression:/
1864
1865PostIncrementExpression ::= PostfixExpression '++'
1866/.$putCase consumeUnaryExpression(OperatorIds.PLUS,true); $break ./
1867/:$readableName PostIncrementExpression:/
1868
1869PostDecrementExpression ::= PostfixExpression '--'
1870/.$putCase consumeUnaryExpression(OperatorIds.MINUS,true); $break ./
1871/:$readableName PostDecrementExpression:/
1872
1873--for source managment purpose
1874PushPosition ::= $empty
1875 /.$putCase consumePushPosition(); $break ./
1876/:$readableName PushPosition:/
1877
1878UnaryExpression -> PreIncrementExpression
1879UnaryExpression -> PreDecrementExpression
1880UnaryExpression ::= '+' PushPosition UnaryExpression
1881/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./
1882UnaryExpression ::= '-' PushPosition UnaryExpression
1883/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./
1884UnaryExpression -> UnaryExpressionNotPlusMinus
1885/:$readableName Expression:/
1886
1887PreIncrementExpression ::= '++' PushPosition UnaryExpression
1888/.$putCase consumeUnaryExpression(OperatorIds.PLUS,false); $break ./
1889/:$readableName PreIncrementExpression:/
1890
1891PreDecrementExpression ::= '--' PushPosition UnaryExpression
1892/.$putCase consumeUnaryExpression(OperatorIds.MINUS,false); $break ./
1893/:$readableName PreDecrementExpression:/
1894
1895UnaryExpressionNotPlusMinus -> PostfixExpression
1896UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression
1897/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./
1898UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression
1899/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./
1900UnaryExpressionNotPlusMinus -> CastExpression
1901/:$readableName Expression:/
1902
1903CastExpression ::= PushLPAREN PrimitiveType Dimsopt PushRPAREN InsideCastExpression UnaryExpression
1904/.$putCase consumeCastExpressionWithPrimitiveType(); $break ./
1905CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1906/.$putCase consumeCastExpressionWithGenericsArray(); $break ./
1907CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus
1908/.$putCase consumeCastExpressionWithQualifiedGenericsArray(); $break ./
1909CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
1910/.$putCase consumeCastExpressionLL1(); $break ./
1911CastExpression ::= PushLPAREN Name Dims PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
1912/.$putCase consumeCastExpressionWithNameArray(); $break ./
1913/:$readableName CastExpression:/
1914
1915OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
1916/.$putCase consumeOnlyTypeArgumentsForCastExpression(); $break ./
1917/:$readableName TypeArguments:/
1918
1919InsideCastExpression ::= $empty
1920/.$putCase consumeInsideCastExpression(); $break ./
1921/:$readableName InsideCastExpression:/
1922InsideCastExpressionLL1 ::= $empty
1923/.$putCase consumeInsideCastExpressionLL1(); $break ./
1924/:$readableName InsideCastExpression:/
1925InsideCastExpressionWithQualifiedGenerics ::= $empty
1926/.$putCase consumeInsideCastExpressionWithQualifiedGenerics(); $break ./
1927/:$readableName InsideCastExpression:/
1928
1929MultiplicativeExpression -> UnaryExpression
1930MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression
1931/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./
1932MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression
1933/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./
1934MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression
1935/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./
1936/:$readableName Expression:/
1937
1938AdditiveExpression -> MultiplicativeExpression
1939AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression
1940/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./
1941AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression
1942/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./
1943/:$readableName Expression:/
1944
1945ShiftExpression -> AdditiveExpression
Stephan Herrmann44109d32011-08-02 14:34:26 +00001946ShiftExpression ::= ShiftExpression '<<' AdditiveExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00001947/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00001948ShiftExpression ::= ShiftExpression '>>' AdditiveExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00001949/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./
1950ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression
1951/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
1952/:$readableName Expression:/
1953
1954RelationalExpression -> ShiftExpression
Stephan Herrmann44109d32011-08-02 14:34:26 +00001955RelationalExpression ::= RelationalExpression '<' ShiftExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00001956/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00001957RelationalExpression ::= RelationalExpression '>' ShiftExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00001958/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./
1959RelationalExpression ::= RelationalExpression '<=' ShiftExpression
1960/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./
1961RelationalExpression ::= RelationalExpression '>=' ShiftExpression
1962/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./
1963/:$readableName Expression:/
1964
1965InstanceofExpression -> RelationalExpression
1966InstanceofExpression ::= InstanceofExpression 'instanceof' ReferenceType
1967/.$putCase consumeInstanceOfExpression(); $break ./
1968/:$readableName Expression:/
1969
1970EqualityExpression -> InstanceofExpression
1971EqualityExpression ::= EqualityExpression '==' InstanceofExpression
1972/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./
1973EqualityExpression ::= EqualityExpression '!=' InstanceofExpression
1974/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./
1975/:$readableName Expression:/
1976
1977AndExpression -> EqualityExpression
1978AndExpression ::= AndExpression '&' EqualityExpression
1979/.$putCase consumeBinaryExpression(OperatorIds.AND); $break ./
1980/:$readableName Expression:/
1981
1982ExclusiveOrExpression -> AndExpression
1983ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression
1984/.$putCase consumeBinaryExpression(OperatorIds.XOR); $break ./
1985/:$readableName Expression:/
1986
1987InclusiveOrExpression -> ExclusiveOrExpression
1988InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression
1989/.$putCase consumeBinaryExpression(OperatorIds.OR); $break ./
1990/:$readableName Expression:/
1991
1992ConditionalAndExpression -> InclusiveOrExpression
1993ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression
1994/.$putCase consumeBinaryExpression(OperatorIds.AND_AND); $break ./
1995/:$readableName Expression:/
1996
1997ConditionalOrExpression -> ConditionalAndExpression
1998ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression
1999/.$putCase consumeBinaryExpression(OperatorIds.OR_OR); $break ./
2000/:$readableName Expression:/
2001
2002ConditionalExpression -> ConditionalOrExpression
2003ConditionalExpression ::= ConditionalOrExpression '?' Expression ':' ConditionalExpression
2004/.$putCase consumeConditionalExpression(OperatorIds.QUESTIONCOLON) ; $break ./
2005/:$readableName Expression:/
2006
2007AssignmentExpression -> ConditionalExpression
2008AssignmentExpression -> Assignment
2009/:$readableName Expression:/
2010/:$recovery_template Identifier:/
2011
2012Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression
2013/.$putCase consumeAssignment(); $break ./
2014/:$readableName Assignment:/
2015
2016-- this rule is added to parse an array initializer in a assigment and then report a syntax error knowing the exact senario
2017InvalidArrayInitializerAssignement ::= PostfixExpression AssignmentOperator ArrayInitializer
2018/:$readableName ArrayInitializerAssignment:/
2019/:$recovery:/
2020Assignment ::= InvalidArrayInitializerAssignement
2021/.$putcase ignoreExpressionAssignment();$break ./
2022/:$recovery:/
2023
2024AssignmentOperator ::= '='
2025/.$putCase consumeAssignmentOperator(EQUAL); $break ./
2026AssignmentOperator ::= '*='
2027/.$putCase consumeAssignmentOperator(MULTIPLY); $break ./
2028AssignmentOperator ::= '/='
2029/.$putCase consumeAssignmentOperator(DIVIDE); $break ./
2030AssignmentOperator ::= '%='
2031/.$putCase consumeAssignmentOperator(REMAINDER); $break ./
2032AssignmentOperator ::= '+='
2033/.$putCase consumeAssignmentOperator(PLUS); $break ./
2034AssignmentOperator ::= '-='
2035/.$putCase consumeAssignmentOperator(MINUS); $break ./
2036AssignmentOperator ::= '<<='
2037/.$putCase consumeAssignmentOperator(LEFT_SHIFT); $break ./
2038AssignmentOperator ::= '>>='
2039/.$putCase consumeAssignmentOperator(RIGHT_SHIFT); $break ./
2040AssignmentOperator ::= '>>>='
2041/.$putCase consumeAssignmentOperator(UNSIGNED_RIGHT_SHIFT); $break ./
2042AssignmentOperator ::= '&='
2043/.$putCase consumeAssignmentOperator(AND); $break ./
2044AssignmentOperator ::= '^='
2045/.$putCase consumeAssignmentOperator(XOR); $break ./
2046AssignmentOperator ::= '|='
2047/.$putCase consumeAssignmentOperator(OR); $break ./
2048/:$readableName AssignmentOperator:/
2049/:$recovery_template =:/
2050
2051Expression -> AssignmentExpression
2052/:$readableName Expression:/
2053/:$recovery_template Identifier:/
2054
2055-- The following rules are for optional nonterminals.
2056--
2057ClassHeaderExtendsopt ::= $empty
2058ClassHeaderExtendsopt -> ClassHeaderExtends
2059/:$readableName ClassHeaderExtends:/
2060
2061Expressionopt ::= $empty
2062/.$putCase consumeEmptyExpression(); $break ./
2063Expressionopt -> Expression
2064/:$readableName Expression:/
2065
2066ConstantExpression -> Expression
2067/:$readableName ConstantExpression:/
2068
2069---------------------------------------------------------------------------------------
2070--
2071-- The rules below are for optional terminal symbols. An optional comma,
2072-- is only used in the context of an array initializer - It is a
2073-- "syntactic sugar" that otherwise serves no other purpose. By contrast,
2074-- an optional identifier is used in the definition of a break and
2075-- continue statement. When the identifier does not appear, a NULL
2076-- is produced. When the identifier is present, the user should use the
2077-- corresponding TOKEN(i) method. See break statement as an example.
2078--
2079---------------------------------------------------------------------------------------
2080
2081,opt -> $empty
2082,opt -> ,
2083/:$readableName ,:/
2084
2085ClassBodyDeclarationsopt ::= $empty
2086/.$putCase consumeEmptyClassBodyDeclarationsopt(); $break ./
2087ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations
2088/.$putCase consumeClassBodyDeclarationsopt(); $break ./
2089/:$readableName ClassBodyDeclarations:/
2090
2091Modifiersopt ::= $empty
2092/. $putCase consumeDefaultModifiers(); $break ./
2093Modifiersopt ::= Modifiers
2094/.$putCase consumeModifiers(); $break ./
2095/:$readableName Modifiers:/
2096
2097BlockStatementsopt ::= $empty
2098/.$putCase consumeEmptyBlockStatementsopt(); $break ./
2099BlockStatementsopt -> BlockStatements
2100/:$readableName BlockStatements:/
2101
2102Dimsopt ::= $empty
2103/. $putCase consumeEmptyDimsopt(); $break ./
2104Dimsopt -> Dims
2105/:$readableName Dimensions:/
2106
2107ArgumentListopt ::= $empty
2108/. $putCase consumeEmptyArgumentListopt(); $break ./
2109ArgumentListopt -> ArgumentList
2110/:$readableName ArgumentList:/
2111
2112MethodHeaderThrowsClauseopt ::= $empty
2113MethodHeaderThrowsClauseopt -> MethodHeaderThrowsClause
2114/:$readableName MethodHeaderThrowsClause:/
2115
2116FormalParameterListopt ::= $empty
2117/.$putcase consumeFormalParameterListopt(); $break ./
2118FormalParameterListopt -> FormalParameterList
2119/:$readableName FormalParameterList:/
2120
2121ClassHeaderImplementsopt ::= $empty
2122ClassHeaderImplementsopt -> ClassHeaderImplements
2123/:$readableName ClassHeaderImplements:/
2124
2125InterfaceMemberDeclarationsopt ::= $empty
2126/. $putCase consumeEmptyInterfaceMemberDeclarationsopt(); $break ./
2127InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations
2128/. $putCase consumeInterfaceMemberDeclarationsopt(); $break ./
2129/:$readableName InterfaceMemberDeclarations:/
2130
2131NestedType ::= $empty
2132/.$putCase consumeNestedType(); $break./
2133/:$readableName NestedType:/
2134
2135ForInitopt ::= $empty
2136/. $putCase consumeEmptyForInitopt(); $break ./
2137ForInitopt -> ForInit
2138/:$readableName ForInit:/
2139
2140ForUpdateopt ::= $empty
2141/. $putCase consumeEmptyForUpdateopt(); $break ./
2142ForUpdateopt -> ForUpdate
2143/:$readableName ForUpdate:/
2144
2145InterfaceHeaderExtendsopt ::= $empty
2146InterfaceHeaderExtendsopt -> InterfaceHeaderExtends
2147/:$readableName InterfaceHeaderExtends:/
2148
2149Catchesopt ::= $empty
2150/. $putCase consumeEmptyCatchesopt(); $break ./
2151Catchesopt -> Catches
2152/:$readableName Catches:/
2153
2154-----------------------------------------------
2155-- 1.5 features : enum type
2156-----------------------------------------------
2157EnumDeclaration ::= EnumHeader EnumBody
2158/. $putCase consumeEnumDeclaration(); $break ./
2159/:$readableName EnumDeclaration:/
2160
2161EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt
2162/. $putCase consumeEnumHeader(); $break ./
2163/:$readableName EnumHeader:/
2164
2165EnumHeaderName ::= Modifiersopt 'enum' Identifier
2166/. $putCase consumeEnumHeaderName(); $break ./
2167/:$compliance 1.5:/
2168EnumHeaderName ::= Modifiersopt 'enum' Identifier TypeParameters
2169/. $putCase consumeEnumHeaderNameWithTypeParameters(); $break ./
2170/:$readableName EnumHeaderName:/
2171/:$compliance 1.5:/
2172
2173EnumBody ::= '{' EnumBodyDeclarationsopt '}'
2174/. $putCase consumeEnumBodyNoConstants(); $break ./
2175EnumBody ::= '{' ',' EnumBodyDeclarationsopt '}'
2176/. $putCase consumeEnumBodyNoConstants(); $break ./
2177EnumBody ::= '{' EnumConstants ',' EnumBodyDeclarationsopt '}'
2178/. $putCase consumeEnumBodyWithConstants(); $break ./
2179EnumBody ::= '{' EnumConstants EnumBodyDeclarationsopt '}'
2180/. $putCase consumeEnumBodyWithConstants(); $break ./
2181/:$readableName EnumBody:/
2182
2183EnumConstants -> EnumConstant
2184EnumConstants ::= EnumConstants ',' EnumConstant
2185/.$putCase consumeEnumConstants(); $break ./
2186/:$readableName EnumConstants:/
2187
2188EnumConstantHeaderName ::= Modifiersopt Identifier
2189/.$putCase consumeEnumConstantHeaderName(); $break ./
2190/:$readableName EnumConstantHeaderName:/
2191
2192EnumConstantHeader ::= EnumConstantHeaderName ForceNoDiet Argumentsopt RestoreDiet
2193/.$putCase consumeEnumConstantHeader(); $break ./
2194/:$readableName EnumConstantHeader:/
2195
2196EnumConstant ::= EnumConstantHeader ForceNoDiet ClassBody RestoreDiet
2197/.$putCase consumeEnumConstantWithClassBody(); $break ./
2198EnumConstant ::= EnumConstantHeader
2199/.$putCase consumeEnumConstantNoClassBody(); $break ./
2200/:$readableName EnumConstant:/
2201
2202Arguments ::= '(' ArgumentListopt ')'
2203/.$putCase consumeArguments(); $break ./
2204/:$readableName Arguments:/
2205
2206Argumentsopt ::= $empty
2207/.$putCase consumeEmptyArguments(); $break ./
2208Argumentsopt -> Arguments
2209/:$readableName Argumentsopt:/
2210
2211EnumDeclarations ::= ';' ClassBodyDeclarationsopt
2212/.$putCase consumeEnumDeclarations(); $break ./
2213/:$readableName EnumDeclarations:/
2214
2215EnumBodyDeclarationsopt ::= $empty
2216/.$putCase consumeEmptyEnumDeclarations(); $break ./
2217EnumBodyDeclarationsopt -> EnumDeclarations
2218/:$readableName EnumBodyDeclarationsopt:/
2219
2220-----------------------------------------------
2221-- 1.5 features : enhanced for statement
2222-----------------------------------------------
2223EnhancedForStatement ::= EnhancedForStatementHeader Statement
2224/.$putCase consumeEnhancedForStatement(); $break ./
2225/:$readableName EnhancedForStatement:/
2226
2227EnhancedForStatementNoShortIf ::= EnhancedForStatementHeader StatementNoShortIf
2228/.$putCase consumeEnhancedForStatement(); $break ./
2229/:$readableName EnhancedForStatementNoShortIf:/
2230
2231EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers Identifier Dimsopt
2232/.$putCase consumeEnhancedForStatementHeaderInit(false); $break ./
2233/:$readableName EnhancedForStatementHeaderInit:/
2234
2235EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers Identifier Dimsopt
2236/.$putCase consumeEnhancedForStatementHeaderInit(true); $break ./
2237/:$readableName EnhancedForStatementHeaderInit:/
2238
2239EnhancedForStatementHeader ::= EnhancedForStatementHeaderInit ':' Expression ')'
2240/.$putCase consumeEnhancedForStatementHeader(); $break ./
2241/:$readableName EnhancedForStatementHeader:/
2242/:$compliance 1.5:/
2243
2244--{ObjectTeams: base import:
2245SingleBaseImportDeclaration ::= SingleBaseImportDeclarationName ';'
2246/.$putCase consumeImportDeclaration(); $break ./
2247/:$readableName SingleBaseImportDeclaration:/
2248
2249SingleBaseImportDeclarationName ::= 'import' 'base' Name
2250/.$putCase consumeSingleBaseImportDeclarationName(); $break ./
2251/:$readableName SingleBaseImportDeclarationName:/
2252-- SH}
2253-----------------------------------------------
2254-- 1.5 features : static imports
2255-----------------------------------------------
2256SingleStaticImportDeclaration ::= SingleStaticImportDeclarationName ';'
2257/.$putCase consumeImportDeclaration(); $break ./
2258/:$readableName SingleStaticImportDeclaration:/
2259
2260SingleStaticImportDeclarationName ::= 'import' 'static' Name
2261/.$putCase consumeSingleStaticImportDeclarationName(); $break ./
2262/:$readableName SingleStaticImportDeclarationName:/
2263/:$compliance 1.5:/
2264
2265StaticImportOnDemandDeclaration ::= StaticImportOnDemandDeclarationName ';'
2266/.$putCase consumeImportDeclaration(); $break ./
2267/:$readableName StaticImportOnDemandDeclaration:/
2268
2269StaticImportOnDemandDeclarationName ::= 'import' 'static' Name '.' '*'
2270/.$putCase consumeStaticImportOnDemandDeclarationName(); $break ./
2271/:$readableName StaticImportOnDemandDeclarationName:/
2272/:$compliance 1.5:/
2273
2274-----------------------------------------------
2275-- 1.5 features : generics
2276-----------------------------------------------
2277TypeArguments ::= '<' TypeArgumentList1
2278/.$putCase consumeTypeArguments(); $break ./
2279/:$readableName TypeArguments:/
2280/:$compliance 1.5:/
2281
2282OnlyTypeArguments ::= '<' TypeArgumentList1
2283/.$putCase consumeOnlyTypeArguments(); $break ./
2284/:$readableName TypeArguments:/
2285/:$compliance 1.5:/
2286
2287TypeArgumentList1 -> TypeArgument1
2288/:$compliance 1.5:/
2289TypeArgumentList1 ::= TypeArgumentList ',' TypeArgument1
2290/.$putCase consumeTypeArgumentList1(); $break ./
2291/:$readableName TypeArgumentList1:/
2292/:$compliance 1.5:/
2293
2294TypeArgumentList -> TypeArgument
2295/:$compliance 1.5:/
2296TypeArgumentList ::= TypeArgumentList ',' TypeArgument
2297/.$putCase consumeTypeArgumentList(); $break ./
2298/:$readableName TypeArgumentList:/
2299/:$compliance 1.5:/
2300
2301TypeArgument ::= ReferenceType
2302/.$putCase consumeTypeArgument(); $break ./
2303/:$compliance 1.5:/
2304TypeArgument -> Wildcard
2305/:$readableName TypeArgument:/
2306/:$compliance 1.5:/
2307
2308--{ObjectTeams: anchored types:
2309TypeArgument -> TypeAnchor
2310TypeArgument1 -> TypeAnchor '>'
2311TypeArgument2 -> TypeAnchor '>>'
2312
2313TypeAnchor ::= '@' Name
2314/.$putCase consumeTypeAnchor(false); $break ./
2315/:$readableName typeAnchor:/
2316
2317-- base is a keyword in this mode, so explicitly expect it:
2318TypeAnchor ::= '@' 'base'
2319/.$putCase consumeTypeAnchor(true); $break ./
2320/:$readableName typeAnchor:/
2321
2322-- also 'this' requires special treatment (skip because redundant):
2323TypeAnchor ::= '@' 'this'
2324/.$putCase skipThisAnchor(); $break ./
2325/:$readableName typeAnchor:/
2326
2327TypeAnchor ::= '@' Name '.' 'base'
2328/:$readableName typeAnchor:/
2329/.$putCase consumeQualifiedBaseTypeAnchor(); $break ./
2330
2331--SH}
2332
2333TypeArgument1 -> ReferenceType1
2334/:$compliance 1.5:/
2335TypeArgument1 -> Wildcard1
2336/:$readableName TypeArgument1:/
2337/:$compliance 1.5:/
2338
2339ReferenceType1 ::= ReferenceType '>'
2340/.$putCase consumeReferenceType1(); $break ./
2341/:$compliance 1.5:/
2342ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2
2343/.$putCase consumeTypeArgumentReferenceType1(); $break ./
2344/:$readableName ReferenceType1:/
2345/:$compliance 1.5:/
2346
2347TypeArgumentList2 -> TypeArgument2
2348/:$compliance 1.5:/
2349TypeArgumentList2 ::= TypeArgumentList ',' TypeArgument2
2350/.$putCase consumeTypeArgumentList2(); $break ./
2351/:$readableName TypeArgumentList2:/
2352/:$compliance 1.5:/
2353
2354TypeArgument2 -> ReferenceType2
2355/:$compliance 1.5:/
2356TypeArgument2 -> Wildcard2
2357/:$readableName TypeArgument2:/
2358/:$compliance 1.5:/
2359
2360ReferenceType2 ::= ReferenceType '>>'
2361/.$putCase consumeReferenceType2(); $break ./
2362/:$compliance 1.5:/
2363ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3
2364/.$putCase consumeTypeArgumentReferenceType2(); $break ./
2365/:$readableName ReferenceType2:/
2366/:$compliance 1.5:/
2367
2368TypeArgumentList3 -> TypeArgument3
2369TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3
2370/.$putCase consumeTypeArgumentList3(); $break ./
2371/:$readableName TypeArgumentList3:/
2372/:$compliance 1.5:/
2373
2374TypeArgument3 -> ReferenceType3
2375TypeArgument3 -> Wildcard3
2376/:$readableName TypeArgument3:/
2377/:$compliance 1.5:/
2378
2379ReferenceType3 ::= ReferenceType '>>>'
2380/.$putCase consumeReferenceType3(); $break ./
2381/:$readableName ReferenceType3:/
2382/:$compliance 1.5:/
2383
2384Wildcard ::= '?'
2385/.$putCase consumeWildcard(); $break ./
2386/:$compliance 1.5:/
2387Wildcard ::= '?' WildcardBounds
2388/.$putCase consumeWildcardWithBounds(); $break ./
2389/:$readableName Wildcard:/
2390/:$compliance 1.5:/
2391
2392WildcardBounds ::= 'extends' ReferenceType
2393/.$putCase consumeWildcardBoundsExtends(); $break ./
2394/:$compliance 1.5:/
2395WildcardBounds ::= 'super' ReferenceType
2396/.$putCase consumeWildcardBoundsSuper(); $break ./
2397/:$readableName WildcardBounds:/
2398/:$compliance 1.5:/
2399
2400Wildcard1 ::= '?' '>'
2401/.$putCase consumeWildcard1(); $break ./
2402/:$compliance 1.5:/
2403Wildcard1 ::= '?' WildcardBounds1
2404/.$putCase consumeWildcard1WithBounds(); $break ./
2405/:$readableName Wildcard1:/
2406/:$compliance 1.5:/
2407
2408WildcardBounds1 ::= 'extends' ReferenceType1
2409/.$putCase consumeWildcardBounds1Extends(); $break ./
2410/:$compliance 1.5:/
2411WildcardBounds1 ::= 'super' ReferenceType1
2412/.$putCase consumeWildcardBounds1Super(); $break ./
2413/:$readableName WildcardBounds1:/
2414/:$compliance 1.5:/
2415
2416Wildcard2 ::= '?' '>>'
2417/.$putCase consumeWildcard2(); $break ./
2418/:$compliance 1.5:/
2419Wildcard2 ::= '?' WildcardBounds2
2420/.$putCase consumeWildcard2WithBounds(); $break ./
2421/:$readableName Wildcard2:/
2422/:$compliance 1.5:/
2423
2424WildcardBounds2 ::= 'extends' ReferenceType2
2425/.$putCase consumeWildcardBounds2Extends(); $break ./
2426/:$compliance 1.5:/
2427WildcardBounds2 ::= 'super' ReferenceType2
2428/.$putCase consumeWildcardBounds2Super(); $break ./
2429/:$readableName WildcardBounds2:/
2430/:$compliance 1.5:/
2431
2432Wildcard3 ::= '?' '>>>'
2433/.$putCase consumeWildcard3(); $break ./
2434/:$compliance 1.5:/
2435Wildcard3 ::= '?' WildcardBounds3
2436/.$putCase consumeWildcard3WithBounds(); $break ./
2437/:$readableName Wildcard3:/
2438/:$compliance 1.5:/
2439
2440WildcardBounds3 ::= 'extends' ReferenceType3
2441/.$putCase consumeWildcardBounds3Extends(); $break ./
2442/:$compliance 1.5:/
2443WildcardBounds3 ::= 'super' ReferenceType3
2444/.$putCase consumeWildcardBounds3Super(); $break ./
2445/:$readableName WildcardBound3:/
2446/:$compliance 1.5:/
2447
2448TypeParameterHeader ::= Identifier
2449/.$putCase consumeTypeParameterHeader(); $break ./
2450/:$readableName TypeParameter:/
2451/:$compliance 1.5:/
2452
2453TypeParameters ::= '<' TypeParameterList1
2454/.$putCase consumeTypeParameters(); $break ./
2455/:$readableName TypeParameters:/
2456/:$compliance 1.5:/
2457
2458TypeParameterList -> TypeParameter
2459/:$compliance 1.5:/
2460TypeParameterList ::= TypeParameterList ',' TypeParameter
2461/.$putCase consumeTypeParameterList(); $break ./
2462/:$readableName TypeParameterList:/
2463/:$compliance 1.5:/
2464
2465TypeParameter -> TypeParameterHeader
2466/:$compliance 1.5:/
2467TypeParameter ::= TypeParameterHeader 'extends' ReferenceType
2468/.$putCase consumeTypeParameterWithExtends(); $break ./
2469/:$compliance 1.5:/
2470TypeParameter ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList
2471/.$putCase consumeTypeParameterWithExtendsAndBounds(); $break ./
2472/:$readableName TypeParameter:/
2473/:$compliance 1.5:/
2474
2475--{ObjectTeams:
2476-- <B base R>
2477TypeParameter ::= TypeParameterHeader 'base' ReferenceType
2478/.$putCase consumeTypeParameterWithBase(); $break ./
2479/:$compliance 1.5:/
2480
2481-- <... Team t ...>
2482TypeParameter -> TypeValueParameter
2483TypeParameter1 -> TypeValueParameter1
2484
2485TypeValueParameter1 -> TypeValueParameter '>'
2486
2487TypeValueParameter ::= TypeParameterHeader Identifier
2488/.$putCase consumeTypeValueParameter(); $break ./
2489/:$compliance 1.5:/
2490/:$readableName TypeValueParameter:/
2491
2492TypeParameter -> AnchoredTypeParameterHeader0 '>' TypeBoundOpt
2493TypeParameter1 -> AnchoredTypeParameterHeader0 '>' TypeBoundOpt1
2494TypeParameter1 -> AnchoredTypeParameterHeader0 '>>'
2495
2496TypeBoundOpt -> $empty
2497TypeBoundOpt ::= 'extends' ReferenceType
2498/.$putCase consumeBoundsOfAnchoredTypeParameter(); $break ./
2499/:$compliance 1.5:/
2500/:$readableName TypeParameterBound:/
2501
2502TypeBoundOpt1 -> '>'
2503TypeBoundOpt1 ::= 'extends' ReferenceType1
2504/.$putCase consumeBoundsOfAnchoredTypeParameter(); $break ./
2505/:$compliance 1.5:/
2506/:$readableName TypeParameterBound:/
2507
2508AnchoredTypeParameterHeader0 ::= TypeParameterHeader '<' TypeAnchor
2509/.$putCase consumeAnchoredTypeParameter(); $break ./
2510/:$compliance 1.5:/
2511/:$readableName AnchoredTypeParameter:/
2512-- SH}
2513
2514AdditionalBoundList -> AdditionalBound
2515/:$compliance 1.5:/
2516AdditionalBoundList ::= AdditionalBoundList AdditionalBound
2517/.$putCase consumeAdditionalBoundList(); $break ./
2518/:$readableName AdditionalBoundList:/
2519
2520AdditionalBound ::= '&' ReferenceType
2521/.$putCase consumeAdditionalBound(); $break ./
2522/:$readableName AdditionalBound:/
2523/:$compliance 1.5:/
2524
2525TypeParameterList1 -> TypeParameter1
2526/:$compliance 1.5:/
2527TypeParameterList1 ::= TypeParameterList ',' TypeParameter1
2528/.$putCase consumeTypeParameterList1(); $break ./
2529/:$readableName TypeParameterList1:/
2530/:$compliance 1.5:/
2531
2532TypeParameter1 ::= TypeParameterHeader '>'
2533/.$putCase consumeTypeParameter1(); $break ./
2534/:$compliance 1.5:/
2535TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType1
2536/.$putCase consumeTypeParameter1WithExtends(); $break ./
2537/:$compliance 1.5:/
2538
2539--{ObjectTeams: <B base R>
2540TypeParameter1 ::= TypeParameterHeader 'base' ReferenceType1
2541/.$putCase consumeTypeParameter1WithBase(); $break ./
2542/:$compliance 1.5:/
2543-- SH}
2544
2545TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList1
2546/.$putCase consumeTypeParameter1WithExtendsAndBounds(); $break ./
2547/:$readableName TypeParameter1:/
2548/:$compliance 1.5:/
2549
2550AdditionalBoundList1 -> AdditionalBound1
2551/:$compliance 1.5:/
2552AdditionalBoundList1 ::= AdditionalBoundList AdditionalBound1
2553/.$putCase consumeAdditionalBoundList1(); $break ./
2554/:$readableName AdditionalBoundList1:/
2555/:$compliance 1.5:/
2556
2557AdditionalBound1 ::= '&' ReferenceType1
2558/.$putCase consumeAdditionalBound1(); $break ./
2559/:$readableName AdditionalBound1:/
2560/:$compliance 1.5:/
2561
2562-------------------------------------------------
2563-- Duplicate rules to remove ambiguity for (x) --
2564-------------------------------------------------
2565PostfixExpression_NotName -> Primary
2566PostfixExpression_NotName -> PostIncrementExpression
2567PostfixExpression_NotName -> PostDecrementExpression
2568/:$readableName Expression:/
2569
2570UnaryExpression_NotName -> PreIncrementExpression
2571UnaryExpression_NotName -> PreDecrementExpression
2572UnaryExpression_NotName ::= '+' PushPosition UnaryExpression
2573/.$putCase consumeUnaryExpression(OperatorIds.PLUS); $break ./
2574UnaryExpression_NotName ::= '-' PushPosition UnaryExpression
2575/.$putCase consumeUnaryExpression(OperatorIds.MINUS); $break ./
2576UnaryExpression_NotName -> UnaryExpressionNotPlusMinus_NotName
2577/:$readableName Expression:/
2578
2579UnaryExpressionNotPlusMinus_NotName -> PostfixExpression_NotName
2580UnaryExpressionNotPlusMinus_NotName ::= '~' PushPosition UnaryExpression
2581/.$putCase consumeUnaryExpression(OperatorIds.TWIDDLE); $break ./
2582UnaryExpressionNotPlusMinus_NotName ::= '!' PushPosition UnaryExpression
2583/.$putCase consumeUnaryExpression(OperatorIds.NOT); $break ./
2584UnaryExpressionNotPlusMinus_NotName -> CastExpression
2585/:$readableName Expression:/
2586
2587MultiplicativeExpression_NotName -> UnaryExpression_NotName
2588MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '*' UnaryExpression
2589/.$putCase consumeBinaryExpression(OperatorIds.MULTIPLY); $break ./
2590MultiplicativeExpression_NotName ::= Name '*' UnaryExpression
2591/.$putCase consumeBinaryExpressionWithName(OperatorIds.MULTIPLY); $break ./
2592MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '/' UnaryExpression
2593/.$putCase consumeBinaryExpression(OperatorIds.DIVIDE); $break ./
2594MultiplicativeExpression_NotName ::= Name '/' UnaryExpression
2595/.$putCase consumeBinaryExpressionWithName(OperatorIds.DIVIDE); $break ./
2596MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '%' UnaryExpression
2597/.$putCase consumeBinaryExpression(OperatorIds.REMAINDER); $break ./
2598MultiplicativeExpression_NotName ::= Name '%' UnaryExpression
2599/.$putCase consumeBinaryExpressionWithName(OperatorIds.REMAINDER); $break ./
2600/:$readableName Expression:/
2601
2602AdditiveExpression_NotName -> MultiplicativeExpression_NotName
2603AdditiveExpression_NotName ::= AdditiveExpression_NotName '+' MultiplicativeExpression
2604/.$putCase consumeBinaryExpression(OperatorIds.PLUS); $break ./
2605AdditiveExpression_NotName ::= Name '+' MultiplicativeExpression
2606/.$putCase consumeBinaryExpressionWithName(OperatorIds.PLUS); $break ./
2607AdditiveExpression_NotName ::= AdditiveExpression_NotName '-' MultiplicativeExpression
2608/.$putCase consumeBinaryExpression(OperatorIds.MINUS); $break ./
2609AdditiveExpression_NotName ::= Name '-' MultiplicativeExpression
2610/.$putCase consumeBinaryExpressionWithName(OperatorIds.MINUS); $break ./
2611/:$readableName Expression:/
2612
2613ShiftExpression_NotName -> AdditiveExpression_NotName
Stephan Herrmann44109d32011-08-02 14:34:26 +00002614ShiftExpression_NotName ::= ShiftExpression_NotName '<<' AdditiveExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002615/.$putCase consumeBinaryExpression(OperatorIds.LEFT_SHIFT); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00002616ShiftExpression_NotName ::= Name '<<' AdditiveExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002617/.$putCase consumeBinaryExpressionWithName(OperatorIds.LEFT_SHIFT); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00002618ShiftExpression_NotName ::= ShiftExpression_NotName '>>' AdditiveExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002619/.$putCase consumeBinaryExpression(OperatorIds.RIGHT_SHIFT); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00002620ShiftExpression_NotName ::= Name '>>' AdditiveExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002621/.$putCase consumeBinaryExpressionWithName(OperatorIds.RIGHT_SHIFT); $break ./
2622ShiftExpression_NotName ::= ShiftExpression_NotName '>>>' AdditiveExpression
2623/.$putCase consumeBinaryExpression(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
2624ShiftExpression_NotName ::= Name '>>>' AdditiveExpression
2625/.$putCase consumeBinaryExpressionWithName(OperatorIds.UNSIGNED_RIGHT_SHIFT); $break ./
2626/:$readableName Expression:/
2627
2628RelationalExpression_NotName -> ShiftExpression_NotName
Stephan Herrmann44109d32011-08-02 14:34:26 +00002629RelationalExpression_NotName ::= ShiftExpression_NotName '<' ShiftExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002630/.$putCase consumeBinaryExpression(OperatorIds.LESS); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00002631RelationalExpression_NotName ::= Name '<' ShiftExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002632/.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00002633RelationalExpression_NotName ::= ShiftExpression_NotName '>' ShiftExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002634/.$putCase consumeBinaryExpression(OperatorIds.GREATER); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00002635RelationalExpression_NotName ::= Name '>' ShiftExpression
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002636/.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER); $break ./
2637RelationalExpression_NotName ::= RelationalExpression_NotName '<=' ShiftExpression
2638/.$putCase consumeBinaryExpression(OperatorIds.LESS_EQUAL); $break ./
2639RelationalExpression_NotName ::= Name '<=' ShiftExpression
2640/.$putCase consumeBinaryExpressionWithName(OperatorIds.LESS_EQUAL); $break ./
2641RelationalExpression_NotName ::= RelationalExpression_NotName '>=' ShiftExpression
2642/.$putCase consumeBinaryExpression(OperatorIds.GREATER_EQUAL); $break ./
2643RelationalExpression_NotName ::= Name '>=' ShiftExpression
2644/.$putCase consumeBinaryExpressionWithName(OperatorIds.GREATER_EQUAL); $break ./
2645/:$readableName Expression:/
2646
2647InstanceofExpression_NotName -> RelationalExpression_NotName
2648InstanceofExpression_NotName ::= Name 'instanceof' ReferenceType
2649/.$putCase consumeInstanceOfExpressionWithName(); $break ./
Stephan Herrmann44109d32011-08-02 14:34:26 +00002650InstanceofExpression_NotName ::= InstanceofExpression_NotName 'instanceof' ReferenceType
Stephan Herrmann234bfec2011-04-26 08:26:58 +00002651/.$putCase consumeInstanceOfExpression(); $break ./
2652/:$readableName Expression:/
2653
2654EqualityExpression_NotName -> InstanceofExpression_NotName
2655EqualityExpression_NotName ::= EqualityExpression_NotName '==' InstanceofExpression
2656/.$putCase consumeEqualityExpression(OperatorIds.EQUAL_EQUAL); $break ./
2657EqualityExpression_NotName ::= Name '==' InstanceofExpression
2658/.$putCase consumeEqualityExpressionWithName(OperatorIds.EQUAL_EQUAL); $break ./
2659EqualityExpression_NotName ::= EqualityExpression_NotName '!=' InstanceofExpression
2660/.$putCase consumeEqualityExpression(OperatorIds.NOT_EQUAL); $break ./
2661EqualityExpression_NotName ::= Name '!=' InstanceofExpression
2662/.$putCase consumeEqualityExpressionWithName(OperatorIds.NOT_EQUAL); $break ./
2663/:$readableName Expression:/
2664
2665AndExpression_NotName -> EqualityExpression_NotName
2666AndExpression_NotName ::= AndExpression_NotName '&' EqualityExpression
2667/.$putCase consumeBinaryExpression(</