What is the safest order for simplifying a context-free grammar?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. Elimination of ε-productions, unit productions, and then useless symbols and productions
Explanation
Removing ε-productions can create unit productions, and removing both can leave useless symbols. So the order is ε → unit → useless.More Theory of Computation and Compilers questions
- What is the move in the cell numbered M1 of the table?
- What is the move in the cell numbered M2 of the table?
- What is the move in the cell numbered M3 of the table?
- What is the move in the cell numbered M4 of the table?
- What is the move in the cell numbered M5 of the table?
- The reduced grammar equivalent to the grammar whose production rules are given below is S → AB | CA B → BC | AB A → a C → aB | b