Related articles |
---|
Lexical feedback plong@perf.com (Paul Long) (1995-09-22) |
Re: Lexical feedback mnp@compass-da.com (Mitchell Perilstein) (1995-09-29) |
Re: Lexical feedback plong@perf.com (Paul Long) (1995-10-06) |
Lexical feedback 75066.3204@CompuServe.COM (Carl Barron) (1995-10-21) |
Re: Lexical feedback rich@rdp.introl.com (Richard Pennington) (1995-10-22) |
Re: Lexical feedback pardo@cs.washington.edu (1995-10-23) |
Re: Lexical feedback vern@daffy.ee.lbl.gov (1995-10-25) |
Newsgroups: | comp.compilers |
From: | Richard Pennington <rich@rdp.introl.com> |
Keywords: | lex, yacc |
Organization: | Introl Corporation |
References: | 95-09-143 95-10-032 95-10-065 |
Date: | Sun, 22 Oct 1995 00:47:19 GMT |
Lately I've been playing with parsers for C and C++ in byacc and
btyacc. The byacc grammars, based on Roskind grammars, work but are
extremely large. Straightforward grammars for btyacc can be devised,
are compact, and, I believe, easier to understand.
My question is this: for a production compiler, is it better (that
is, faster or more efficient for compilation) to use something akin
to the Roskind grammar rather than a backtracking grammar? Does it
even matter with today's machines?
I do believe that from a program maintenance point of view that the
simpler grammars possible in a backtracking environment win. On the
other hand, In my experience, the parser is usually the last thing
that needs maintenance.
If noone has a definitive answer (or opinion!) I will post my benchmarks
comparing both approaches in the next week or so.
--
Richard Pennington Introl Corporation, Milwaukee, WI USA
Email: rich@introl.com Phone: +1 414-273-6100 Fax: +1 414-273-6106
NetBSD, X11R6, etc. mirrors: http://www.introl.com ftp.introl.com
[I'd use the backtracking grammar for two reasons -- you can produce better
error messages, and at the rate C++ is mutating your parser will surely
need maintenance. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.