UGC NET Paper 2 (Computer Science)Very hard

Consider. I. For an LL(1) grammar, the FIRST sets of a nonterminal's alternative productions must be pairwise disjoint. II. If one alternative can derive epsilon, the FIRST sets of the other alternatives must not intersect FOLLOW of that nonterminal. III. Every LL(1) grammar must be left-recursive. Which are correct?

  1. A. I and II only
  2. B. I, II and III
  3. C. II and III only
  4. D. I only

Correct answer: A. I and II only

I and II are exactly the standard conditions for constructing a conflict-free predictive parsing table; left recursion makes a grammar unusable for LL(1) parsing, so III is false.

More UGC NET Computer Science and Applications questions

Exams that ask this topic