|Lexical feedback firstname.lastname@example.org (Paul Long) (1995-09-22)|
|Re: Lexical feedback email@example.com (Mitchell Perilstein) (1995-09-29)|
|Re: Lexical feedback firstname.lastname@example.org (Paul Long) (1995-10-06)|
|Lexical feedback 75066.3204@CompuServe.COM (Carl Barron) (1995-10-21)|
|Re: Lexical feedback email@example.com (Richard Pennington) (1995-10-22)|
|Re: Lexical feedback firstname.lastname@example.org (1995-10-23)|
|Re: Lexical feedback email@example.com (1995-10-25)|
|From:||Richard Pennington <firstname.lastname@example.org>|
|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: email@example.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
Search the comp.compilers archives again.