CFG from rules to parse trees
context-free grammars · parsing strategies · derivations
- The grammar is left-recursive (NP → NP PP; VP → VP PP). Depth-first top-down parsing will loop on it once it tries that rule.
Top-down (recursive descent)
How it works →11 steps · no parse for “John saw the dog in the park”.
Infinite loop: because of the left-recursive rule NP → NP PP, NP keeps being predicted at the same word without reading anything. A depth-first top-down parser never comes back from this branch.
Step 1 / 11
- Goals
next goal first - Input
words read so far
All 11 steps
No parse tree
No complete tree was found before the parser stopped.