Question 25Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

  1. ARemoving left recursion alone
  2. BRemoving the grammar alone
  3. CRemoving left recursion and factoring the grammar
  4. DNone of the above
Show answerHide answer

Correct answer: (D) None of the above

Explanation

Removing left recursion and left factoring the grammar do not suffice to convert an arbitrary CFG to an LL(1) grammar. LL(1) parsing is top-down; for it the grammar must also be unambiguous and deterministic (e.g. an ambiguous grammar stays non-LL(1)), besides being free from left recursion.

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 25 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.