|
From: | Zdenek Prikryl |
Subject: | Priorities in reduce/reduce conflicts |
Date: | Thu, 12 Mar 2015 13:21:16 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 |
I've tried to change an order of rules within the body of "conflict" rule, I've tried glr parser and %dprec too, but nothing helps.
Can someone give me a hint how to deal with this? Just a note, I'd like to keep the grammar as it is as much as possible.
Thanks. " %token ID NUMBER %left '+' %right UPLUS %% body : body conflict | conflict ; conflict : id { /* sem act 1 */ } // preferred rule but never used | expr ':' expr { /* sem act 2 */ } ; expr : '+' expr %prec UPLUS | expr '+' expr | NUMBER | id ; id : ID ; %% " -- Zdenek Prikryl
[Prev in Thread] | Current Thread | [Next in Thread] |