Re: Dragon Book - update necessary?

Randall Hyde <rhyde@cs.ucr.edu>
23 Oct 2000 22:14:21 -0400

          From comp.compilers

Related articles
[3 earlier articles]
Re: Dragon Book - update necessary? Bjorn.DeSutter@rug.ac.be (Bjorn De Sutter) (2000-10-10)
Re: Dragon Book - update necessary? toon@moene.indiv.nluug.nl (Toon Moene) (2000-10-12)
Re: Dragon Book - update necessary? LLkParsing@aol.com (2000-10-12)
Re: Dragon Book - update necessary? gelleric@wgelleri.boeblingen.de.ibm.com (2000-10-12)
Re: Dragon Book - update necessary? rhyde@cs.ucr.edu (Randall Hyde) (2000-10-15)
Re: Dragon Book - update necessary? bruce@hoult.org (Bruce Hoult) (2000-10-19)
Re: Dragon Book - update necessary? rhyde@cs.ucr.edu (Randall Hyde) (2000-10-23)
Re: parsing tools, was Dragon Book - update necessary? LLkParsing@aol.com (2000-10-26)
Re: parsing tools, was Dragon Book - update necessary? rhyde@cs.ucr.edu (Randall Hyde) (2000-10-31)
Re: parsing tools, was Dragon Book - update necessary? ed_davis@my-deja.com (Ed Davis) (2000-11-01)
Re: parsing tools, was Dragon Book - update necessary? jim.granville@designtools.co.nz (Jim Granville) (2000-11-01)
Re: parsing tools, was Dragon Book - update necessary? iank@idiom.com (2000-11-01)
Re: parsing tools, was Dragon Book - update necessary? jmochel@foliage.com (2000-11-01)
[4 later articles]
| List of all articles for this month |

From: Randall Hyde <rhyde@cs.ucr.edu>
Newsgroups: comp.compilers
Date: 23 Oct 2000 22:14:21 -0400
Organization: Posted via Supernews, http://www.supernews.com
References: 00-10-061 00-10-067 00-10-093 00-10-109 00-10-130
Keywords: parse

> Bjarne Stroustrup once said on BIX (hmm .. are you *that* rhyde?) that
> one of his biggest mistakes in cfront was in allowing the other Bell
> Labs guys to convince him to use yacc and that he'd love to have the
> funds to get an intern to redo it as recursive descent. The reason
> was that recursive descent is more work upfront but you get good error
> messages almost for free, while yacc is easy to get going but the work
> required to get decent error messages was nearly unbounded.
>
> This was some years ago now.
>
> -- Bruce


Yes, same rhyde.
I still haven't figured out if writing my latest compiler project (HLA)
with Flex/Bison rather than writing it as a recursive descent compiler
was a mistake.


On one hand, it was a prototype of the language and using FLEX/Bison
has, arguably, made it easier to make changes to the code.


OTOH, Flex/Bison was an inappropriate choice for HLA; my bison file
is over 100,000 lines long (HLA really wants an LALR(k) parser generator,
not an LALR(1) parser generator; the size of the bison file is largely
the result of flattening the grammar). Also, since I wrote HLA as a system
for teaching assembly language, Flex/Bison's famous problem with handling
errors has been a real problem. Too bad I had to write nearly 150,000 lines
of code (including FLEX and C code) to discover the same thing that
Bjarne did so many years ago.


I have been really tempted to learn ANTLR. It seems like it would be
the right tool for writing HLA v2.0. However, having gotten burned on
HLA v1.0, I'm real concerned about investing the time to learn another
compiler tool plus three years writing the compiler only to discover
that I should have stuck with C/C++ and a recursive descent approach.
Randy Hyde


Post a followup to this message

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