1. How do SLR(1), LR(1) and LALR(1) methods compare against each other in the process of constructing the parsing table from the grammar? Draw a set diagram depicting the applicability of SLR(1), LR(1) and LALR(1) methods on the grammars.
2. How does the error detection and error recovery happen in LR parsing? Illustrate with an example.
3. Add error detection and recovery capabilities to the LR parser developed in 3.21.
4. Distinguish between a syntax error and a semantic error by providing an example.