Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sdcc3.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!hao!hplabs!sdcrdcf!sdcsvax!sdcc3!85488116 From: 85488116@sdcc3.UUCP (Oliver Boliver Butt) Newsgroups: net.lang.c Subject: Re: $ in identifiers -- poll Message-ID: <2546@sdcc3.UUCP> Date: Wed, 12-Dec-84 09:35:49 EST Article-I.D.: sdcc3.2546 Posted: Wed Dec 12 09:35:49 1984 Date-Received: Sat, 15-Dec-84 02:21:36 EST References: <3@aeolus.UUCP> <260@sftri.UUCP>, <3281@mit-eddie.UUCP> <4758@utzoo.UUCP> Organization: U.C. San Diego, Academic Computer Center Lines: 23 > For what it's worth, the current ANSI C draft (12 Nov 1984) says that > dollar signs aren't in C's vocabulary at all (except for the usual > exemption for comments and strings), but adds the following in the > "Common extensions" discussion in appendix E: > > E.4.4.1 Specialized identifiers > > Characters other than the underscore _, letters, and digits, that > are not defined in the required source character set (such as the > dollar sign $) may appear in an identifier. * Yacc uses $$ and $n to allow for manipulations on its parsing stack. In this case, $$ & $n are used as pseudo identifiers for the stack in the C code actions which get executed when a rule gets reduced. Therefore, there is an ambiguity problem with yacc and the proposed $ operators when you try to compile the code yacc generates. So you either have to change yacc, or forget about the $ ops. Paul van de Graaf U. C. San Diego sdcsvax!sdcc3!85488116 * If you don't know, yacc stands "for yet another compiler compiler" It is a tool which generates a compiler given a LR(1) grammar and some supporting code that the programmer writes.