From: | pedwards@dmapub.dma.org (Phil Edwards) |
Newsgroups: | comp.compilers |
Date: | 1 Jul 2000 11:11:28 -0400 |
Organization: | $home is where the core is |
References: | 00-06-112 |
Keywords: | tools |
Tuukka Tikkanen <spamtrap@tic0.net> wrote:
+ My major concerns are C++ -support (or even awareness, which even the
+ latest bison lacks, requiring addition of several Extern "C" function
+ prototypes to get things going),
I've written several parsers in bison that generate C++ code as part of
the action statements. They just need to be compiled as C++ instead of C.
(Bison doesn't care what it's emitting; heck, you could probably get it
to emit iambic pentameter as long as the resulting file was read by a
Shakespeare parser.)
+ availability of decent documentation
+ and active development/maintenance.
The moderator of this newsgroup, IIRC, co-authored a very good book on
scanners and parsers. There are several web resources with examples.
Good documentation is certainly available.
+ C++ support should include
+ encapsulation of lexer and parser in classes to avoid cluttering of
+ global namespace, to achieve re-entrancy and to support easy use of
+ multiple parsers within same program, possibly within same input
+ stream.
Well, somebody else has already pointed out that you don't need C++ to
achieve reentrant code, and that lexers/parsers can already be sufficiently
encapsulated to get multiple parsers. The "lex & yacc" book mentioned
above has methods for doing that as well.
And I'll just add that somewhere out there are versions of flex and bison
that do indeed generate C++ classes. In fact, they've been around long
enough that the C++ code they generate is no longer compliant with the
ISO C++98 standard. :-)
Phil
Return to the
comp.compilers page.
Search the
comp.compilers archives again.