Consider the grammar:
with terminals and end marker \XYZSAB$ respectively.
Rank , , from largest to smallest.
B
Step-by-Step Solution
Key idea: Count table entries for each non-terminal based on FIRST and FOLLOW sets.
Step 1: Compute FOLLOW sets:
- \mathrm{FOLLOW}(S) = \{\\}$ (start symbol)
- \mathrm{FOLLOW}(A) = \{\\}S \to aAA$ is at the end)
- \mathrm{FOLLOW}(B) = \{\\}S \to bBB$ is at the end)
Step 2: Count entries for :
- : . Add to .
- : . Add to .
Step 3: Count entries for :
- : . Add to .
- : . \mathrm{FOLLOW}(A) = \{\\}M[A, \.
Step 4: Count entries for :
- : . Add to .
Step 5: Ranking: , , . So .
Answer: B