public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1136: weak error message when expecting final modifier
@ 2000-12-20 12:09 joerg.brunsmann
  0 siblings, 0 replies; only message in thread
From: joerg.brunsmann @ 2000-12-20 12:09 UTC (permalink / raw)
  To: java-gnats

>Number:         1136
>Category:       java
>Synopsis:       weak error message when expecting final modifier
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:06:28 PST 2000
>Closed-Date:    Mon Jan 17 14:57:46 PST 2000
>Last-Modified:  Mon Jan 17 15:00:01 PST 2000
>Originator:     joerg.brunsmann@fernuni-hagen.de
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
With the attached patch gcj spits out a 
reasonable error message when parsing this:

public class X {
  void f(public String s) {
  }
}

The patch adds a new rule named 'final' which
accepts only the literal "final" as a valid 
modifier. The rule 'final' might also help the 
rule for 'local_variable_declaration' and hence the
implementation of function declare_local_variables()
>How-To-Repeat:

>Fix:
--- parse.y.orig	Mon Dec 13 06:55:27 1999
+++ parse.y	Tue Jan  4 19:35:50 2000
@@ -946,17 +946,28 @@ 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);
 		}
 ;

 

>Release-Note:

>Audit-Trail:

Formerly PR gcj/128

State-Changed-From-To: open->closed
State-Changed-By: apbianco
State-Changed-When: Mon Jan 17 14:57:46 2000
State-Changed-Why:
    Joern's patch has been checked in:
    
      http://gcc.gnu.org/ml/gcc-patches/2000-01/msg00621.html

From: apbianco@cygnus.com
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com,
  joerg.brunsmann@fernuni-hagen.de
Cc:  
Subject: Re: gcj/128
Date: 17 Jan 2000 22:57:46 -0000

 Synopsis: weak error message when expecting final modifier
 
 State-Changed-From-To: open->closed
 State-Changed-By: apbianco
 State-Changed-When: Mon Jan 17 14:57:46 2000
 State-Changed-Why:
     Joern's patch has been checked in:
     
       http://gcc.gnu.org/ml/gcc-patches/2000-01/msg00621.html
 
 http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=128&database=java
>Unformatted:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:09 java/1136: weak error message when expecting final modifier joerg.brunsmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).