GATE Computer ScienceHardGATE CSE

Grammar: E → T X; X → + T X | − T X | ε; T → F Y; Y → * F Y | / F Y | ε; F → ( E ) | id | num | − F. How many non-empty cells does its LL(1) parsing table have (terminals: + − * / ( ) id num $)?

  1. A. 22
  2. B. 20
  3. C. 24
  4. D. 27

Correct answer: A. 22

Counting FIRST/FOLLOW placements per nonterminal: E 4, X 4, T 4, Y 6, F 4; total 22 (no multiple entries: 0).

More Compiler Design questions

Exams that ask this topic