GATE | GATE-CS-2016 (Set 2) | Question 55
Which one of the following grammars is free from left recursion?
Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.
Learn all GATE CS concepts with Free Live Classes on our youtube channel.
Explanation: Grammar A has direct left recursion because of the production rule: A->Aa.
Grammar C has indirect left recursion because of the production rules:S-> Aa and A->Sc
Grammar D has indirect left recursion because of production rules : A-> Bd and B-> Ae
Grammar B doesn’t have any left recursion (neither direct nor indirect).