Re: An "open" letter to Karsten Nyblad (and other compiler compiler implementors)

SM Ryan <wyrmwif@tsoft.org>
24 Jun 2005 14:11:59 -0400

          From comp.compilers

Related articles
An "open" letter to Karsten Nyblad (and other compiler compiler implem cfc@shell01.TheWorld.com (Chris F Clark) (2005-06-18)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im vtsikoza@yahoo.com (2005-06-21)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im wyrmwif@tsoft.org (SM Ryan) (2005-06-22)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) (2005-06-23)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im cfc@shell01.TheWorld.com (Chris F Clark) (2005-06-23)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im wyrmwif@tsoft.org (SM Ryan) (2005-06-24)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im vtsikoza@yahoo.com (2005-06-24)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im wyrmwif@tsoft.org (SM Ryan) (2005-06-24)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im cfc@shell01.TheWorld.com (Chris F Clark) (2005-06-24)
Re: An "open" letter to Karsten Nyblad (and other compiler compiler im schmitz@i3s.unice.fr (Sylvain Schmitz) (2005-06-26)
| List of all articles for this month |

From: SM Ryan <wyrmwif@tsoft.org>
Newsgroups: comp.compilers
Date: 24 Jun 2005 14:11:59 -0400
Organization: Quick STOP Groceries
References: 05-06-119
Keywords: LR(1), parse, LALR
Posted-Date: 24 Jun 2005 14:11:59 EDT

vtsikoza@yahoo.com (Vit) wrote:


# By the way, yet Aho and Ullman notice that any LR(k>0) language is in
# fact LR(1). (The dumb conversion only produces too many artificial
# production rules).


More accurately, any deterministic language has an LR(1) grammar. But
there is no algorithm to convert any LR(k), k>1, grammar to an LR(1)
grammar. LR(2) grammars show up for things like labels and some ways
of doing declarations when you have "id op" and then choose to reduce
or shift based on what follows op.


LALR grammars are sensitive to null productions where LR(k) skips over
the empty space without a problem. That's significant for yacc where
you can insert semantics before the reduce: put the semantics before
enough left symbols have been shifted to identify the productions and
LALR fails to build the parser.


--
SM Ryan http://www.rawbw.com/~wyrmwif/
Raining down sulphur is like an endurance trial, man. Genocide is the
most exhausting activity one can engage in. Next to soccer.


Post a followup to this message

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