Multiple choice

Which of the following parsing methods handle(s) left-recursive grammars?

  1. Top-down parsing

  2. Bottom-up parsing

  3. Both (1) and (2)

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Top-down parsers (like LL parsers) fail and enter infinite loops when faced with left-recursive grammars. Bottom-up parsers (like LR parsers) are capable of handling left-recursive productions effectively.