Building a Re-entrant Interpreter

Mark Dancho <>
13 Jun 1996 19:03:06 -0400

          From comp.compilers

Related articles
Building a Re-entrant Interpreter (Mark Dancho) (1996-06-13)
| List of all articles for this month |

From: Mark Dancho <>
Newsgroups: comp.compilers
Date: 13 Jun 1996 19:03:06 -0400
Organization: Compilers Central
Keywords: interpreter, tools, question


I was hoping to use lex and yacc to implement a re-entrant lexer and
parser. I soon realized that lex and yacc don't produce re-entrant

Later, I discovered that GNU bison produces a re-entrant parser.
However, I can't find a version of lex that is also re-entrant. Does
anyone know of a re-entrant lexical analyzer? As far as I can tell,
flex does not provide this functionality.

Are there any non-commercial compiler-development programs that I can
use to build a re-entrant parser, or am I stuck using C or C++ to
develop everything from scratch?

Mark Dancho
[This question comes up from time to time; it's not all that hard to mutate
the flex code to make it reentrant. There's a C++ option in the current flex
that creates lexer classes, which may do what you want. -John]


Post a followup to this message

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