Which one of the following kinds of derivation is used by LR parsers?

Q. Which one of the following kinds of derivation is used by LR parsers?

(A) Leftmost

(B) Leftmost in reverse

(C) Rightmost

(D) Rightmost in reverse

Ans: Rightmost in reverse

Solution:

Parsing is classified into two categories, i.e. Top Down Parsing and Bottom-Up Parsing. Top-Down Parsing is based on Left Most Derivation whereas Bottom Up Parsing is dependent on Reverse Right Most Derivation. A general shift reduce parsing is LR parsing is bottom-up parsing where L stands for scanning the input from left to right and R stands for constructing a rightmost derivation in reverse.

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
We will be happy to hear your thoughts

Leave a reply

Gkseries.com
Logo
Register New Account