public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: joerg.brunsmann@fernuni-hagen.de
To: java-gnats@sourceware.cygnus.com
Subject: java/1136: weak error message when expecting final modifier
Date: Wed, 20 Dec 2000 12:09:00 -0000	[thread overview]
Message-ID: <20000106173330.28882.qmail@sourceware.cygnus.com> (raw)

>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:



                 reply	other threads:[~2000-12-20 12:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000106173330.28882.qmail@sourceware.cygnus.com \
    --to=joerg.brunsmann@fernuni-hagen.de \
    --cc=java-gnats@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).