What is the difference between LR, SLR, and LALR parsers?

Posted by equilibrium on Stack Overflow See other posts from Stack Overflow or by equilibrium
Published on 2010-04-20T14:55:52Z Indexed on 2010/04/20 15:23 UTC
Read the original article Hit count: 401

Filed under:
|
|

What is the actual difference between LR, SLR, and LALR parsers? I know that SLR and LALR are types of LR parsers, but what is the actual difference as far as their parsing tables are concerned?

And how to show whether a grammar is LR, SLR, or LALR? For an LL grammar we just have to show that any cell of the parsing table should not contain multiple production rules. Any similar rules for LALR, SLR, and LR?

For example, how can we show that the grammar

S --> Aa | bAc | dc | bda
A --> d

is LALR(1) but not SLR(1)?

© Stack Overflow or respective owner

Related posts about parsers

Related posts about grammar