Reputation: 19
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
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