Re: Anything better than lex & yacc? Everyone still using those?

pedwards@dmapub.dma.org (Phil Edwards)
1 Jul 2000 11:11:28 -0400

          From comp.compilers

Related articles
Anything better than lex & yacc? Everyone still using those? spamtrap@tic0.net (Tuukka Tikkanen) (2000-06-30)
Re: Anything better than lex & yacc? Everyone still using those? feriozi@my-deja.com (2000-06-30)
Re: Anything better than lex & yacc? Everyone still using those? idbaxter@semdesigns.com (Ira D. Baxter) (2000-06-30)
Re: Anything better than lex & yacc? Everyone still using those? mihai@cs.wisc.edu (Mihai Christodorescu) (2000-06-30)
Re: Anything better than lex & yacc? Everyone still using those? iank@idiom.com (2000-07-01)
Re: Anything better than lex & yacc? Everyone still using those? pedwards@dmapub.dma.org (2000-07-01)
Re: Anything better than lex & yacc? Everyone still using those? isaac@latveria.castledoom.org (2000-07-04)
Re: Anything better than lex & yacc? Everyone still using those? jerry@swsl.co.uk (2000-07-04)
Re: Anything better than lex & yacc? Everyone still using those? Frank.Gerlach@brokat.de (Frank Gerlach) (2000-07-18)
Re: Anything better than lex & yacc? Everyone still using those? chris@cjl1.demon.co.uk (Chris Locke) (2000-07-18)
Re: Anything better than lex & yacc? Everyone still using those? dforcier@allaire.com (Darren Forcier) (2000-07-18)
| List of all articles for this month |
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


Post a followup to this message

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