On 19 Nov 2013, at 09:50, Florent Teichteil <[email protected]> wrote:

> One question though: why do the precedence levels of operators '!' and
> '=' defined at the beginning of my grammar don't apply in this case?
> Moreover, I thought that ambiguous associativity was more likely to
> create shift/reduce conflicts rather than reduce/reduce conflicts,
> wasn't it?

Bison uses token precedences, which operate on the token immediately before and 
after the parsing dot in the conflicting shift/reduce conflict, as in the 
.output file.

A simple way to get started is modifying the calculator example in the Bison 
manual, sec. 2.2 and 2.5.1, which is also in the distribution directory 
“examples”. There is a C++ example, too, sec. 10.1.6.1.

(Assignment has normally right associativity or none, and lower precedence than 
the other operators, coming earlier in the grammar declarations.)

Hans



_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to