MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
a grammar with production rule is {A
A
left factor
B
left recursion
C
both
D
none
Explanation: 

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: -In computer science, a grammar is informally called a recursive grammar if it contains production rules that are recursive, meaning that expanding a non-terminal according to these rules can eventually lead to a string that includes the same non-terminal again. Otherwise it is called a non-recursive grammar.

Detailed explanation-3: -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-4: -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.

There is 1 question to complete.