- Revision
- 1102
- Author
- rfscholte
- Date
- 2011-03-04 17:15:28 -0600 (Fri, 04 Mar 2011)
Log Message
Using Type Variables according to JLS
Modified Paths
Diff
Modified: trunk/qdox/src/grammar/parser.y (1101 => 1102)
--- trunk/qdox/src/grammar/parser.y 2011-03-04 22:18:51 UTC (rev 1101) +++ trunk/qdox/src/grammar/parser.y 2011-03-04 23:15:28 UTC (rev 1102) @@ -419,23 +419,40 @@ typeparams: LESSTHAN { typeParams = new LinkedList(); } typeparamlist GREATERTHAN; typeparamlist: - typeparam | - typeparamlist COMMA typeparam; + TypeParameter | + typeparamlist COMMA TypeParameter; -typeparam: - IDENTIFIER { typeParams.add(new TypeVariableDef($1)); } | - IDENTIFIER EXTENDS { - typeVariable = new TypeVariableDef($1); - typeVariable.bounds = new LinkedList(); - } typeboundlist { - typeParams.add(typeVariable); - typeVariable = null; - }; +// 4.4 Type Variables +TypeParameter: IDENTIFIER + { + typeVariable = new TypeVariableDef($1); + typeVariable.bounds = new LinkedList(); + } + TypeBound_opt + { + typeParams.add(typeVariable); + typeVariable = null; + } + ; -typeboundlist: - type { typeVariable.bounds.add($1); } | - typeboundlist AMPERSAND type { typeVariable.bounds.add($3); }; +TypeBound_opt: + | TypeBound; +TypeBound: EXTENDS type + { + typeVariable.bounds = new LinkedList(); + typeVariable.bounds.add($2); + } + AdditionalBoundList_opt; + +AdditionalBoundList_opt: + | AdditionalBoundList_opt AdditionalBound; + +AdditionalBound: AMPERSAND type + { + typeVariable.bounds.add($2); + }; + // ----- ENUM // 8.9 Enums
To unsubscribe from this list please visit:
