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: John P. Hartmann
Subject: Re: rule cycle and reduce/reduce conflict
Date: Tue, 19 Nov 2013 09:54:26 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

! is a prefix operator; = is infix.

On 11/19/2013 09:50 AM, Florent Teichteil wrote:
> Thanks John!
> One question though: why do the precedence levels of operators '!' and
> '=' defined at the beginning of my grammar don't apply in this case?
> Moreover, I thought that ambiguous associativity was more likely to
> create shift/reduce conflicts rather than reduce/reduce conflicts,
> wasn't it?
> 
> Regards,
> Florent
> 
> Le 19/11/2013 00:17, John Levine a écrit :
>>> bool_expr : '!' bool_expr
>>>          | num_expr '=' num_expr
>>>          | 'b'
>>>          ;
>>>
>>> num_expr : bool_expr
>>>         | 'n'
>>>         ;
>>
>> Yes, this is ambiguous.
>>
>> If your input is "!b=n", it can't tell which of these you mean:
>>
>> ! ( b = n )
>>
>> (!b) = n
>>
>> R's,
>> John
>>
> 
> _______________________________________________
> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison
> 




reply via email to

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