One thing that's bitten me in the past is that yyrestart doesn't reset the flex start-state. If you have any of those, maybe add a "BEGIN(INITIAL)" to your other flush code?
-Chris On Sat, Nov 17, 2012 at 4:56 PM, Tadej Borovšak <tadej.borov...@gmail.com>wrote: > Hi. > > Dne 18.11.2012 (ned) ob 01:20 +0100 je Hans Aberg napisal(a): > > On 17 Nov 2012, at 23:48, Tadej Borovšak wrote: > > > > > ... now I'm getting an error when trying to run > > > my parser for the second time using the same file as input [1]. > > ... > > > /* Open input stream etc. */ > > > yyparse (); > > > /* Close input stream and reopen it */ > > > /* Flush flex buffer using YY_FLUSH_BUFFER */ > > > yyparse (); > > > > Have you tried using yyrestart() before calling the scanner again? > > Unfortunately, that didn't help. I'm having a feeling that flex is not > to blame here, since it's output is identical in both runs. > > Maybe I need to do some cleanup before calling yyparse() again? My > previous parsing completed without error (yyparse() returned 0), but > maybe something is not set exactly as it was before the first parsing? > > -- > Tadej Borovšak > tadej.borov...@gmail.com > tadeb...@gmail.com > blog.borovsak.si > > > _______________________________________________ > help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison > _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison