Study this topic

Grammar Transformations for Parsing

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

FIRST and FOLLOW Sets

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

Top-Down Parsing and LL(1)

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