Definition

LL(k) and LR(k) denote two families of grammars parseable by top-down and bottom-up parsers respectively, where k is the number of lookahead symbols.

Key Points

Example

📌 CSS Frequency: High — direct comparison/short-note question appears very frequently.

Model Answer (short)

"LL(k) parsers scan left-to-right and build a leftmost derivation using k lookahead symbols, top-down; LR(k) parsers scan left-to-right but build a rightmost derivation in reverse, bottom-up. LR grammars are strictly more powerful than LL grammars of the same k, since every LL(k) grammar is LR(k) but not every LR(k) grammar is LL(k) — this is why most real compiler-generator tools (e.g., YACC) use LALR parsing."