Commit 18990de5 by Joerg Brunsmann Committed by Alexandre Petit-Bianco

re GNATS gcj/128 (weak error message when expecting final modifier)

Mon Jan 17 11:58:17 2000  Joerg Brunsmann  <joerg.brunsmann@fernuni-hagen.de>

        * parse.y (format_parameter:): Use final: rule instead of modifiers:.
        (final:): New rule.

Joerg Brunsmann's contribution to fix the Java PR #128.

From-SVN: r31477
parent a68ad5bd
Mon Jan 17 11:58:17 2000 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
* parse.y (format_parameter:): Use final: rule instead of modifiers:.
(final:): New rule.
2000-01-17 Tom Tromey <tromey@cygnus.com>
* gjavah.c (print_field_info): Allow non-static final fields.
......
......@@ -950,20 +950,29 @@ formal_parameter:
{
$$ = build_tree_list ($2, $1);
}
| modifiers type variable_declarator_id /* Added, JDK1.1 final parms */
| final type variable_declarator_id /* Added, JDK1.1 final parms */
{
parse_jdk1_1_error ("final parameters");
$$ = build_tree_list ($3, $2);
}
| type error
{yyerror ("Missing identifier"); RECOVER;}
| modifiers type error
| final type error
{
SOURCE_FRONTEND_DEBUG (("Modifiers: %d", $1));
yyerror ("Missing identifier"); RECOVER;
}
;
final:
modifiers
{
check_modifiers ("Illegal modifier `%s'. Only `final' was expected here",
$1, ACC_FINAL);
if ($1 != ACC_FINAL)
MODIFIER_WFL (FINAL_TK) = build_wfl_node (NULL_TREE);
}
;
throws:
{ $$ = NULL_TREE; }
| THROWS_TK class_type_list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment