'C', is it's grammar context sensitive ?

Scott Amspoker scott at bbxsda.UUCP
Fri Aug 24 07:02:20 AEST 1990


In article <1990Aug23.164905.10261 at NCoast.ORG> ramsey at 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



More information about the Comp.lang.c mailing list