Question:medium

Which of the following statements is/are true?

Show Hint

LL(1) parsing never backtracks and cannot handle left recursion, but it does require left factoring to resolve common prefixes; LL(1) is a subset of SLR(1), not more powerful.
Updated On: Aug 3, 2026
  • LL(1) parser uses backtracking
  • For a grammar to be LL(1), it must be left-recursive
  • For a grammar to be LL(1), it must be left-factored
  • The LL(1) parsers are more powerful than the SLR parsers
Show Solution

The Correct Option is C

Solution and Explanation

Go through each claim about LL(1) parsing using the definition of predictive parsing.

Backtracking claim: LL(1) parsing works by looking at exactly 1 input symbol to pick the next production deterministically from a parsing table, there is never any need to backtrack, so this claim is wrong.

Left recursion claim: predictive top-down parsers cannot handle left recursion at all, since a rule like \(A \to A\alpha \mid \beta\) would make the parser expand \(A\) forever without reading any input. Left-recursive grammars are therefore excluded from LL(1), so saying LL(1) grammars must be left recursive is backwards and false.

Left factoring claim: if a non-terminal has two alternatives beginning with the same symbols, a single lookahead symbol cannot tell them apart, so the grammar fails the LL(1) condition unless it is left factored first. Left factoring is indeed required, making this claim true.

Power comparison claim: the LL(1) class of grammars sits inside the SLR(1) class, every LL(1) grammar is SLR(1) but many SLR(1) grammars (for example ones with left recursion) are not LL(1). So LL(1) is less powerful, not more, making this claim false.

Only the left-factoring statement holds, so the answer is option C.

Was this answer helpful?
0


Questions Asked in GATE CS exam