Re: Why context-free? (Nick Maclaren)
19 Oct 2005 02:34:28 -0400

          From comp.compilers

Related articles
[13 earlier articles]
Re: Why context-free? (2005-10-13)
Re: Why context-free? (Chris F Clark) (2005-10-13)
Re: Why context-free? (Neelakantan Krishnaswami) (2005-10-13)
Re: Why context-free? (Darius Blasband) (2005-10-13)
Re: Why context-free? (2005-10-14)
Re: Why context-free? (Darius Blasband) (2005-10-19)
Re: Why context-free? (2005-10-19)
Re: Why context-free? (2005-10-19)
Re: Why context-free? (2005-10-20)
Re: Why context-free? find@my.address.elsewhere (Matthias Blume) (2005-10-23)
Re: Why context-free? (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen) (2005-10-23)
Re: Why context-free? (2005-10-23)
Re: Why context-free? (2005-10-26)
[7 later articles]
| List of all articles for this month |

From: (Nick Maclaren)
Newsgroups: comp.compilers
Date: 19 Oct 2005 02:34:28 -0400
Organization: University of Cambridge, England
References: 05-10-053 05-10-055 05-10-064 05-10-070 05-10-074
Keywords: parse, errors
Posted-Date: 19 Oct 2005 02:34:28 EDT

Tony Finch <> writes:
|> The impression I got from reading the revised report on Algol 68 was that
|> the grammar involved a lot of fiddly programming at the wrong level of
|> abstraction - it wasted effort on recursive definitions of numerals, for
|> example. A good formalism should make things clearer, but the vW grammaer
|> is just obscure. Furthermore it has a reputation for being brittle - the
|> grammar was difficult to change as the language was refined.

As someone who used it a fair amount, in several different variants, I
agree with that. Given my complete failure to find a comprehensible
description of that type of grammar, my suspicion is that it should be
regarded as a blind alley.

[ And to Chris Clark ]

Yes, attributes are good, but I react against making them part of the
'active' syntax - i.e. I feel that they are better used to impose
constraints and improve diagnostics than allow alternative syntax.
Others may disagree.

> Trying to put types directly into a grammar is a disaster. It makes
> the grammar grow exponentially. That's the general failure of VW
> grammars--such grammars are a way of succinctly describing the
> explosion. Unfortunately, when one is actually parsing with them, one
> has to explode them.

But, if you start to use attributes for 'active' syntax, you have to
explode THEM (directly or indirectly)! TANSTAAFL.

However, I fully agree that you need some way of controlling the
exponential explosion. You can't JUST add types to a traditional
design and expect things to work.

Nick Maclaren.

Post a followup to this message

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