Practice free →
HomeGATE CSEcomputerscienceCompiler Design › RECURSIVE DESCENT parsers translate each grammar…

RECURSIVE DESCENT parsers translate each grammar rule into

Aa lookup table
Ban SQL query
Can interrupt handler
Da function in the parser code
Answer & Solution
Correct answer: D. a function in the parser code
1. RECURSIVE DESCENT: top-down parser, written by hand or generated. 2. Each non-terminal in the grammar becomes one PARSING FUNCTION. 3. The function body matches the grammar rule's structure: - Sequence A B → function calls parseA() then parseB() - Alternative A | B → if/else looking at current token - Repetition A* → while loop 4. The grammar reads almost directly from the parser code — makes recursive descent EASY TO WRITE and DEBUG. 5. Other options misdescribe the technique. _Source: Bob Nystrom, "Crafting Interpreters", Ch 6.2 (Recursive Descent Parsing — overview)._
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions