Practice free →
HomeGATE CSEcomputerscienceCompiler Design › LL parsers (recursive descent) parse from the

LL parsers (recursive descent) parse from the

Aright to left, building a rightmost derivation
Bleft to right, building a leftmost derivation
Cmiddle outward
Dleaves up to the root
Answer & Solution
Correct answer: B. left to right, building a leftmost derivation
1. LL parsers: - L: left-to-right input scan (consume tokens in the order produced) - L: leftmost derivation produced 2. They TOP-DOWN expand non-terminals starting from the root (the grammar start symbol). 3. CONTRAST with LR parsers: - L: left-to-right scan - R: rightmost derivation in REVERSE - Build trees BOTTOM-UP from leaves 4. LL is the parsing style of recursive descent, ANTLR, javacc. LR is the style of yacc, bison. 5. Options A, C, D describe other strategies. _Source: Bob Nystrom, "Crafting Interpreters", Ch 6.2 + 6.1 (LL vs LR parsing)._
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions