Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!crdgw1!underdog!volpe From: volpe@underdog.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Re: 'C', is it's grammar context sensitive ? Message-ID: <11301@crdgw1.crd.ge.com> Date: 23 Aug 90 23:40:11 GMT References: <1990Aug23.164905.10261@NCoast.ORG> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@underdog.crd.ge.com (Christopher R Volpe) Lines: 23 A couple of points: Of course it's context sensitive. It's also context free. The set of context sensitive grammars is a proper superset of the set of context free grammars. I assume what you wanted to know is whether it is context sensitive but NOT context free. The answer to this is NO. The grammar is indeed ambiguous, but it is certainly context free, because all the productions have only one non-terminal on the Left Hand Side. Whether or not a grammar is context free depends only on the structure of the productions. To disambiguate the grammar, typedef_name must be a token returned by the lexical analyzer. Naturally, this means that the lexical analyzer, when it sees what looks like an identifier, has to check with the symbol table to see if it has already been declared as a typedef name in order to determine what token to return to the parser. ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com