Ok, got it working...
When I initially started to play with this code, I did it using the famous "ctrl-c/ctrl-v" feature... :)
When "yywrap()" return 0, this indicates that the EOF had been reached but the parsing must continue. This is particularly true on interactive parsers.
Getting input from a file, as it's the present situation, we have 3 alternatives to quit the parsing on end-of-file situation:
- Put an %option noyywrap on lex specifications and remove the yywrap() code on your side OR
- Change your yywrap() to returns 1 to quit parsing OR
- Change your yywrap() to set yyin to another file and returns 0 to continues parsing the newly added file.