Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!draves From: draves@harvard.ARPA (Richard Draves) Newsgroups: net.lang.c Subject: Re: Orphaned Response Message-ID: <331@harvard.ARPA> Date: Sat, 26-Jan-85 16:02:30 EST Article-I.D.: harvard.331 Posted: Sat Jan 26 16:02:30 1985 Date-Received: Mon, 28-Jan-85 07:35:15 EST References: <-2098002300@cmu-cs-k.UUCP> <4000001@hpgrla.UUCP> Organization: Aiken Computation Laboratory, Harvard Lines: 30 > /***** hpgrla:net.lang.c / cmu-cs-k!tim / 12:54 am Dec 11, 1984*/ > Subject: Re: PCC and typedefs (why it barfs) > > The reason, incidentally, that PCC can't handle typedef identifiers properly > is that they are recognized by the lexical analysis, not as identifiers, but > as type keywords (like "int", etc.) > /***/ > > It seems to me that in reading the recent ANSI C draft for the language, > they are proposing doing exactly what you describe above. They have an entry > in their YACC source for TYPEDEF instead of INDENTIFIER. This makes the YACC > easier but may not do what people want for scoping. > > Refer to the YACC source posted to net.sources. > > Dave Ellis / HEWLETT-PACKARD > hpda!hpfcla!hpgrla!davee Recognizing typedef identifiers in the lexxer does not make it impossible to scope them properly; the parser should set a flag when it wants to disable this recognition. PCC sets this flag in the wrong places. Incidentally, I have never seen any other way of handling typedefs. Rich -- "If I am conceited, it is the conceit of an amazing man who has never found any surpassing himself." Al-Mutanabbi