I am working on some syntax tree synchronising tools and try to write a parser for a small subset of Java; I am confused about the Java 10 grammar specification and consider that the definition of FieldAccess
is wrong.
In my opinion, the grammar of FieldAccess
is something like obj.x
, in which obj
is an identifier (or something alike).
But it seems that the grammar for FieldAccess
cannot produce obj.x
FieldAccess:
Primary . Identifier
super . Identifier
TypeName . super . Identifier
because the definition of Primary
is
Primary:
PrimaryNoNewArray
ArrayCreationExpression
in which neither of the nonterminals can be Identifier
.
I believe the grammar for FieldAccess
should be
PostfixExpression . Identifier
,
where PostfixExpression
is the nonterminal ‘one layer higher than Primary
’:
PostfixExpression:
Primary
ExpressionName
PostIncrementExpression
PostDecrementExpression
So that ExpressionName
can eventually produce an identifier as desired
ExpressionName:
Identifier
AmbiguousName . Identifier
Can anyone give me some comments, or kindly tell me a proper place to report this issue?
I can only find a place for reporting bugs in implementations of the Java Platform, but hardly a place for reporting errors in the language specification.