Re: Recursive Descent Parser

"Randall Hyde" <rhyde@shoe-size.com>
12 Feb 2000 22:42:49 -0500

          From comp.compilers

Related articles
Recursive Descent Parser e8rasmus@etek.chalmers.se (Rasmus Anthin) (2000-01-09)
Re: Recursive Descent Parser world!cfc@uunet.uu.net (Chris F Clark) (2000-01-12)
Re: Recursive Descent Parser biocyn@erols.com (2000-01-25)
Re: Recursive Descent Parser chstapfer@bluewin.ch (Christian Stapfer) (2000-02-10)
Re: Recursive Descent Parser rhyde@shoe-size.com (Randall Hyde) (2000-02-12)
Re: Recursive Descent Parser mklarson@gte.net (Michael Larson) (2000-02-22)
Re: Recursive Descent Parser paulyg@clara.net (2000-02-22)
Re: Recursive Descent Parser world!cfc@uunet.uu.net (Chris F Clark) (2000-02-22)
Re: Recursive Descent Parser fjscipio@rochester.rr.com (Fred J. Scipione) (2000-02-23)
Re: Recursive Descent Parser adrian@dcs.rhbnc.ac.uk (2000-02-27)
Re: Recursive Descent Parser anton@mips.complang.tuwien.ac.at (2000-02-27)
| List of all articles for this month |

From: "Randall Hyde" <rhyde@shoe-size.com>
Newsgroups: comp.compilers
Date: 12 Feb 2000 22:42:49 -0500
Organization: Compilers Central
References: 00-01-027 00-01-032 00-02-034
Keywords: parse

Chris F Clark <world!cfc@uunet.uu.net> wrote
> > The essential problem here is that the
> > poster is trying to write their first parser by hand. This is a
> > TERRIBLE idea. No one should learn how to parse by writing
> > hand-written parsers.


Christian Stapfer <chstapfer@bluewin.ch> wrote in message
> Well, this reminds me of a story that Stroustrup tells in his book
> "The Design and Evolution of C++".
> [ C++ wasn't well suited to yacc ]


I recently (well, over the past three years) wrote a compiler for the
HLA language (High Level Assembler) in Flex and Bison. In retrospect,
using these tools was one of the biggest mistakes I made. Certain
semantic features and the need for two symbol lookahead caused the
code base to explode on me. Flattening the grammar (to eliminate the
need for two symbol lookahead) tripled the size of the parser. I
could have easily written a recursive descent compiler in C/C++ with
far fewer lines of code.


When I get around to redoing the compiler, Flex and Bison (and their
ilk) won't get a moment's thought. I might give PRECC a gander, but
I'd be really scared to try and develop a large compiler with a
product I haven't used for medium sized projects in the past. Randy
Hyde







Post a followup to this message

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