[net.unix] Yacc mystery errors

covey@uiucdcs.Uiuc.ARPA (07/13/85)

Can anyone out there help me with a problem I have been having with the Yacc
utility?

The problem is this:
	
	I have been using Yacc to try to build a parser for a new language.
	In the y.output produced I get several "shift-reduce" and 
	"reduce-reduce" conflicts.  That's ok because I know how to deal
	with most of them.  

	However, I also get many "Rule not Reduced" errors and I haven't
	the vaguest idea what these are caused by or how to correct them.
	I haven't been able to find any documentation on this error anywhere.

Has anyone else encountered this problem?  If so does anybody know how to get
rid of these errors.  If there is any documentation on the subject I would
love to know about it.  

Thanks for your help.  You can either reply here in the notes files or send
me mail at the addresses listed below.

				Nancy Elizabeth Covey
				University of Illinois at Urbana-Champaign



covey@uiuc.ARPA		(via ARPAnet)
covey@uiuc.csnet	(via CSNET)
ihnp4!uiucdcs!covey or
pur-ee!uiucdcs!covey	(via USENET)

Or you can send mail the old fashioned way (I know--perish the thought!) to

		Nancy Covey
		1211 W. Church apt.1
		Champaign, ILL 61820

Guten Tag!

andrew@orca.UUCP (Andrew Klossner) (07/16/85)

The yacc error message "rule not reduced" means that yacc determined
that no program would ever parse using that rule.  This is usually
because either the left hand side of that rule does not appear in any
right hand side or because you have shift/reduce or reduce/reduce
errors.  You should always clear up all your */reduce errors before
worrying about "rule not reduced" errors.

(It's bad practice to leave the shift/reduce errors in and trust yacc
to do the right thing; you can almost always eliminate the error
without rewriting the grammar by specifying additional precedence.)

  -=- Andrew Klossner   (decvax!tektronix!orca!andrew)       [UUCP]
                        (orca!andrew.tektronix@csnet-relay)  [ARPA]