flex bison question
I am using a library in my Qt application which is built and generated by lex and yacc compiler. When I am calling first time the function it’s working fine, a good file. Next time running a bad file from within the same application for which it throws an error, from within the same application, now if I call next time for the good file also it throws the error. The problem is the error. If an error occurs then next time onwards it throws error for even for a good file. How can I clear the error stream so that it runs good for the good file. Any help is highly appreciated. Thanks Sujan
bool upgrade_model(char *model, string &newModel); //this function is exposed by the static library.
How can I clear the error stream in the begining when a call is made to the function upgrade_model()
bool upgraded = upgrade_model("/home/red/good.model",&newmodel); // it runs fine
upgraded = upgrade_model("/home/red/bad.model",&newmodel); //it throws error
upgraded = upgrade_model("/home/red/good.model",&newmodel); //it throws error
Since this is almost 4 months old, I hope you have sorted it out. If not, then I can only surmise that it is a bug - either in the code itself, or on the flex/bison rules that generate the state machine that is running in the library to process these files. If you can manually clear the error flag that may be at issue here in your code, then that may a work-around, otherwise you will have to dig deeper, such as building the module in debug mode and then running the application in the debugger.