Re: Practical LALR(1) grammer?

"Andrew Wilson" <bluemalov@hotmail.com>
13 Jun 2005 17:57:50 -0400

          From comp.compilers

Related articles
Practical LALR(1) grammer? weltraum@astrocat.de (2005-06-12)
Re: Practical LALR(1) grammer? haberg@math.su.se (2005-06-13)
Re: Practical LALR(1) grammer? haberg@math.su.se (2005-06-13)
Re: Practical LALR(1) grammer? bluemalov@hotmail.com (Andrew Wilson) (2005-06-13)
Re: Practical LALR(1) grammer? d148f3wg02@sneakemail.com (Karsten Nyblad) (2005-06-16)
Re: Practical LALR(1) grammer? haberg@math.su.se (2005-06-18)
| List of all articles for this month |
From: "Andrew Wilson" <bluemalov@hotmail.com>
Newsgroups: comp.compilers
Date: 13 Jun 2005 17:57:50 -0400
Organization: TDC Totalloesninger
References: 05-06-074
Keywords: LALR, parse
Posted-Date: 13 Jun 2005 17:57:50 EDT

<weltraum@astrocat.de> wrote
> I don't understand the "magic" of LALR(1) yet (in contrast to SLR(1) ),


Hi,


Check out page 229 (and onwards) of the dragon book. The following
grammar is LALR but not SLR.


S -> L = R
S -> R
L -> * R
L -> id
R -> L


In this case R and L stand for r-value and r-value, respectively.


Basically ..... "the SLR method is not powerful enough to remeber enough
left context to decide what action the parser should take on input = having
seen a string reducible to L" ...


Andrew


Post a followup to this message

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