Hi,

From the old time in school, Bison is a LL parser and I have see that Lemon is LR (LALR(1) ). That's it, Bison reduces as soon as it can while Lemon shifts as much as it can.

You have to force Lemon to reduce "prog" rule, i.e. newline should be part of another rule:
E.g. modified ladd.y:
-->
start   ::= loop .
loop    ::= prog NL loop .

prog    ::= expr(a) prog .   { printf("%d\n", a); }
prog    ::= .

expr(a) ::= INTEGER(b) .                { a = b; }
expr(a) ::= expr(b) PLUS expr(c) .      { a = b + c; }

<--

Regards,
Gabriel

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to