yacc - rules of thumb for speed of parsing?

"Daniel G. Hyams" <dgh2@Ra.MsState.EDU>
27 Jul 1998 11:48:20 -0400

          From comp.compilers

Related articles
yacc - rules of thumb for speed of parsing? dgh2@Ra.MsState.EDU (Daniel G. Hyams) (1998-07-27)
Re: yacc - rules of thumb for speed of parsing? thetick@magelang.com (Scott Stanchfield) (1998-07-27)
| List of all articles for this month |

From: "Daniel G. Hyams" <dgh2@Ra.MsState.EDU>
Newsgroups: comp.compilers
Date: 27 Jul 1998 11:48:20 -0400
Organization: Mississippi State University
Keywords: yacc, performance

I am constructing a grammar with Berkley yacc, and I want
the generated parser to run as fast as possible; size of
the parser is not a concern.

I noticed that the flex manual gives some tips for creating
a fast lexer (for example, not using REJECT, eliminating
backing-up, etc.). I was wondering if there were similar
rules-of-thumb for yacc, so that the parser would run as
fast as possible.

Daniel G. Hyams
email: dhyams@ebicom.net
phone: (601) 323-4198
[I suspect that unless you have an extremely complex grammar, you'll
find your parser spending more time in your action code than in the
parsing itself. If you look through the archives, a while ago someone
hacked up yacc to open code all the parse tables as large switch
statements. It's faster, but I wouldn't immediately conclude that it's
enough faster to make any practical difference. -John]


Post a followup to this message

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