SLR and LR(1) Differences: A Recap

"Vladimir Lushnikov" <vladimir.d.lushnikov@gmail.com>
10 Aug 2006 15:48:19 -0400

          From comp.compilers

Related articles
SLR and LR(1) Differences: A Recap vladimir.d.lushnikov@gmail.com (Vladimir Lushnikov) (2006-08-10)
Re: SLR and LR(1) Differences: A Recap momchil.velikov@gmail.com (momchil.velikov@gmail.com) (2006-08-12)
Re: SLR and LR(1) Differences: A Recap torbenm@app-4.diku.dk (2006-08-14)
Re: SLR and LR(1) Differences: A Recap vladimir.d.lushnikov@gmail.com (Vladimir Lushnikov) (2006-08-18)
Re: SLR and LR(1) Differences: A Recap luvisi@andru.sonoma.edu (Andru Luvisi) (2006-08-19)
Re: SLR and LR(1) Differences: A Recap rda@lemma-one.com (Rob Arthan) (2006-10-03)
| List of all articles for this month |
From: "Vladimir Lushnikov" <vladimir.d.lushnikov@gmail.com>
Newsgroups: comp.compilers
Date: 10 Aug 2006 15:48:19 -0400
Organization: http://groups.google.com
Keywords: LR(1), parse
Posted-Date: 10 Aug 2006 15:48:18 EDT

Hello,


I almost feel bad about asking this (but I've only recently learnt both
methods) - but now that I know how the LR(1) algorithm works I am
almost forgetting the difference between it and the SLR algorithm.


SLR uses FOLLOW sets to predict when to reduce by a production. And
conflicts arise at the point where, after a . in other SLR items the
tokens in FOLLOW(current_item) and in FIRST intersect. Yes?


And LR(1) uses ACTION and GOTO tables to do the same thing. (I'm not
going into the algorithm for constructing the tables.)


I guess my question is how the SLR tables are constructed compared to
LR(1) tables and how they differ?


Many thanks,
Vladimir Lushnikov



Post a followup to this message

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