From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9359 invoked by alias); 25 Apr 2002 18:51:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9336 invoked from network); 25 Apr 2002 18:51:03 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 25 Apr 2002 18:51:03 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id LAA28616; Thu, 25 Apr 2002 11:50:58 -0700 (PDT) Message-ID: <3CC84D3A.283E0A83@redhat.com> Date: Thu, 25 Apr 2002 11:51:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Pierre Muller CC: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [RFA]Use prev_lexptr in *-exp.y References: <4.2.0.58.20020425103344.024be7a8@ics.u-strasbg.fr> <4.2.0.58.20020425183926.020b6350@ics.u-strasbg.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-04/txt/msg01035.txt.bz2 Pierre Muller wrote: > > At 17:30 25/04/2002 , Andrew Cagney a écrit: > >>2002-04-25 Pierre Muller > >>* p-exp.y: Also use new prev_lexptr variable > >> to improve error reporting. Based on Michael Snyder > >> 2002-04-24 dated patch to c-exp.y. > > > >Nice. Can I suggest creating bug report so we know that the others should be done. > > This is more work than fixing them directly! ROTFL! You rock, Pierre! > > So what about that: > > ChangeLog entry: > > 2002-04-25 Pierre Muller > * f-exp.y: Also use new prev_lexptr variable > to improve error reporting. Based on Michael Snyder > 2002-04-24 dated patch to c-exp.y. > * jv-exp.y: Likewise. > * m2-exp.y: Likewise. > > Index: f-exp.y > =================================================================== > RCS file: /cvs/src/src/gdb/f-exp.y,v > retrieving revision 1.5 > diff -u -p -r1.5 f-exp.y > --- f-exp.y 6 Mar 2001 08:21:07 -0000 1.5 > +++ f-exp.y 25 Apr 2002 16:45:29 -0000 > @@ -924,7 +924,9 @@ yylex () > char *tokstart; > > retry: > - > + > + prev_lexptr = lexptr; > + > tokstart = lexptr; > > /* First of all, let us make sure we are not dealing with the > @@ -1171,5 +1173,8 @@ void > yyerror (msg) > char *msg; > { > + if (prev_lexptr) > + lexptr = prev_lexptr; > + > error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); > } > Index: jv-exp.y > =================================================================== > RCS file: /cvs/src/src/gdb/jv-exp.y,v > retrieving revision 1.5 > diff -u -p -r1.5 jv-exp.y > --- jv-exp.y 21 Feb 2002 02:54:46 -0000 1.5 > +++ jv-exp.y 25 Apr 2002 16:45:29 -0000 > @@ -862,6 +862,8 @@ yylex () > > retry: > > + prev_lexptr = lexptr; > + > tokstart = lexptr; > /* See if it is a special token of length 3. */ > for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++) > @@ -1207,6 +1209,9 @@ void > yyerror (msg) > char *msg; > { > + if (prev_lexptr) > + lexptr = prev_lexptr; > + > error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); > } > > Index: m2-exp.y > =================================================================== > RCS file: /cvs/src/src/gdb/m2-exp.y,v > retrieving revision 1.3 > diff -u -p -r1.3 m2-exp.y > --- m2-exp.y 6 Mar 2001 08:21:09 -0000 1.3 > +++ m2-exp.y 25 Apr 2002 16:45:29 -0000 > @@ -821,6 +821,8 @@ yylex () > > retry: > > + prev_lexptr = lexptr; > + > tokstart = lexptr; > > > @@ -1090,5 +1092,8 @@ void > yyerror (msg) > char *msg; > { > + if (prev_lexptr) > + lexptr = prev_lexptr; > + > error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); > } > > Pierre Muller > Institut Charles Sadron > 6,rue Boussingault > F 67083 STRASBOURG CEDEX (France) > mailto:muller@ics.u-strasbg.fr > Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99