precedence of && (was: precedence of ?:)

Dave Jones djones at megatest.UUCP
Fri Sep 15 11:59:30 AEST 1989


>From article <1989Sep14.181049.8175 at twwells.com), by bill at twwells.com (T. William Wells):

) 
) : (If I ever write a C compiler, I'm going to use precedence, and if
) : anybody ever complains that they got an "L-value" error message when they
) : distinctly asked for a "syntax" error message, maybe I'll offer to wash
) : their car.)
) 
) I wrote a precedence parser for C expressions. It was a mass of
) kludges on top of fudges. I threw it away. C is just not specifiable
) by precedence.
) 

You misunderstand my intensions. I agree that precedence parsers are
obsolete.  By "use precedence"  I just refer to disambiguation rules
such as the yacc %left and %prec directives. They make life easy and
LR tables short. Take a peek a the cgram.y file in the source of the
so called "portable" C compiler, if you dare. It may not be pretty,
but it would be even not prettier if it were not for the precedence
rules.



More information about the Comp.lang.c mailing list