The problem is that you need to find someone willing to do the
implementation. And if all developers are heavy busy doing things to
them more important, why would they bother implementing it? :-) Your
idea seems to be along the line, if the compiler finds an error of a
function, and displays it, why not instead give examples of erroneous
inputs? It is not a common practice with compilers, I think.
Satya is developing a GUI for displaying Bison grammars, I think, so
you might explain your ideas to him.
Hans Aberg
On 29 Oct 2006, at 02:54, Bob Smith wrote:
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.
Perhaps your experience is that you don't need such training
wheels, but my experience is different. Have some pity on us mere
mortals! This suggestion might not raise some deep theoretical
issue, but it has the possibility of helping a large number of new
users, some of whom abandon the use of bison because they don't
know what to do to fix the problem.
I'm reminded of a very useful tool called Regex Coach which
provides a visual display of what a particular regular expression
is doing on a given input string. It's a great way to figure out
why your regex isn't working. I'm not asking for such a tool for
bison (although that would be dynamite), just a hint as to how to
fix a S/R error.
If you have some such problems, you may post them here, or in the
Usenet newsgroup comp.compilers.
I thought that the idea of designing and implementing a good tool
is that it becomes self-explanatory so one doesn't need to ask for
help in a newsgroup such as this. I would greatly prefer a feature
such as I requested which gives me an immediate pointer towards a
solution, than to send a message to this group, hope that someone
has the time to look at my grammar, and then wait for a reply. One
approach takes seconds, the other hours or more.
Besides which, I would think that you folks would have better
things to do than be bothered with one more ill-formed grammar.
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison