Path: utzoo!attcan!uunet!cs.utexas.edu!hellgate.utah.edu!mailrus!accuvax.nwu.edu!nucsrl!tsaim From: tsaim@eecs.nwu.edu (Ming-Hsiun Tsai) Newsgroups: comp.unix.wizards Subject: Re: yacc reduce/reduce conflict question Message-ID: <13030009@eecs.nwu.edu> Date: 6 Sep 89 20:17:08 GMT References: <718@larry.sal.wisc.edu> Organization: Northwestern U, Evanston IL, USA Lines: 64 Dear Jeff: The error message on our system is not the same as on your system. So, I mis-understand that MNEMONIC_ is a (non-)terminal sysbol. I do the two tests below. The first one is the one like yours (I hope I do not make any mistake this time). Also I append the error message I get from my system. The second one is a correct one (YACC does not say anything wrong). Comparing the two. I think the problem is the "=" symbol in the rules. I don't know if "=" has special meaning translated by yacc. I have no yacc manual on hand. If you have, check it out. Conclusion: add "'" on both sides of "=". Try it. Hope it work for you. Good luck. Ming-Hsiun Tsai (Sep. 6, 1989) ---------------------- Example 1. An error demo ------------------------------ %token MNEMONIC %start all %% all : cmd_parameter | arg ; cmd_parameter : MNEMONIC = MNEMONIC ; arg : MNEMONIC ; %% ------------------------------------------------------------------------------- 1 rules never reduced conflicts: 1 reduce/reduce --------------- Example 2. This one may give you some ideas ------------------ %token MNEMONIC %start all %% all : cmd_parameter | arg ; cmd_parameter : MNEMONIC '=' MNEMONIC ; arg : MNEMONIC ; %% -------------------------------------------------------------------------------