Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!unmvax!bbx!bbxsda!scott From: scott@bbxsda.UUCP (Scott Amspoker) Newsgroups: comp.lang.c Subject: Re: 'C', is it's grammar context sensitive ? Message-ID: <999@bbxsda.UUCP> Date: 23 Aug 90 21:02:20 GMT References: <1990Aug23.164905.10261@NCoast.ORG> Reply-To: scott@bbxsda.UUCP (Scott Amspoker) Organization: Basis International, Albuquerque, NM Lines: 18 In article <1990Aug23.164905.10261@NCoast.ORG> ramsey@NCoast.ORG (Cedric Ramsey) writes: >I was studying the grammar for the 'C' language and I couldn't >help but notice that for declarations the grammar is context sensitive. >Look at this here: > >[declarations deleted] It is my experience in parsing a language that is similar to C that the lexical analyser must be "symbol-table-aware". In C you can get into a sticky situation with typenames being used in declarations and casts. If you are using a yacc-like parser, a typename should be something other than a generic IDENTIFIER to avoid ambiguities. -- Scott Amspoker Basis International, Albuquerque, NM (505) 345-5232 unmvax.cs.unm.edu!bbx!bbxsda!scott