MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which phenomenon happens when the non-terminal on the left side is repeated as the first symbol on the right side?
A
Left-most derivation
B
Left recursion
C
Left factoring
D
Left parsing
Explanation: 

Detailed explanation-1: -The production is left-recursive if the left most symbol on the right side is the same as the non-terminal on the left side.

Detailed explanation-2: -A production for a non-terminal is recursive if it can derive a sequence containing that non-terminal; it is left-recursive if the non-terminal can appear at the start (left edge) of the derived sequence, and right-recursive if it can appear at the end (right edge).

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

Detailed explanation-4: -Left recursion: when one or more productions can be reached from themselves with no tokens consumed in-between. Left factoring: a process of transformation, turning the grammar from a left-recursive form to an equivalent non-left-recursive form.

Detailed explanation-5: -In which derivation the right-most non-terminal symbol is replaced at each step? Answer: (C) 24.

There is 1 question to complete.