Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!tektronix!tekcrl!tekchips!stevev From: stevev@tekchips.LABS.TEK.COM (Steve Vegdahl) Newsgroups: comp.lang.misc Subject: Re: Language Design Summary: let's stop picking nits Message-ID: <3746@tekcrl.LABS.TEK.COM> Date: 23 Mar 89 19:24:57 GMT References: <5200040@m.cs.uiuc.edu> <12443@watdragon.waterloo.edu> <9122@claris.com> Sender: ftp@tekcrl.LABS.TEK.COM Lines: 23 In article <9122@claris.com>, hearn@claris.com (Bob Hearn) writes: > Enough of this bullshit! How many times do I have to say it??? The grammar > in K&R is context-free. ... > Now, before anyone else wants to tell me that K&R's grammar for C is not > context-free, will you *please* go and look up the definition of context-free > grammar??? Hint: anything that can be expressed in BNF is context-free!! I detect that we are picking nits here. I think that we all know what is meant by the claim that the K&R grammar is not context-free. It has been noted that the K&R grammar is *ambiguous*; hence, its specification of how programs should be parsed is *ill-defined*. Additional "context-sensitive" specifications are added to the K&R grammar in the form of English prose (in the second edition, anyway; the first edition seems to ignore the ambiguity problem). Effectively, the grammar in K&R is "BNF + English prose". Taking this view, the K&R grammar is not context-free. Steve Vegdahl Computer Research Lab Tektronix Labs Beaverton, Oregon