|Re-reentrant parser made with Bison++ and flex++ firstname.lastname@example.org (2001-12-20)|
|Re: Re-reentrant parser made with Bison++ and flex++ RLWatkins@CompuServe.Com (R. L. Watkins) (2001-12-22)|
|From:||"R. L. Watkins" <RLWatkins@CompuServe.Com>|
|Date:||22 Dec 2001 22:55:00 -0500|
|Posted-Date:||22 Dec 2001 22:55:00 EST|
It is much simpler to read the source file through a file handle variable,
and to simply open a new one when encountering an '#include' file, stacking
the original file handle and returning to it when the lexer is finished with
the included source file.
This works well, requires very little memory for any reasonable depth of
inclusion compared to the overhead of instantiating an entirely new lexer
and parser, and conforms precisely to the semantics of '#include'.
R. L. Watkins
> 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.
Return to the
Search the comp.compilers archives again.