GATE / CS ARCHIVE

GATE CSE 2007 / QUESTION 18

Top-down parsing method

Compiler Design · Parsing & Syntax Analysis · Full GATE CSE 2007 paper

GATE 2007, Q18 1 mark · MCQ
Report issue

Parsing & Syntax Analysis

Question 18, GATE 2007: Which is a top-down parser?
Options:
(A) Recursive descent
(B) Operator precedence
(C) LR(k)
(D) LALR(k)
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Top-down parsing constructs a derivation beginning with the start symbol. Bottom-up parsing starts with input symbols and reduces them toward the start symbol.

2. Derivation and interpretation. Recursive descent starts from the grammar’s start symbol and expands productions while matching input, so it is top-down. Operator-precedence, LR and LALR parsers reduce handles bottom-up. Therefore A.

Original paper, page 4