Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cyb-eng.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!ut-sally!oakhill!cyb-eng!howard From: howard@cyb-eng.UUCP (Howard Johnson) Newsgroups: net.sources.bugs Subject: Re: L-values vs. Yacc and Lex for 11/12/84 draft of ANSI C Message-ID: <558@cyb-eng.UUCP> Date: Fri, 24-May-85 04:58:42 EDT Article-I.D.: cyb-eng.558 Posted: Fri May 24 04:58:42 1985 Date-Received: Mon, 3-Jun-85 04:28:43 EDT References: <831@genrad.UUCP> Organization: Cyb Systems, Austin, TX Lines: 25 There is a deficiency in the Yacc/Lex grammar for the 11/12/84 draft of ANSI C posted to mod.sources recently. It has to do with the concept of l-values, namely: statements such as those shown below which are given to the parser do not generate syntax errors, requiring semantic interpretation to flag these errors. main() { char *foo; foo = "hello, world"++; sizeof(int) = 3; } Now I personally would not like to see increment/decrement operators used legitimately on arbitrary r-values, as this would affect the semantic meaning of those operators. The rest of the grammar seems to be all right; there is just one intentional shift/reduce conflict with the dangling-else construct of C, and no dependence on %prec declarations. L-values shouldn't be hard to add to the grammar. Having the lexical analyzer ignore spurious characters (such as '$') seems peculiar, but that is another subject.