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
Return to the
comp.compilers page.
Search the
comp.compilers archives again.