2.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
+4
but in case of bottom parser answer must be D
0
yes,

Bottom-up parser uses RIGHTMOST DERIVATION IN REVERSE

ans A

edited by
Top-down parser - Leftmost derivation

Bottom-Up parser - Reverse of rightmost derivation
+1 vote
Ans: A Leftmost derivation
0
what if input is assumed to be scaned from right to left?

then it RIGHT-most derivation, right?
0
Right most derivation means non terminals are replaced with terminal from right hand side first
LMD uses top down parser

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

1
+1 vote
2
+1 vote