Monday, 5 June 2017

Basic difference between LR(0) and SLR(1)?


                   In LR(0), for a closure which has item of the form (A->BCD.) i.e. item which has Dot at the end, we have to add Reduce action for all terminals. That is why, it is also called to have zero Lookahead symbol.
                 While in SLR(1), for a closure which has item of the form (A->BCD.) i.e. item which has Dot at the end, we have to add Reduce action for FOLLOW(A) terminals. That is the only difference between LR(0) and SLR(1). 

No comments:

Post a comment