Correct answer: (B) S → Ab | Bb | c; A → Bd | ε; B → e
Explanation
A has direct A→Aa. C has the indirect cycle S⇒Aa⇒Sca. D has A⇒Bd⇒Aed. In B, expansion moves only from S to A/B, then A to B and B to a terminal; no nonterminal can return as its own leftmost symbol. Thus B has no left recursion.
More Parsing and Syntax Analysis questions
GATE 2016 CS (CS2) Q56– Start symbol D and terminals int, ;, id, [, ], num generate one C-like array declaration…
GATE 2017 CS (CS2) Q16– Which parser statements are correct? I: Canonical LR is more powerful than SLR. II: SLR is…
GATE 2017 CS (CS2) Q42– G has E→E−T T, T→T+F F, F→(E) id. Which equivalent grammar has no left recursion?
GATE 2012 CS (CS1) Q62– S→aAbB bAaB ε; A→S; B→S. The partial predictive table has S row (E1,E2,S→ε), A row…
GATE 2012 CS (CS1) Q63– S→aAbB bAaB ε; A→S; B→S. The partial predictive table has S row (E1,E2,S→ε), A row…
GATE 2013 CS (CS1) Q19– A grammar has no ε-productions or unit productions (the source gives types A→ε and A→a).…