GCC says “syntax error before numeric constant” in generated header file from bison

后端 未结 2 1810
Happy的楠姐
Happy的楠姐 2021-01-04 12:19

When I compile my .y file with bison parser.y -d -t and then include the parser.tab.h file in my flex file, gcc says \"error: syntax error before numeric constant.\" It\'s r

2条回答
  •  旧时难觅i
    2021-01-04 12:45

    Presumably BREAK is already defined somewhere in the flex output file, so after the preprocessor runs you are getting a statement like 99 = 258 or something. Try looking at the output of cpp yy.lex.c or gcc -E yy.lex.c. I looked at a flex output file but did not find BREAK anywhere in it, only YY_BREAK.

提交回复
热议问题