Re: How to resolve a shift/reduce conflict in simple grammar

2009-11-27 Thread John R. Levine
seq0: '0' seq0 | '0' ; seq1: '1' seq1 | '1' ; and '1' and to resolve it by the shift: %right '0' '1' but it would mask any other conflicts involving 0 and 1, so I'd use the expect so you'll see any other unintended conflicts. If you have a classic flex/bison setup and want th

Re: How to resolve a shift/reduce conflict in simple grammar

2009-11-27 Thread Markus W. Weißmann
On 27 Nov 2009, at 19:52, John Levine wrote: >> The following grammar gives 2 shift/reduce conflicts. I have simplified >> it as good as possible. The intention of the grammar is to "collect" >> blocks of consecutive '0' and '1' characters from input until a >> semicolon occurs. >> >> start

Re: How to resolve a shift/reduce conflict in simple grammar

2009-11-27 Thread John Levine
>The following grammar gives 2 shift/reduce conflicts. I have simplified >it as good as possible. The intention of the grammar is to "collect" >blocks of consecutive '0' and '1' characters from input until a >semicolon occurs. > >start : sequences ';' ; >sequences : sequences sequence |

Re: How to resolve a shift/reduce conflict in simple grammar

2009-11-27 Thread sandori
Hi! What about using left recursive rules? seq0: seq0 '0' | '0' ; regards Istvan On Thu, Nov 26, 2009 at 10:49:47PM +0100, Daniel Rentz wrote: > Hello everybody, > > This is my first posting on this list, I have looked through the archive > for similar topics, but didn't find anythin