Title: [1077] trunk/qdox/src/grammar/parser.y: Use InterfaceType according to JLS
Revision
1077
Author
rfscholte
Date
2011-02-24 15:51:03 -0600 (Thu, 24 Feb 2011)

Log Message

Use InterfaceType according to JLS

Modified Paths


Diff

Modified: trunk/qdox/src/grammar/parser.y (1076 => 1077)

--- trunk/qdox/src/grammar/parser.y	2011-02-23 20:41:59 UTC (rev 1076)
+++ trunk/qdox/src/grammar/parser.y	2011-02-24 21:51:03 UTC (rev 1077)
@@ -56,7 +56,8 @@
 %token <ival> PLUS MINUS STAR SLASH PERCENT TILDE EXCLAMATION
 %type <sval> name
 %type <type> PrimitiveType NumericType IntegralType FloatingPointType
-%type <type> Wildcard WildcardBoundsOpt
+%type <type> InterfaceType
+%type <type> Wildcard
 %type <annoval> value _expression_ literal annotation arrayInitializer
 %type <annoval> conditionalExpression conditionalOrExpression conditionalAndExpression inclusiveOrExpression exclusiveOrExpression andExpression
 %type <annoval> equalityExpression relationalExpression shiftExpression additiveExpression multiplicativeExpression
@@ -406,14 +407,12 @@
     type |
     Wildcard;
 
-Wildcard:
-	QUERY { $$ = new WildcardTypeDef();} |
-	QUERY WildcardBoundsOpt { $$ = $2;};
-	
-WildcardBoundsOpt:
-    EXTENDS type { $$ = new WildcardTypeDef($2, "extends");} |
-    SUPER type   { $$ = new WildcardTypeDef($2, "super");} ;
+// 4.5.1 Type Arguments and Wildcards
 
+Wildcard: QUERY              { $$ = new WildcardTypeDef(); } 
+        | QUERY EXTENDS type { $$ = new WildcardTypeDef($3, "extends" ); }
+        | QUERY SUPER type   { $$ = new WildcardTypeDef($3, "super" ); } ;
+
 opt_typeparams: | typeparams;
 
 typeparams: LESSTHAN { typeParams = new LinkedList(); } typeparamlist GREATERTHAN;
@@ -456,7 +455,6 @@
         };
 
 ClassModifiers_opt: modifiers;
-Interfaces_opt: opt_implements;
 
 enum_body: enum_values | enum_values SEMI members;
 
@@ -481,7 +479,7 @@
     };
 
 classdefinition: 
-    modifiers classorinterface IDENTIFIER opt_typeparams opt_extends opt_implements {
+    modifiers classorinterface IDENTIFIER opt_typeparams opt_extends Interfaces_opt  {
         cls.lineNumber = line;
         cls.modifiers.addAll(modifiers); modifiers.clear(); 
         cls.name = $3;
@@ -501,12 +499,17 @@
     classtype { cls.extendz.add($1); } |
     extendslist COMMA classtype { cls.extendz.add($3); };
 
-opt_implements: | IMPLEMENTS implementslist;
+// 8.1.5 Superinterfaces
+Interfaces_opt:
+              | Interfaces;
+              
+Interfaces:	IMPLEMENTS InterfaceTypeList;
 
-implementslist: 
-    classtype { cls.implementz.add($1); } | 
-    implementslist COMMA classtype { cls.implementz.add($3); };
+InterfaceTypeList: InterfaceType { cls.implementz.add($1); }
+                 | InterfaceTypeList COMMA InterfaceType { cls.implementz.add($3); };
 
+InterfaceType: classtype;
+
 members: | members { line = lexer.getLine(); } member;
 
 member:


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to