The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+12 votes
1k views

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

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

 

asked in Compiler Design by Veteran (68.8k points) | 1k views
but in case of bottom parser answer must be D
yes,

Bottom-up parser uses RIGHTMOST DERIVATION IN REVERSE

4 Answers

+9 votes
Best answer

ans A

answered by Boss (5.1k points)
edited by
+1 vote
Top-down parser - Leftmost derivation

Bottom-Up parser - Reverse of rightmost derivation
answered by Boss (7k points)
0 votes
LMD uses top down parser
answered by (121 points)
0 votes
Ans: A Leftmost derivation
answered by Boss (7.4k points)
what if input is assumed to be scaned from right to left?

then it RIGHT-most derivation, right?
Right most derivation means non terminals are replaced with terminal from right hand side first


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,443 questions
39,188 answers
108,811 comments
36,563 users