help-bison
[Top][All Lists]
Advanced

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

Re: rule cycle and reduce/reduce conflict


From: Florent Teichteil
Subject: Re: rule cycle and reduce/reduce conflict
Date: Tue, 19 Nov 2013 11:40:58 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

> ! is a prefix operator; = is infix.

Sorry, but I read bison's documentation regarding infix operators and
precedence levels, and I still don't understand your short explanation.
Here is another simple grammar with only infix operators that has conflicts:

%left '&'
%left '='
%left '+'

%%

start : bool_expr;

bool_expr : bool_expr '&' bool_expr
          | num_expr '=' num_expr
          | 'b'
          ;

num_expr : bool_expr
         | num_expr '+' num_expr
         | 'n'
         ;

%%

All operators have defined precedence levels, so why is it ambiguous?

Thanks,
Florent



reply via email to

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