Which of the following statements is/are true?
2026
Which of the following statements is/are true?
- A.
LL(1) parser uses backtracking
- B.
For a grammar to be LL(1), it must be left-recursive
- C.
For a grammar to be LL(1), it must be left-factored
- D.
The LL(1) parsers are more powerful than the SLR parsers
Attempted by 23 students.
Show answer & explanation
Correct answer: C
LL(1) parsers are predictive parsers that scan input from left to right and construct a leftmost derivation. They use one token of lookahead to decide which production rule to apply.
A grammar must be left-factored to be LL(1). This transformation removes common prefixes from production rules, ensuring the parser can choose the correct rule based on the next input token.
LL(1) grammars cannot be left-recursive. Left recursion causes infinite loops in top-down parsing, so it must be eliminated before parsing table construction.
SLR parsers are more powerful than LL(1) parsers. The class of grammars accepted by SLR parsers is a superset of those accepted by LL(1) parsers.