To add more,
I have debugged this more, the problem come because during yylex END_OF_BUFFER is handled differently where a BUFFER_NEW is checked and some global are changed. But, in yyinput there is no such specific handling.
Also, what is happening is that:
From yyinput, yywrap gets called it changes the buffer state to BUFFER_NEW but copying characters from yytext till yy_c_buf_p at start of buffer, yy_n_chars global is total number of characters in buffer but yy_n_chars of buffer struct is kept to number of character read from file. Now, at next yy_get_next_buffer called from another yyinput call these global change in similar way. Now at the END_OF_BUFFER case in yylex, the global get changed due to buffer state being BUFFER_NEW. These changed globals are causing fatal error.
Kindly, somebody please provide some inputs.
Thanks & Regards,
I have been using flex (2.5.4-version) for lexical analysis of some files.
For a set of file I am getting following error:
“fatal flex scanner internal error--end of buffer missed”
I have also check the same with 2.5.35 version. It also flags same error.
Is anyone aware of such bug being fixed in any patch.
I have also attached the small lex file and fileset causing the problem.
./a.out file1 file2
Intent of Lex file:
It is a simple lex file having simple patterns. There is just a special handling for single line c-style comments “//”. Upon matching “//” I am eating up all characters till newline or file change using yyinput.
Input file set:
File1: last line contains a comment not containing “\n” character.
File2: Has very big comment
Thanks & Regards,
________________________________ NOTE: This message and its attachments are intended only for the individual or entity to which it is addressed and may contain confidential information or forward-looking statements regarding product development. Forward-looking statements are subject to change at Atrenta's sole discretion and Atrenta will have no liability for the delay or failure to deliver any product or feature mentioned in such forward-looking statements.