COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Left Most Derivation
|
|
Right Most Derivation
|
|
Right Most Derivation in reverse
|
|
Left Most Derivation in reverse
|
Detailed explanation-1: -Bottom-up parser:-A Bottom-up parser generates the Rightmost derivation in reverse. This corresponds to starting at the leaves of the parse tree also known as shift-reduce parsing. The strings that are reduced during the reverse of a rightmost derivation are called the handles.
Detailed explanation-2: -What does a bottom-up parser generate? Explanation: Bottom-up parser generates the rightmost derivation in reverse.
Detailed explanation-3: -Bottom-up parsing: It uses the rightmost derivation in Reverse. It is also known as Shift reduce parsing.
Detailed explanation-4: -Top-down parsing (LL) 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.
Detailed explanation-5: -Bottom Up Parsers / Shift Reduce Parsers Build the parse tree from leaves to root. Bottom-up parsing can be defined as an attempt to reduce the input string w to the start symbol of grammar by tracing out the rightmost derivations of w in reverse.