On 27 Oct 2006, at 19:42, Bob Smith wrote:
When Bison encounters a S/R or R/R error, it would be helpful if it
could also write to the output file an input stream which would
trigger the error.
That way, the user could run the input stream through the grammar
so as to better understand the problem. As it is, we're told in
which state the problem is encountered, but not how we might have
gotten there. I've found it difficult to trace backwards through
the states in an attempt to understand the error.
I appreciate that there might well be more than one path to get to
the state with the error, but any help along these lines would be
welcome.
I think by experience, one can do without such a feature. S/R
conflicts can often be resolved by setting token precedences (%left,
etc.) on the tokens immediately before and after the '.' in the
conflicting rules. R/R conflicts is usually a faulty grammar, or due
to the insufficiency of LALR(1), and in the latter case, one might
pass to GLR or use other specialty techniques.
If you have some such problems, you may post them here, or in the
Usenet newsgroup comp.compilers.
Hans Aberg
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison