help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling yyparse repeatedly


From: Akim Demaille
Subject: Re: calling yyparse repeatedly
Date: 24 Jan 2002 14:25:11 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

>>>>> "Prabhu" == Prabhu M K <Prabhu> writes:

Prabhu> Hi...  Ye I used the flex debug mode. i found that i am trying
Prabhu> to scan after the EOF reached.

Prabhu> My reqirement is that i want to parse a specified buffer
Prabhu> repeatedly. For that i am calling yyparse more than
Prabhu> once. Since the scanner reaches the end of buffer(EOF), the
Prabhu> yyflex returing 0 for second call. 

Of course :)

Prabhu> I gone through flex document but i dont know to satisfy my
Prabhu> requirement. Could you suggest any other way.

You should have described your problem completely the first time!

Try to rewind the FILE * first, then yyrestart.  If that's not enough,
fclose it, fopen it again: maybe Flex is trying to be too smart (which
is often not a good thing from programming tools).

       The rewind function sets the file position  indicator  for
       the  stream  pointed  to by stream to the beginning of the
       file.  It is equivalent to:

              (void)fseek(stream, 0L, SEEK_SET)

       except that the error indicator for  the  stream  is  also
       cleared (see clearerr(3)).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]