- Revision
- 1104
- Author
- rfscholte
- Date
- 2011-03-05 07:26:06 -0600 (Sat, 05 Mar 2011)
Log Message
Use Method Throws according to JLS
Modified Paths
Diff
Modified: trunk/qdox/src/grammar/parser.y (1103 => 1104)
--- trunk/qdox/src/grammar/parser.y 2011-03-05 12:58:17 UTC (rev 1103) +++ trunk/qdox/src/grammar/parser.y 2011-03-05 13:26:06 UTC (rev 1104) @@ -601,7 +601,7 @@ mth.typeParams = typeParams; mth.returnType = $3; mth.name = $4; - } methoddef dimensions opt_exceptions memberend { + } methoddef dimensions Throws_opt memberend { mth.dimensions = $7; mth.body = $9; builder.endMethod(mth); @@ -613,7 +613,7 @@ mth.modifiers.addAll(modifiers); modifiers.clear(); mth.returnType = $2; mth.name = $3; - } methoddef dimensions opt_exceptions memberend { + } methoddef dimensions Throws_opt memberend { mth.dimensions = $6; mth.body = $8; builder.endMethod(mth); @@ -626,7 +626,7 @@ mth.lineNumber = lexer.getLine(); mth.modifiers.addAll(modifiers); modifiers.clear(); mth.constructor = true; mth.name = $2; - } methoddef opt_exceptions memberend { + } methoddef Throws_opt memberend { mth.body = $6; builder.endConstructor(mth); mth = new MethodDef(); @@ -637,7 +637,7 @@ mth.typeParams = typeParams; mth.modifiers.addAll(modifiers); modifiers.clear(); mth.constructor = true; mth.name = $3; - } methoddef opt_exceptions memberend { + } methoddef Throws_opt memberend { mth.body = $7; builder.endConstructor(mth); mth = new MethodDef(); @@ -645,11 +645,18 @@ methoddef: PARENOPEN opt_params PARENCLOSE; -opt_exceptions: | THROWS exceptionlist; +// 8.4.6 Method Throws +Throws_opt: + | THROWS ExceptionTypeList; -exceptionlist: - classtype { mth.exceptions.add($1); } | - exceptionlist COMMA classtype { mth.exceptions.add($3); }; +ExceptionTypeList: classtype /*ExceptionType*/ + { + mth.exceptions.add($1); + } + | ExceptionTypeList COMMA classtype /*ExceptionType*/ + { + mth.exceptions.add($3); + }; opt_params: | paramlist;
To unsubscribe from this list please visit:
