[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature Request: Help for S/R and R/R Errors
From: |
Bob Smith |
Subject: |
Re: Feature Request: Help for S/R and R/R Errors |
Date: |
Sat, 28 Oct 2006 20:54:48 -0400 |
User-agent: |
Thunderbird 1.5.0.7 (Windows/20060909) |
On 10/28/2006 3:56 PM, Hans Aberg 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.
--
_______________________________________________________________
Bob Smith - address@hidden - http://www.sudleyplace.com
smime.p7s
Description: S/MIME Cryptographic Signature