mark@sickkids.UUCP (Mark Bartelt) (04/13/89)
OK, yaccers, here's a quickie question. I have a grammar that causes UNIX yacc (on a VAX, running 4.3bsd) to choke. It bombs out with the following error message: fatal error: default action causes potential type clash, line xxx Curiously, the very same grammar is accepted without complaint by MKS's yacc for MS-DOS, which (as far as I can tell) produces code that does what it's supposed to do. I've RTFMed, but the FM isn't terribly helpful here. I've also looked briefly at the source code, which, to put it mildly, is a bit cryptic, at least for someone unfamiliar with the internals of yacc. I doubt that anyone wants to see the entire 300 or so lines of my yacc grammar, but can anyone provide a brief explanation of what yacc may be complaining about, and what the error message really means? And, for that matter, why the UNIX yacc complains about something that's quite acceptable to the MKS yacc? Is it likely that I've botched the grammar, or is it possible that there's a bug in 4.3bsd yacc? Or is the MKS yacc at fault for not catching something that the 4.3bsd yacc properly complains about? Thanks in advance. ----- Mark Bartelt UUCP: {utzoo,decvax}!sickkids!mark Hospital for Sick Children, Toronto BITNET: mark@sickkids.utoronto 416/598-6442 INTERNET: mark@sickkids.toronto.edu
ka@june.cs.washington.edu (Kenneth Almquist) (04/15/89)
mark@sickkids.UUCP (Mark Bartelt) writes: > [Message from YACC:] > fatal error: default action causes potential type clash, line xxx When you omit an action, YACC supplies the default action {$$ = $1}. You get the above message if $$ and $1 have different types. The line number may refer to the start of the rule following the rule that is in error. Kenneth Almquist
scjones@sdrc.UUCP (Larry Jones) (04/15/89)
In article <255@sickkids.UUCP>, mark@sickkids.UUCP (Mark Bartelt) writes: > OK, yaccers, here's a quickie question. I have a grammar that causes > UNIX yacc (on a VAX, running 4.3bsd) to choke. It bombs out with the > following error message: > > fatal error: default action causes potential type clash, line xxx > > Curiously, the very same grammar is accepted without complaint by MKS's > yacc for MS-DOS, which (as far as I can tell) produces code that does > what it's supposed to do. The problem is that the type of the right-hand side of the grammar rule is different than the type of the left-hand side of the grammar rule, thus the default action ($$ = $1;) contains a type clash of some sort. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@sdrc.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150 AT&T: (513) 576-2070 "When all else fails, read the directions."