Issue 4: bug in precedence support
Status:  New
Owner: ----
Reported by lahike...@gmail.com, Jun 2, 2009
What steps will reproduce the problem?
1. untar the attached .tar.gz
2. run ./compile-and-run

What is the expected output? What do you see instead?
'compile-and-run' should just print "4" and exit.


What version of the product are you using? On what operating system?
Lemon version 1.0.  Debian testing.

Please provide any additional information below.

The crux of the problem is that the precedence overrides are ignored, e.g. in

value(v) ::= VALUE(a) COLON VALUE(b) QUESTION VALUE(c). [TERNARY]

the [TERNARY] annotation does nothing, and the rule has the precedence of
COLON.
Jun 4, 2009
#1 lahike...@gmail.com
(No comment was entered for this change.)
lemon-bug.tar.gz
851 bytes   Download
Oct 10, 2010
#2 no.smile...@gmail.com
If anyone cares, the bug is in these lines (find_shift_action function):

		if (stateno > YY_SHIFT_MAX ||
		    (i = yy_shift_ofst [stateno]) == YY_SHIFT_USE_DFLT) {
			return yy_default [stateno];
		}

It should be 'stateno > YY_SHIFT_COUNT' instead of a 'stateno > YY_SHIFT_MAX'.