Title: [1066] trunk/qdox/src/grammar/parser.y: Add PostfixExpression and CastExpression to get rid of shift/reduce conflict
Revision
1066
Author
rfscholte
Date
2011-02-21 14:47:52 -0600 (Mon, 21 Feb 2011)

Log Message

Add PostfixExpression and CastExpression to get rid of shift/reduce conflict

Modified Paths

Diff

Modified: trunk/qdox/src/grammar/parser.y (1065 => 1066)

--- trunk/qdox/src/grammar/parser.y	2011-02-21 15:44:48 UTC (rev 1065)
+++ trunk/qdox/src/grammar/parser.y	2011-02-21 20:47:52 UTC (rev 1066)
@@ -62,6 +62,7 @@
 %type <annoval> conditionalExpression conditionalOrExpression conditionalAndExpression inclusiveOrExpression exclusiveOrExpression andExpression
 %type <annoval> equalityExpression relationalExpression shiftExpression additiveExpression multiplicativeExpression
 %type <annoval> unaryExpression unaryExpressionNotPlusMinus primary
+%type <annoval> PostfixExpression CastExpression
 %type <ival> dims Dims_opt
 %type <sval> fullidentifier typedeclspecifier typename memberend
 %type <ival> dimensions
@@ -275,17 +276,20 @@
     MINUS unaryExpression { $$ = new AnnotationMinusSign($2); } |
 	unaryExpressionNotPlusMinus;
 
-unaryExpressionNotPlusMinus:
-	TILDE unaryExpression { $$ = new AnnotationNot($2); } |
-	EXCLAMATION unaryExpression { $$ = new AnnotationLogicalNot($2); } |
-	primary;
+unaryExpressionNotPlusMinus: PostfixExpression 
+                           | TILDE unaryExpression { $$ = new AnnotationNot($2); } 
+                           | EXCLAMATION unaryExpression { $$ = new AnnotationLogicalNot($2); } 
+                           | CastExpression;
+	
+CastExpression: PARENOPEN PrimitiveType Dims_opt PARENCLOSE unaryExpression { $$ = new AnnotationCast(builder.createType($2.name, $3), $5); } 
+              | PARENOPEN name PARENCLOSE unaryExpressionNotPlusMinus { $$ = new AnnotationCast(builder.createType($2, 0), $4); }
+              | PARENOPEN name dims PARENCLOSE unaryExpressionNotPlusMinus { $$ = new AnnotationCast(builder.createType($2, $3), $5); };
+
+PostfixExpression: primary;
     	
 primary:
-	PARENOPEN PrimitiveType Dims_opt PARENCLOSE unaryExpression { $$ = new AnnotationCast(builder.createType($2.name, $3), $5); } |
-    PARENOPEN name dims PARENCLOSE unaryExpressionNotPlusMinus { $$ = new AnnotationCast(builder.createType($2, $3), $5); } |
-	PARENOPEN name PARENCLOSE unaryExpressionNotPlusMinus { $$ = new AnnotationCast(builder.createType($2, 0), $4); } |
+    literal |
     PARENOPEN _expression_ PARENCLOSE { $$ = new AnnotationParenExpression($2); } |
-    literal |
     PrimitiveType Dims_opt DOT CLASS { $$ = new AnnotationTypeRef(builder.createType($1.name, 0)); } |
     name DOT CLASS { $$ = new AnnotationTypeRef(builder.createType($1, 0)); } |
     name dims DOT CLASS { $$ = new AnnotationTypeRef(builder.createType($1, 0)); } |


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to