|
From: | Evan Lavelle |
Subject: | Re: shift/reduce conflict with unary |
Date: | Wed, 22 Aug 2007 09:36:33 +0100 |
User-agent: | Thunderbird 2.0.0.6 (Windows/20070728) |
You don't give enough information. Here's a couple of things to try:1 - your grammar already has the precedence rules encoded in its structure. It's obvious, for example, that unary expressions have higher precedence than summation expressions. You only use the explicit '%prec' precedence when there *isn't* an obvious precedence in your grammar; you shouldn't have both. Take out the %prec/%lefts, see what happens. The portion of grammar that you give looks Ok without these extras, but something else might give a conflict.
2 - Take out the "| PLUS NUMBER" rule. Do you still have a problem?3 - You don't say what the conflict actually is; you'll need to try to read the output report. Find the section that reports on the potential shift and the potential reduction, and tell us about that bit.
Evan
[Prev in Thread] | Current Thread | [Next in Thread] |