Yacc reduce/reduce conflict: summary

Jeffrey W Percival jwp at larry.sal.wisc.edu
Sat Sep 9 00:30:04 AEST 1989


In article <718 at larry.sal.wisc.edu> I write:
>279: reduce/reduce conflict (red'ns 128 and 151 ) on INCLUDE
>state 279
>	cmd_parameter :  MNEMONIC = MNEMONIC_    (128)
>	arg :  MNEMONIC_    (151)
>
>	.  reduce 128

I received many helpful responses, addressing both this problem
and yacc errors in general, and have learned a great deal.

Paul DuBois pointed out that the ambiguity was whether to reduce rule 128,
or to reduce rule 151 and transform rule 128's "MNEMONIC = MNEMONIC"
into "MNEMONIC = arg".

Mike Anthis took this a step further, and told me to look for another
rule of the form "cmd_parameter: MNEMONIC = arg;" which in fact I found,
as he predicted.

Thanks also to Roger Nelson for a nice list of easily-made errors.

A final note:  a number of people worried about the lack of quotes
around the '=' sign...  sorry for not being more clear in my original
posting, but I posted a fragment of my y.output file, which is produced
by yacc from my input.  In the y.output file, yacc removes quotes
from characters.  My input was properly quoted.

Thanks very much for the input.
-- 
Jeff Percival (jwp at larry.sal.wisc.edu)



More information about the Comp.unix.wizards mailing list