[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using %prec to resolve shift-reduce
From: |
Simon Richter |
Subject: |
Re: Using %prec to resolve shift-reduce |
Date: |
Wed, 30 Nov 2016 22:40:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 |
Hi,
On 30.11.2016 22:36, Hans Åberg wrote:
>> %token IF "if"
>> %token ELSE "else"
> This can be resolved by adding
> %nonassoc "then"
> %nonassoc "else"
Yes, that is what I'm doing, except that I need to give a precedence to
the closing parenthesis because there is no explicit "then" keyword.
This is why I'd like to use %prec here, in order to avoid inadvertently
introducing a precedence in an unrelated place and hiding errors.
Simon
signature.asc
Description: OpenPGP digital signature