edited by
7,672 views
22 votes
22 votes

Which of the following derivations does a top-down parser use while parsing an input string? The input is scanned from left to right.

  1. Leftmost derivation
  2. Leftmost derivation traced out in reverse
  3. Rightmost derivation 
  4. Rightmost derivation traced out in reverse
edited by

6 Answers

Best answer
27 votes
27 votes
Top-down parser - Leftmost derivation

Bottom-Up parser - Reverse of rightmost derivation
selected by
2 votes
2 votes

Leftmost derivation Top-down parsing (LL).

In top-down parsing, we just start with the start symbol and compare the right side of the different productions against the first piece of input to see which of the productions should be used.

A top-down parser is called LL parser because it parses the input from Left to right, and constructs a Leftmost derivation of the sentence. 

Option A is correct

Answer:

Related questions

45 votes
45 votes
4 answers
1
15 votes
15 votes
3 answers
2
Kathleen asked Sep 14, 2014
7,917 views
Consider the syntax directed translation scheme $\textsf{(SDTS)}$ given in the following. Assume attribute evaluation with bottom-up parsing, i.e., attributes are evaluat...