Why context-free?

nmm1@cus.cam.ac.uk (Nick Maclaren)
6 Oct 2005 18:51:03 -0400

          From comp.compilers

Related articles
Why context-free? nmm1@cus.cam.ac.uk (2005-10-06)
Re: Why context-free? cfc@shell01.TheWorld.com (Chris F Clark) (2005-10-07)
Re: Why context-free? torbenm@app-4.diku.dk (2005-10-07)
Re: Why context-free? rsc@swtch.com (Russ Cox) (2005-10-07)
Re: Why context-free? bobduff@shell01.TheWorld.com (Robert A Duff) (2005-10-07)
Re: Why context-free? nmm1@cus.cam.ac.uk (2005-10-08)
Re: Why context-free? vidyut.vidyut@gmail.com (2005-10-08)
[45 later articles]
| List of all articles for this month |

From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers
Date: 6 Oct 2005 18:51:03 -0400
Organization: University of Cambridge, England
Keywords: parse, question, comment
Posted-Date: 06 Oct 2005 18:51:02 EDT

I have been thinking about a programming language, and have good
reasons to abandon context-free grammars completely. So what I am
asking is what reasons are there to favour them - I know of the

        1) Dogma. Let's skip that.

        2) Efficient, easy to write parsers. That is no longer a major
issue, and I can deliver that in other ways.

        3) Diagnosability of errors. I can deliver that in other ways.

So WHY should I use a context-free grammar? Good reasons appreciated.

Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679
[The best argument I've heard is that to a first approximation, CFGs
match languages that people can understand. Of course, since I write
everything in perl these days, I suppose I don't believe that, either.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.