bison -d generates bad header?
I'm learning bison and flex, and I'm trying to modify the calculator
example in the bison tutorial to use a flex-generated scanner. Here's the
contents of my compilation buffer:
cd ~/calc/
make -k
bison calc.y
gcc -c calc.tab.c
bison -d calc.y
flex calc.lex.y
gcc -c lex.yy.c
In file included from calc.lex.y:2:
calc.tab.h:4: parse error before `symrec'
calc.tab.h:4: warning: no semicolon at end of struct or union
calc.tab.h:5: warning: data definition has no type or storage class
There are more errors, but you get the point.
Heres the output of bison -d:
$ cat calc.tab.h
typedef union
{
double val;
symrec *tptr;
} YYSTYPE;
#define NUM 258
#define VAR 259
#define FNCT 260
#define NEG 261
extern YYSTYPE yylval;
I searched the bug list and found only unrelated bison problems. I
searched the debian-user archives and found an apparently unresolved
thread from July 20, 1997, entitled "Q: gcc and flex/bison ?". I searched
the GNU help-bison archives and found it very annoying that the messages
can not be sorted by thread.
Thanks,
Matt Miller
-----------------------------------------------------
"You can't have everything. Where would you put it?"
Reply to: