Title: [1127] trunk/qdox/src/grammar/parser.y: Using JLS terms for ActualTypeArgumentList and ActualTypeArgument
Revision
1127
Author
rfscholte
Date
2011-03-21 17:16:27 -0500 (Mon, 21 Mar 2011)

Log Message

Using JLS terms for ActualTypeArgumentList and ActualTypeArgument

Modified Paths


Diff

Modified: trunk/qdox/src/grammar/parser.y (1126 => 1127)

--- trunk/qdox/src/grammar/parser.y	2011-03-21 21:50:42 UTC (rev 1126)
+++ trunk/qdox/src/grammar/parser.y	2011-03-21 22:16:27 UTC (rev 1127)
@@ -63,7 +63,7 @@
 %type <annoval> PostfixExpression CastExpression
 %type <ival> dims Dims_opt
 %type <sval> fullidentifier typedeclspecifier typename memberend
-%type <type> Type ReferenceType VariableDeclaratorId classtype typearg
+%type <type> Type ReferenceType VariableDeclaratorId classtype ActualTypeArgument
 
 %%
 // Source: Java Language Specification - Third Edition
@@ -359,19 +359,24 @@
                  $$ = td;
                };
 
-classtype:
-    typedeclspecifier LESSTHAN {
-    		TypeDef td = new TypeDef($1,0);
-    		td.actualArgumentTypes = new LinkedList();
-    		$$ = typeStack.push(td);
-    	} typearglist { 
-    		$$ = typeStack.pop();
-    	} GREATERTHAN {
-         $$ = $5;
-    } |
-    typedeclspecifier {
-        $$ = new TypeDef($1,0); 
-    };
+classtype: typedeclspecifier LESSTHAN 
+           {
+    		 TypeDef td = new TypeDef($1,0);
+    		 td.actualArgumentTypes = new LinkedList();
+    		 $$ = typeStack.push(td);
+    	   } 
+    	   ActualTypeArgumentList 
+    	   { 
+    		 $$ = typeStack.pop();
+    	   }
+    	   GREATERTHAN 
+    	   {
+             $$ = $5;
+           } 
+         | typedeclspecifier 
+           {
+             $$ = new TypeDef($1,0); 
+           };
 
 typedeclspecifier:
     typename |
@@ -381,13 +386,17 @@
     IDENTIFIER |
     typename DOT IDENTIFIER { $$ = $1 + '.' + $3; }; 
 
-typearglist:
-    typearg { (typeStack.peek()).actualArgumentTypes.add($1);}|
-    typearglist COMMA typearg { (typeStack.peek()).actualArgumentTypes.add($3);};
+ActualTypeArgumentList: ActualTypeArgument 
+                        { 
+                          (typeStack.peek()).actualArgumentTypes.add($1);
+                        }
+                      | ActualTypeArgumentList COMMA ActualTypeArgument 
+                        { 
+                          (typeStack.peek()).actualArgumentTypes.add($3);
+                        };
 
-typearg:
-    ReferenceType |
-    Wildcard;
+ActualTypeArgument: ReferenceType 
+                  | Wildcard;
 
 // 4.5.1 Type Arguments and Wildcards
 Wildcard: QUERY              


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to