Le 26 nov. 2012 à 13:04, Dennis Yurichev <dennis_mailing_li...@conus.info> a 
écrit :

> Hi.
> 
> I'm trying to compile simple expr.y file from NetBSD source tree and when I 
> use bison (GNU Bison) 2.4.2, I'm getting these errors:
> 
> expr.y:75.14: syntax error, unexpected =
> expr.y:82.29: syntax error, unexpected =
> 
> What's wrong with the file, how it should be fixed?
> 
> The file can be downloaded at:
> http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/bin/expr/expr.y?rev=1.38&content-type=text/plain&only_with_tag=MAIN

Hi,

The original Yacc accepted an optional '=' before the actions:

exp: exp '+' exp = { $$ = $1 + $3; }

Bison no longer supports this `=', write this:

exp: exp '+' exp   { $$ = $1 + $3; }


I don't understand why they stick to the old syntax, I fail to see the point, 
as Yacc supported perfectly well the latter.  Maybe we should suggest to adjust 
this file?  Or would you do it?


_______________________________________________
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to