|Re-reentrant parser made with Bison++ and flex++ email@example.com (2001-12-20)|
|Re: Re-reentrant parser made with Bison++ and flex++ firstname.lastname@example.org (2001-12-22)|
|From:||email@example.com (Clint Olsen)|
|Date:||22 Dec 2001 22:57:00 -0500|
|Posted-Date:||22 Dec 2001 22:57:00 EST|
In the case of handling include files, you don't really need a
reentrant parser. You just need a reentrant lexer. You recursively
call the lexer on the new input file. By definition, including
another file doesn't require you to reset the state of the parse. The
result should be a syntactically valid stream.
Plain old flex generating C++ should allow you to do this since all
the variables are contained within a parser class. You basically have
to instantiate another lexer and associate it with your new parser.
There are ANSI C solutions to this problem as well. See re2c as an
firstname.lastname@example.org (MidiShare) wrote in message news:01-12-098...
> Right now the "include" files semantic action instantiate a new
> lexer/parser to parse the included file, but this does no work
> correctly because of conficts with the running parser.
> The bison documentation speaks of "pure reentrant" parsers that should
> probably be used in this context.
> But with flex++/bison++ which has some differencies with bison, we
> don't know how this "pure reentrant" parsers must be instantiated and
> used, and in particular kow the connection betwwen the lexer and the
> parser has to be done.
Return to the
Search the comp.compilers archives again.