|NEED HELP W/ IF-THEN-ELSE IN YACC firstname.lastname@example.org (1990-04-26)|
|Organization:||California State University, Chico|
|Date:||Thu, 26 Apr 90 23:48:20 GMT|
we have it defined as:
Does anybody know a way to fix it so it does not give us a shift/reduce error?
(Right now, we get one shift/reduce error with the method mentioned above.)
[This is the dangling else ambiguity, the absolute most classic and well-known
syntactic ambiguity encountered in common programming languages. Aho, Sethi,
and Ullman discuss it a length in chapter 4 of their Compilers book. The
short answer is that you can either leave it alone, since yacc's resolution of
the conflict happens to be the right one, or else add more productions. -John]
Return to the
Search the comp.compilers archives again.