[comp.lang.misc] Language Specification

hankd@pur-ee.UUCP (Hank Dietz) (03/25/89)

In article <89Mar23.094504est.4328@turing.toronto.edu> holt@turing.toronto.edu (Ric Holt) writes:
[stuff as to CFGs needing a finite set of terminals, and the K&R grammar having
 an infinite set of terminals.]
>
>This question (is C's grammar context free) is 
>important and we should get a clear answer to it rather than outbursts.
>Could someone please settle this definitely?
>		Ric Holt


Clever thought, but wrong.  The *grammar* in K&R only talks of terminals
which are taken from a finite set of lexical types, not of the inifinite set
of possible lexemes whose structure is defined within the surrounding text
but not in the grammar.

In as much as it is given, the grammar for C in K&R IS context free; some of
the stuff defined in the text around it might not be (e.g., lexical
analysis), but the whole issue isn't worth this network bandwidth.  C is
easily parsed using any of LL(1), LALR(1), etc., with only the usual lexical
trickery (AKA the usual symbol table mechanism).

						-hankd@ee.ecn.purdue.edu