* [PATCH]Use prev_lexptr in p-exp.y
@ 2002-04-25 8:06 Pierre Muller
2002-04-25 8:30 ` Andrew Cagney
0 siblings, 1 reply; 8+ messages in thread
From: Pierre Muller @ 2002-04-25 8:06 UTC (permalink / raw)
To: gdb-patches
This basically just adds the same functionality
than in the c language parser.
See
http://sources.redhat.com/ml/gdb-patches/2002-04/msg00467.html
ChangeLog entry:
2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr>
* 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.
Index: p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.9
diff -u -p -r1.9 p-exp.y
--- p-exp.y 18 Apr 2002 15:22:18 -0000 1.9
+++ p-exp.y 25 Apr 2002 08:38:29 -0000
@@ -947,6 +947,8 @@ yylex ()
retry:
+ prev_lexptr = lexptr;
+
tokstart = lexptr;
explen = strlen (lexptr);
/* See if it is a special token of length 3. */
@@ -1481,5 +1483,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
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH]Use prev_lexptr in p-exp.y 2002-04-25 8:06 [PATCH]Use prev_lexptr in p-exp.y Pierre Muller @ 2002-04-25 8:30 ` Andrew Cagney 2002-04-25 9:49 ` [RFA]Use prev_lexptr in *-exp.y Pierre Muller 0 siblings, 1 reply; 8+ messages in thread From: Andrew Cagney @ 2002-04-25 8:30 UTC (permalink / raw) To: Pierre Muller; +Cc: gdb-patches > 2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> > > * 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. Andrew ^ permalink raw reply [flat|nested] 8+ messages in thread
* [RFA]Use prev_lexptr in *-exp.y 2002-04-25 8:30 ` Andrew Cagney @ 2002-04-25 9:49 ` Pierre Muller 2002-04-25 11:51 ` Michael Snyder 0 siblings, 1 reply; 8+ messages in thread From: Pierre Muller @ 2002-04-25 9:49 UTC (permalink / raw) To: Andrew Cagney; +Cc: gdb-patches At 17:30 25/04/2002 , Andrew Cagney a écrit: >>2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> >>* 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! So what about that: ChangeLog entry: 2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> * 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]Use prev_lexptr in *-exp.y 2002-04-25 9:49 ` [RFA]Use prev_lexptr in *-exp.y Pierre Muller @ 2002-04-25 11:51 ` Michael Snyder 2002-05-02 6:33 ` Pierre Muller 0 siblings, 1 reply; 8+ messages in thread From: Michael Snyder @ 2002-04-25 11:51 UTC (permalink / raw) To: Pierre Muller; +Cc: Andrew Cagney, gdb-patches Pierre Muller wrote: > > At 17:30 25/04/2002 , Andrew Cagney a écrit: > >>2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> > >>* 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! <g> > > So what about that: > > ChangeLog entry: > > 2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> > * 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]Use prev_lexptr in *-exp.y 2002-04-25 11:51 ` Michael Snyder @ 2002-05-02 6:33 ` Pierre Muller 2002-05-02 11:02 ` Michael Snyder 0 siblings, 1 reply; 8+ messages in thread From: Pierre Muller @ 2002-05-02 6:33 UTC (permalink / raw) To: Michael Snyder; +Cc: Andrew Cagney, gdb-patches At 20:38 25/04/2002 , Michael Snyder a écrit: >Pierre Muller wrote: > > > > At 17:30 25/04/2002 , Andrew Cagney a écrit: > > >>2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> > > >>* 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! <g> May I consider this as an approval and commit this patch? 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]Use prev_lexptr in *-exp.y 2002-05-02 6:33 ` Pierre Muller @ 2002-05-02 11:02 ` Michael Snyder 2002-05-03 1:38 ` Pierre Muller 0 siblings, 1 reply; 8+ messages in thread From: Michael Snyder @ 2002-05-02 11:02 UTC (permalink / raw) To: Pierre Muller; +Cc: Andrew Cagney, gdb-patches Pierre Muller wrote: > > At 20:38 25/04/2002 , Michael Snyder a écrit: > >Pierre Muller wrote: > > > > > > At 17:30 25/04/2002 , Andrew Cagney a écrit: > > > >>2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> > > > >>* 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! <g> > > May I consider this as an approval and commit this patch? Aha, the files have no maintainer! OK, yes, donning my omnipotence hat, I approve your change. ;-) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]Use prev_lexptr in *-exp.y 2002-05-02 11:02 ` Michael Snyder @ 2002-05-03 1:38 ` Pierre Muller 2002-05-03 10:41 ` Michael Snyder 0 siblings, 1 reply; 8+ messages in thread From: Pierre Muller @ 2002-05-03 1:38 UTC (permalink / raw) To: Michael Snyder; +Cc: Andrew Cagney, gdb-patches At 19:49 02/05/2002 , Michael Snyder a écrit: >Pierre Muller wrote: > > > > At 20:38 25/04/2002 , Michael Snyder a écrit: > > >Pierre Muller wrote: > > > > > > > > At 17:30 25/04/2002 , Andrew Cagney a écrit: > > > > >>2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> > > > > >>* 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! <g> > > > > May I consider this as an approval and commit this patch? > >Aha, the files have no maintainer! OK, yes, donning my omnipotence hat, >I approve your change. ;-) Thanks, committed. By the way, I don't have the necessary stuff to run the testsuite... Thus I can not warranty that there are no regressions. There mught be some wrong regressions, if some testsuite do check the error output in case of wrong expression entered. The error output should be more logical now, but could get some tests to fail. 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA]Use prev_lexptr in *-exp.y 2002-05-03 1:38 ` Pierre Muller @ 2002-05-03 10:41 ` Michael Snyder 0 siblings, 0 replies; 8+ messages in thread From: Michael Snyder @ 2002-05-03 10:41 UTC (permalink / raw) To: Pierre Muller; +Cc: Andrew Cagney, gdb-patches Pierre Muller wrote: > > At 19:49 02/05/2002 , Michael Snyder a écrit: > >Pierre Muller wrote: > > > > > > At 20:38 25/04/2002 , Michael Snyder a écrit: > > > >Pierre Muller wrote: > > > > > > > > > > At 17:30 25/04/2002 , Andrew Cagney a écrit: > > > > > >>2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr> > > > > > >>* 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! <g> > > > > > > May I consider this as an approval and commit this patch? > > > >Aha, the files have no maintainer! OK, yes, donning my omnipotence hat, > >I approve your change. ;-) > > Thanks, committed. > > By the way, I don't have the necessary stuff to run the > testsuite... Thus I can not warranty that there are no > regressions. There mught be some wrong regressions, > if some testsuite do check the error output in case of > wrong expression entered. The error output should be more > logical now, but could get some tests to fail. Yes, I'm waiting for someone to complain. None of the C or C++ tests have failed because of this (and I presume you've tested pascal). ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-05-03 17:41 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-04-25 8:06 [PATCH]Use prev_lexptr in p-exp.y Pierre Muller 2002-04-25 8:30 ` Andrew Cagney 2002-04-25 9:49 ` [RFA]Use prev_lexptr in *-exp.y Pierre Muller 2002-04-25 11:51 ` Michael Snyder 2002-05-02 6:33 ` Pierre Muller 2002-05-02 11:02 ` Michael Snyder 2002-05-03 1:38 ` Pierre Muller 2002-05-03 10:41 ` Michael Snyder
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox