Chapter 4: Syntax Analysis

Notes

. This method of parsing is called SLR (Simple LR)

. LR parsers accept LR(k) languages

- L stands for left to right scan of input

- R stands for rightmost derivation

- k stands for number of lookahead token

. SLR is the simplest of the LR parsing methods. SLR is too weak to handle most languages!

. If an SLR parse table for a grammar does not have multiple entries in any cell then the grammar is unambiguous

. All SLR grammars are unambiguous

. Are all unambiguous grammars in SLR?

This parsing method is called SLR which stands for Simple LR. LR parsers accept LR ( k ) languages. Here, L stands for left to right scan of input, R stands for rightmost derivation and k stands for number of look ahead tokens. SLR parsing is the simplest of all parsing methods. This method is weak and cannot handle most of the languages. For instance, SLR parsing cannot handle a language which depends not only on top of stack but the complete stack. Also, look ahead symbols cannot be handled by SLR parser.

If an SLR parse table for a grammar does not have multiple entries in any cell then the grammar is unambiguous. All SLR grammars are unambiguous but all unambiguous grammars are not in SLR.