help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Priorities in reduce/reduce conflicts


From: Hans Aberg
Subject: Re: Priorities in reduce/reduce conflicts
Date: Thu, 12 Mar 2015 18:17:20 +0100

> On 12 Mar 2015, at 13:21, Zdenek Prikryl <address@hidden> wrote:
> 
> I have a valid reduce/reduce conflict.

> Can someone give me a hint how to deal with this? 

See the Bison manual calculator example, sec. 10.1.6.3: keep all in the "expr" 
rules, adding a precedence rule for ":".

For lists, etc:

expr:
  ...
| list
;

list: "[" sequence "]"

sequence:
  /* empty */
| expr
| sequence "," expr
;

It is typically needed some extra separating token to avoid conflicts.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]