A context-free grammar written to describe a language is often unsuitable for a parser. An ambiguous grammar gives a parser two trees to choose from. A left-recursive grammar sends a top-down parser into an infinite loop.
Short notes8 min read
A predictive parser must decide which production to apply by looking only at the next input token. A bottom-up SLR parser must decide whether to reduce by looking at the same token.
Short notes8 min read
A top-down parser builds the parse tree from the root down, in preorder, and in doing so produces a leftmost derivation of the input. At each step it holds a leftmost nonterminal and must choose one of its productions.
Short notes10 min read
One-page visual sheets for this topic, in the sheet library on the store. Previews are free; the full sheets come with the subject pack.
Cheat sheets3 sheets