This is the mail archive of the
cygwin
mailing list for the Cygwin project.
bison bug
The latest version of bison appears to be broken.
Regardless of the grammar input file, the generated y.tab.c file contains a syntax error in the definition of yyparse when __STDC__ and YYPARSE_PARAM are not defined. Specifically, the generated code looks like:
int
yyparse ()
;
{
int yystate;
...
That first ; should not be there.
I'm not a bison internals expert, but I see that it's using m4 to do most of its work. I'm no m4 expert either, so I can't tell if the problem is in the bison input file, or a bug in m4.
~ [518] $ bison --version
bison (GNU Bison) 2.1
Written by Robert Corbett and Richard Stallman.
~ [519] $ m4 --version
GNU M4 1.4.4
Written by Rene' Seindal.
I used the following trivial grammar file, grammar.y, to reproduce the bug:
%{
#define YYMAXDEPTH 1024
%}
%token A B
%%
C: A B { } ;
Then, the command line bison -y -d grammar.y produces a y.tab.c file with the offending error on line 828.
--
Stefan Vorkoetter
Maplesoft
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/