Re: Different conflicts between byacc and bison
Kaz Kylheku <[email protected]> Thu, 04 Nov 2021 18:35:39 -0700
| Newsgroups | gmane.comp.parsers.bison.bugs |
|---|---|
| Message-ID | <[email protected]> |
On 2021-11-04 01:57, Domingo Alvarez Duarte wrote: > Also tested with the latest byacc from > https://invisible-island.net/byacc/: > > ==== > > ./yacc -V > ./yacc - 2.0 20210808 > > byacc-20210808/yacc gram.y > byacc-20210808/yacc: 21 shift/reduce conflicts, 3 reduce/reduce > conflicts. Now, I've not looked at that grammar at all, or where those conflicts are coming from, and which ones are different between Bison and Bycc. Zero analysis here. Therefore, I don't intend to offer the the following remarks as being relevant to what you are seeing. But, you never know. I also use both Bison and Byacc, and have come across some differences. In my particular case, it was a situation where I had to do some extra things in the grammar to make Byacc happy that Bison didn't need: https://www.kylheku.com/cgit/txr/commit/?id=899655aa3b256dab10e764889c8323a53a585a04 My comment in this 2015 commit records what I think I was able to learn from the investigation: | Bison doesn't need this because it has $default actions which reduce | regardless of the lookahead token. BYacc insists on reducing only | if it can match $end (end of input), and not other tokens, which | constitute syntax errors. Perhaps useful, perhaps not. Cheers ...