[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parsing multiple files with same parser
From: |
Chris verBurg |
Subject: |
Re: Parsing multiple files with same parser |
Date: |
Sat, 17 Nov 2012 17:24:07 -0800 |
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 <address@hidden>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
> address@hidden
> address@hidden
> blog.borovsak.si
>
>
> _______________________________________________
> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison
>