Re: bison, pure_parser and flex

mottl@miss.wu-wien.ac.at (Markus Mottl)
25 Jan 1999 21:52:52 -0500

          From comp.compilers

Related articles
Need starting tips for a new interpreter / parser lio-daa@online.no (Harald Fjerdingstad) (1999-01-02)
Re: Need starting tips for a new interpreter / parser lio-daa@online.no (Harald Fjerdingstad) (1999-01-04)
bison, pure_parser and flex menszner@t-online.de (1999-01-23)
Re: bison, pure_parser and flex mottl@miss.wu-wien.ac.at (1999-01-25)
| List of all articles for this month |
From: mottl@miss.wu-wien.ac.at (Markus Mottl)
Newsgroups: comp.compilers
Date: 25 Jan 1999 21:52:52 -0500
Organization: University of Economics and Business Administration, Vienna, Austria
References: 99-01-012 99-01-020 99-01-084
Keywords: parse, lex, yacc

Dieter Menszner (menszner@t-online.de) wrote:
: Apparently bison can generate a reentrant parser by using the
: %pure_parser directive. But then the lexer (flex) must also be
: reentrant. I could not understand from the bison documentation how
: flex can be made reentrant.


: Has anybody done this kind of stuff ?


Not too difficult: since objects have unique data, they are "reentrant
by nature". This means you only have to generate C++ code (option '-+'
in flex).


If you need example code for how to combine bison and flex to form a
reentrant compiler, look at the following page:


    http://miss.wu-wien.ac.at/~mottl/cpp_sources/intro.html


and grab the file "reent.tar.gz".


Best regards,
Markus


--
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl


Post a followup to this message

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