help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compiling expr.y from NetBSD source tree in bison


From: Akim Demaille
Subject: Re: compiling expr.y from NetBSD source tree in bison
Date: Mon, 26 Nov 2012 18:16:12 +0100

Le 26 nov. 2012 à 13:04, Dennis Yurichev <address@hidden> 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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]