COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
A
|
|
S
|
|
B
|
|
E
|
Detailed explanation-1: -With right recursion, no reduction takes place until the entire list of elements has been read; with left recursion, a reduction takes place as each new list element is encountered. Left recursion can therefore save a lot of stack space.
Detailed explanation-2: -A Grammar G (V, T, P, S) is left recursive if it has a production in the form. A → A |. Left Recursion can be eliminated by introducing new non-terminal A such that. This type of recursion is also called Immediate Left Recursion.
Detailed explanation-3: -Right Recursion-A production of grammar is said to have right recursion if the rightmost variable of its RHS is same as variable of its LHS. A grammar containing a production having right recursion is called as Right Recursive Grammar.
Detailed explanation-4: -In the formal language theory of computer science, left recursion is a special case of recursion where a string is recognized as part of a language by the fact that it decomposes into a string from that same language (on the left) and a suffix (on the right).