Re: Anyone got an LALR(2) parser-generator ?

Martin.Jourdan@inria.fr (Martin Jourdan)
Mon, 11 Sep 1995 07:42:26 GMT

          From comp.compilers

Related articles
Anyone got an LALR(2) parser-generator ? lindsay-j@rmc.ca (1995-08-25)
Re: Anyone got an LALR(2) parser-generator ? Martin.Jourdan@inria.fr (1995-09-04)
Re: Anyone got an LALR(2) parser-generator ? BARRETO%VELAHF@ECCSA.Tr.Unisys.com (1995-09-04)
Re: Anyone got an LALR(2) parser-generator ? Thomas.Herter@mch.sni.de (1995-09-04)
Re: Anyone got an LALR(2) parser-generator ? Martin.Jourdan@inria.fr (1995-09-11)
Re: Anyone got an LALR(2) parser-generator ? farzu@uvg.edu.gt (1995-09-18)
Re: Anyone got an LALR(2) parser-generator ? grosch@cocolab.sub.com (1995-10-30)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Martin.Jourdan@inria.fr (Martin Jourdan)
Keywords: parse, LR(1)
Organization: Projet Charme, INRIA, Rocquencourt, France
References: 95-09-009 95-09-055
Date: Mon, 11 Sep 1995 07:42:26 GMT

BARRETO%VELAHF@ECCSA.Tr.Unisys.com wrote :


> Although it is quite common to find non-LALR(1) constructs in
> programming language grammars, in most cases they are easily (?)
> removed by rewriting the grammar.


Of course this is true: AFAIK, there is a theorem that states that every
language that has an LR(k) grammar also has an LR(1) grammar. The main
problem when applying such grammar transformations is that the resulting
grammar may be quite far from the "natural" grammar and make semantic
processing quite awkward. I guess this is part of the "couple of very good
reasons" the original poster invoked for justifying his need.


In some sense, this is similar to the high-level programming language
debate: you can write any program in assembly language, it's just much
simpler and more natural in Pascal, C, ML, you name it. You can describe
any language with an LR(1) grammar, it's just much simpler and more
natural when you don't have to bother with the "k" in LR(k).


                                                                                Martin Jourdan


Action Charme, INRIA, Rocquencourt, France
Phone +33-1-39-63-54-35, fax +33-1-39-63-56-98, Martin.Jourdan@inria.fr
--


Post a followup to this message

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