Arrange the steps of building a predictive parsing table in the order performed.
1. compute FIRST and FOLLOW for every nonterminal
2. remove left recursion from the grammar
3. fill each table cell from the FIRST and FOLLOW sets
4. left factor the remaining common prefixes
Answer: C
Correct answer: 2 - 4 - 1 - 3
The transformations must come before the analysis, since they change the grammar the sets are computed from. Left recursion is removed first, then common prefixes are factored out, then FIRST and FOLLOW are computed on the resulting grammar, and only then can the table be filled from those sets.
Please log in or register to report this question.