yacc reduce/reduce conflict question

Bill Fulton [Sys Admin] itwaf at dcatla.UUCP
Sat Sep 9 08:07:40 AEST 1989


To recap; erroneous yacc input was:
 cmd : MNEMONIC = MNEMONIC ;
                ^
                Note missing quotes

I also sent the original poster this fix; but I was very surprised at the
way yacc handled the unquoted equals sign. Apparantly, when the '=' was not
quoted, yacc just *ignored* everything from the '=' to the end of the line!
This explains the conflict, but can anyone explain why yacc (apparantly)
ignores the part of a rule from an unquoted '=' to the end of line??? Does it
do this with other unquoted characters? Is an unquoted '=' special?
That's scary (e.g. silently dropping the end of a rule).

I tried different unquoted characters than a '=', and I got yacc errors, but NO
error with the unquoted '='! Also, looking at the output of 'yacc -v', I noted
that the rule for the input line with the unquoted '=' had, indeed, just
truncated the rule, starting at the '='.

waf
(Saving the net millions of dollars by not having a .sig)
(Oops - does this count?)



More information about the Comp.unix.wizards mailing list