@@ -60,7 +60,7 @@ import java.util.Stack;
60
60
%type <annoval> Expression Literal Annotation ElementValue ElementValueArrayInitializer
61
61
%type <annoval> ConditionalExpression ConditionalOrExpression ConditionalAndExpression InclusiveOrExpression ExclusiveOrExpression AndExpression
62
62
%type <annoval> EqualityExpression RelationalExpression ShiftExpression AdditiveExpression MultiplicativeExpression
63
- %type <annoval> UnaryExpression UnaryExpressionNotPlusMinus PreIncrementExpression PreDecrementExpression Primary PrimaryNoNewArray ArrayCreationExpression MethodInvocation MethodReference ClassInstanceCreationExpression
63
+ %type <annoval> UnaryExpression UnaryExpressionNotPlusMinus PreIncrementExpression PreDecrementExpression Primary PrimaryNoNewArray ArrayCreationExpression MethodInvocation MethodReference ClassInstanceCreationExpression UnqualifiedClassInstanceCreationExpression
64
64
%type <annoval> PostfixExpression PostIncrementExpression PostDecrementExpression CastExpression Assignment LeftHandSide AssignmentExpression
65
65
%type <ival> Dims Dims_opt
66
66
%type <sval> QualifiedIdentifier TypeDeclSpecifier MethodBody AssignmentOperator ModuleName
@@ -1013,24 +1013,31 @@ PrimaryNoNewArray: Literal
1013
1013
;
1014
1014
1015
1015
// ClassInstanceCreationExpression:
1016
- // new [TypeArguments] {Annotation} Identifier [TypeArgumentsOrDiamond] ( [ArgumentList] ) [ClassBody]
1017
- // ExpressionName . new [TypeArguments] {Annotation} Identifier [TypeArgumentsOrDiamond] ( [ArgumentList] ) [ClassBody]
1018
- // Primary . new [TypeArguments] {Annotation} Identifier [TypeArgumentsOrDiamond] ( [ArgumentList] ) [ClassBody]
1019
- //// TypeArguments_opt confuses parser
1020
- ClassInstanceCreationExpression : NEW TypeArguments IDENTIFIER TypeArgumentsOrDiamond_opt PARENOPEN ArgumentList_opt PARENCLOSE CODEBLOCK_opt
1021
- {
1022
- CreatorDef creator = new CreatorDef();
1023
- creator.setCreatedName( $3 );
1024
- $$ = creator;
1025
- }
1026
- | NEW IDENTIFIER TypeArgumentsOrDiamond_opt PARENOPEN ArgumentList_opt PARENCLOSE CODEBLOCK_opt
1027
- {
1028
- CreatorDef creator = new CreatorDef();
1029
- creator.setCreatedName( $2 );
1030
- $$ = creator;
1031
- }
1016
+ // UnqualifiedClassInstanceCreationExpression
1017
+ // ExpressionName . UnqualifiedClassInstanceCreationExpression
1018
+ // Primary . UnqualifiedClassInstanceCreationExpression
1019
+ ClassInstanceCreationExpression : UnqualifiedClassInstanceCreationExpression
1020
+ | ExpressionName DOT UnqualifiedClassInstanceCreationExpression
1021
+ | Primary DOT UnqualifiedClassInstanceCreationExpression
1032
1022
;
1033
1023
1024
+ // UnqualifiedClassInstanceCreationExpression:
1025
+ // new [TypeArguments] ClassOrInterfaceTypeToInstantiate ( [ArgumentList] ) [ClassBody]
1026
+ //// TypeArguments_opt confuses parser
1027
+ UnqualifiedClassInstanceCreationExpression : NEW TypeArguments IDENTIFIER TypeArgumentsOrDiamond_opt PARENOPEN ArgumentList_opt PARENCLOSE CODEBLOCK_opt
1028
+ {
1029
+ CreatorDef creator = new CreatorDef();
1030
+ creator.setCreatedName( $3 );
1031
+ $$ = creator;
1032
+ }
1033
+ | NEW IDENTIFIER TypeArgumentsOrDiamond_opt PARENOPEN ArgumentList_opt PARENCLOSE CODEBLOCK_opt
1034
+ {
1035
+ CreatorDef creator = new CreatorDef();
1036
+ creator.setCreatedName( $2 );
1037
+ $$ = creator;
1038
+ }
1039
+ ;
1040
+
1034
1041
CODEBLOCK_opt :
1035
1042
| CODEBLOCK
1036
1043
;
0 commit comments