Compiler Construction Problem CFG

profilehwm1024

 

Consider the CFG G:

(1) S - aSbA

(2) S - bA

(3) A - aA

(4) A - b

1. Transform G into PDA simulating the reverse of the rightmost derivation of G.

2. Construct the LR(1) item-sets for G.

3. Construct the LR(1) parse table for G.

4. Run the LR(1) parser for G on the input abbbab to find an accepting computation.

5. Construct the LALR parse table for G.

6. Construct the SLR parse table for G.

    • 7 years ago
    • 8
    Answer(0)