user1764219
user1764219

Reputation: 19

Bison yyparse always report "syntax error" error when once load a error file

if load right files, yyparse runs OK; but, afterload a error form file, it will always report error while another file is OK. what' the matter? is there global var not be inited generate by the error file?

Upvotes: 1

Views: 518

Answers (1)

akim
akim

Reputation: 8759

Your question does not provide enough context to know what happened, but chances are high that the error is not in the parser, but in the scanner. You should first enable %error-verbose in bison to learn more about the error you have, and possibly also enable debug traces in both Flex and Bison.

But my bet is that you have not properly restarted your scanner. Read this: http://www.gnu.org/software/bison/manual/html_node/How-Can-I-Reset-the-Parser.html.

Upvotes: 1

Related Questions