Compiler Design and Construction - Old Questions

4.  Construct SLR parse table for the following grammar.

        

6 marks | Asked in 2075

The augmented grammar of given grammar is:

S' → S

→ E

→ E+T | T

→ T*F | F

→ id

Next, we obtain the canonical collection of sets of LR(0) items, as follows,