CSCI 5220
Spring 2016
Practice Questions for Exam 4

  1. What are the FIRST and FOLLOW sets for the following augmented grammar? The start nonterminal is E′.

    0. EE
    1. EA
    2. EL
    3. An
    4. Ai
    5. L( S )
    6. SE , S
    7. SE

    Answer

  2. Build the LR(0) finite-state machine for the grammar of the preceding problem, showing the full set of LR(0) items in each state. Number the states.

    Answer

  3. Show the SLR(1) parsing table for the grammar from the preceding problem, using the finite-state machine that you created. Show both the action and goto parts of the table.

    Answer