- Revision
- 1103
- Author
- rfscholte
- Date
- 2011-03-05 06:58:17 -0600 (Sat, 05 Mar 2011)
Log Message
Use TypeParameters according to JLS
Modified Paths
Diff
Modified: trunk/qdox/src/grammar/parser.y (1102 => 1103)
--- trunk/qdox/src/grammar/parser.y 2011-03-04 23:15:28 UTC (rev 1102) +++ trunk/qdox/src/grammar/parser.y 2011-03-05 12:58:17 UTC (rev 1103) @@ -414,13 +414,18 @@ | QUERY EXTENDS type { $$ = new WildcardTypeDef($3, "extends" ); } | QUERY SUPER type { $$ = new WildcardTypeDef($3, "super" ); } ; -opt_typeparams: | typeparams; +// 8.1.2 Generic Classes and Type Parameters +TypeParameters_opt: + | TypeParameters; -typeparams: LESSTHAN { typeParams = new LinkedList(); } typeparamlist GREATERTHAN; +TypeParameters: LESSTHAN + { + typeParams = new LinkedList(); + } + TypeParameterList GREATERTHAN; -typeparamlist: - TypeParameter | - typeparamlist COMMA TypeParameter; +TypeParameterList: TypeParameter + | TypeParameterList COMMA TypeParameter; // 4.4 Type Variables TypeParameter: IDENTIFIER @@ -492,7 +497,7 @@ // ----- CLASS class: - modifiers classorinterface IDENTIFIER opt_typeparams opt_extends Interfaces_opt { + modifiers classorinterface IDENTIFIER TypeParameters_opt opt_extends Interfaces_opt { cls.lineNumber = line; cls.modifiers.addAll(modifiers); modifiers.clear(); cls.name = $3; @@ -589,7 +594,7 @@ // ----- METHOD method: - modifiers typeparams type IDENTIFIER { + modifiers TypeParameters type IDENTIFIER { builder.beginMethod(); mth.lineNumber = lexer.getLine(); mth.modifiers.addAll(modifiers); modifiers.clear(); @@ -626,7 +631,7 @@ builder.endConstructor(mth); mth = new MethodDef(); } | - modifiers typeparams IDENTIFIER { + modifiers TypeParameters IDENTIFIER { builder.beginConstructor(); mth.lineNumber = lexer.getLine(); mth.typeParams = typeParams;
To unsubscribe from this list please visit:
