Orphaned Response

Richard Draves draves at harvard.ARPA
Sun Jan 27 07:02:30 AEST 1985


> /***** 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



More information about the Comp.lang.c mailing list