diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 1999-11-02 07:51:19 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 1999-11-01 23:51:19 -0800 |
commit | efa0a23fc23fd8e5d57a300731b166a872b2ce5f (patch) | |
tree | b36be1a3393afac591caa6f9f677f1e3d12b1dc8 /gcc/java/parse.y | |
parent | b78121f657b9b19cf3c6f3f085451825eb8edc8e (diff) | |
download | gcc-efa0a23fc23fd8e5d57a300731b166a872b2ce5f.zip gcc-efa0a23fc23fd8e5d57a300731b166a872b2ce5f.tar.gz gcc-efa0a23fc23fd8e5d57a300731b166a872b2ce5f.tar.bz2 |
parse.y (method_header:): Issue error message for rule `type error'.
Mon Nov 1 23:42:00 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (method_header:): Issue error message for rule `type
error'.
(synchronized:): Error report when not using synchronized.
From-SVN: r30343
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index aa53706..ebdaa7b 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -890,7 +890,10 @@ method_header: | modifiers VOID_TK method_declarator throws { $$ = method_header ($1, void_type_node, $3, $4); } | type error - {RECOVER;} + { + yyerror ("Invalid method declaration, method name required"); + RECOVER; + } | modifiers type error {RECOVER;} | VOID_TK error @@ -1669,10 +1672,14 @@ synchronized_statement: ; synchronized: - MODIFIER_TK + modifiers { - if ((1 << $1) != ACC_SYNCHRONIZED) - fatal ("synchronized was '%d' - yyparse", (1 << $1)); + check_modifiers ("Illegal modifier `%s'. Only " + "`synchronized' was expected here", + $1, ACC_SYNCHRONIZED); + if ($1 != ACC_SYNCHRONIZED) + MODIFIER_WFL (SYNCHRONIZED_TK) = + build_wfl_node (NULL_TREE); } ; |