parsing - How do I get rid of this duplicate declaration of YYSTYPE? -
here relevant error:
grammar.y:72: error: conflicting declaration ‘typedef union yystype yystype’ y.tab.h:83: error: ‘yystype’ has previous declaration ‘typedef union yystype yystype’ make: *** [y.tab.o] error 1
i using flex , byacc produce translator. build has structure:
- make y.tab.h grammar.y file.
- include y.tab.h in tokens.lex file, , compile produce lex.yy.c.
- include lex.yy.c in grammar file. way, can see yylex.
what seems happening this: y.tab.h contains union declaration of yystype union. gets included lex.yy.c, gets included grammar.y. @ same time, grammar.y producing own version of union, , 2 clash.
is not standard approach? there need change make build correctly?
oops. turns out wasn't compiling bison. other system had yacc symlinked bison, had change makefile use bison rather yacc.
Comments
Post a Comment