[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: empty component causes shift/reduce conflict
From: |
Hans Aberg |
Subject: |
Re: empty component causes shift/reduce conflict |
Date: |
Sun, 9 Feb 2003 10:45:32 +0100 |
My reply to you contained a line:
Reply-to: address@hidden
Please respect that and cc the Help Bison list so that those on that list
may help.
Also, please quote only relevant context material so as to making it easier
to follow by those that you expect help from.
>> Also, if you have multiple adjacent rules in the grammar expansion, that
>> will cause conflicts, because the parser generator will not know which
>> actions of which empty rules to apply to. For example:
>> A1: /* empty */ {a0}
>> | B1 {b1}
>>
>> B1: /* empty */ {b0}
>> | C1
>> ...
>
>Then in this case, we have to rely on Bison's default action: shift?
First try to rewrite the grammar to remove such ambiguities.
You may also want to consult books on languages and compiler construction, say
Parsing Techniques book: http://www.cs.vu.nl/~dick/PTAPG.html
or the book by Aho, Sethi & Ullman, "Compilers...". Also check out the
Usenet newsgroup comp.compilers.
Hans Aberg