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

but in case of bottom parser answer must be D
yes,

Bottom-up parser uses RIGHTMOST DERIVATION IN REVERSE

ans A

edited by
+1 vote
Top-down parser - Leftmost derivation

Bottom-Up parser - Reverse of rightmost derivation
LMD uses top down parser
Ans: A Leftmost derivation
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