On 25 Sep 2006, at 09:01, Heiko Wundram wrote:
Bison reduces everything as far as possible before erroring out
(that's a
general properly of LALR(1)-parsers), but here, there's absolutely
no rule
for it to do what you want, so the error occurs on the shift on the
expected
E.
Actually, LR(1) issues an error immediately on seeing the erroneous
token. LALR(1) compacts certain LR(1) states, and as a consequence of
that, may perform additional reductions. But there is no general rule
when this occurs, as far as I know.
So if the original question is over shaky error handling, that is
just a part of the LALR(1) that Bison uses. The only way to cope with
it, for now, is trial and error.
It has been discussed to give Bison a LR(1) parser option, which it
does not have now, where better error handling is one motivation.
Hans Aberg
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison