PCC compiler question - (nf)

utzoo!decvax!cca!ima!johnl utzoo!decvax!cca!ima!johnl
Fri Apr 1 03:27:48 AEST 1983


#R:watarts:-176200:ima:15900004:000:680
ima!johnl    Mar 31 11:32:00 1983

Let's drive a stake through the heart of this one, once and for all.

       a && b *= c;                     (1)

should not be the same as:

       if (a) b *= c;                   (2)

because, since && binds tighter than *=, the only correct parse is:

	(a && b) *= c;                  (3)

which is semantically meaningless.  PCC interprets it as (2), due to
a bug in yacc.  (PCC uses a yacc parser, if you didn't know.)  Yacc is
unlikely to be fixed, since it is a fairly obscure implementation of the
LALR parser generation algorithm which is itself pretty confusing.

John Levine, decvax!yale-co!jrl, ucbvax!cbosgd!ima!johnl,
{research|alice|rabbit|floyd|amd70}!ima!johnl




More information about the Comp.lang.c mailing list