Restarting lex portably (or flex) (Sean Barrett)
Sat, 16 Feb 91 18:12:09 -0500

          From comp.compilers

Related articles
Restarting lex portably (or flex) (1991-02-16)
Re: Restarting lex portably (or flex) (1991-02-21)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Sean Barrett)
Keywords: lex, question
Organization: Compilers Central
Date: Sat, 16 Feb 91 18:12:09 -0500

Is there a way to start lex processing a new file when the
previous one was *not* processed all the way to end-of-file?
[e.g. aborted compilation due to compiling].

flex provides yyrestart(FILE *f), but the wording of the
documentation is very consistent in saying 'after end-of-file
is reached on the previous file'; however, it is unclear whether
the documentation author meant it was a precondition.

Examining the lex output on my machine here reveals that
only an internal buffer pointer (yysptr I think) needs to
be reset, but I imagine this would not be portable.

I would prefer a solution for lex, but barring that,
a clarification of yyrestart() in flex would be useful.
[Lex lets you define its input macros any way you want. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.