Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!cullvax!drw From: drw@cullvax.UUCP (Dale Worley) Newsgroups: net.lang Subject: Re: Faster parser driver for yacc? Message-ID: <362@cullvax.UUCP> Date: Tue, 7-Oct-86 11:56:12 EDT Article-I.D.: cullvax.362 Posted: Tue Oct 7 11:56:12 1986 Date-Received: Wed, 8-Oct-86 06:35:20 EDT References: <2250001@hpfclq.HP.COM> Organization: Cullinet Software, Inc., Westwood, MA Lines: 21 > Does anyone have any guidelines on how the structure of the input grammar > will affect the efficiency of the resulting parser (eg, number of > levels of non-terminal, etc.)? Avoid productions like a : b ; if possible. It helps to use precedence rules with an ambiguous grammar. Thus you can write things like expr : expr '+' expr | expr '*' expr | '-' expr | '(' expr ')' ; and use precedence rules to sort things out. This avoids alot of nonterminals whose sole purpose is keeping the precedences straight. Dale