[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reductions during Bison error handling

From: Akim Demaille
Subject: Re: Reductions during Bison error handling
Date: 20 May 2002 10:00:56 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

Hi Paul,

Thanks a lot for raising this point. Sorry I couldn't be more
responsive, but I was buried under work.

I wholeheartedly subscribe to your suggestion: fixing the error
handling so that it matches the documentation.  There is a side issue
though: POSIX.  I don't know the details of what POSIX requires, and
actually, maybe it is underspecifying wrt this point.  Paul (the
Eggert one) will probably be able to help here.  BTW, Paul, (the E
one), you will certainly be very interested by this thread, which is
about the erroneous implementation of error recovery in Bison.

One note: byacc exhibits a behavior which is even worse.  Using the
three samples that Paul H. sent, one can observe that byacc rates 0/3
where Bison has 1/3 :)  I don't know about Sun YACC, but Paul E. will
find below a shell script which should be easy to use to exercise
Sun's Yacc.

src/bison/grammars % ./errors.sh
== error-1.bison
parse error, unexpected 'x', expecting ';'
== error-2.bison
parse error, unexpected 'x', expecting ';'
* error action *
== error-3.bison
parse error, unexpected 'x', expecting 'z'
r 'x' ';'
== error-1.byacc
syntax error
== error-2.byacc
syntax error
== error-3.byacc
syntax error

I couldn't find Byacc's error reports address, but we should point
them to this discussion too.

Paul H., please, feel free to adjust bison.simple, but please, also
fix bison.c++.

Attachment: errors.sh
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]