views:

111

answers:

1

My C#-ish toy grammar now has its first reduce-reduce conflicts! I'm so proud of me.

It seems all right to me, however (I switched off to a GLR parser for the occasion). The problem is, while I know the %expect directive can shut up Bison about shift/reduce conflicts, I can't find the equivalent for reduce/reduce conflicts. So what should I use to make it silent about my 3 shift/reduces and my 2 reduce/reduces?

+3  A: 

From the GNU Bison documentation, found here

For normal LALR(1) parsers, reduce/reduce conflicts are more serious, and should be eliminated entirely. Bison will always report reduce/reduce conflicts for these parsers. With GLR parsers, however, both kinds of conflicts are routine; otherwise, there would be no need to use GLR parsing. Therefore, it is also possible to specify an expected number of reduce/reduce conflicts in GLR parsers, using the declaration:

 %expect-rr n
Aiden Bell
Aww, dammit. My googlefu led me to http://dinosaur.compilertools.net/bison/bison_6.html#SEC54 instead, where no mention of this was made. Thanks.
zneak