The Gateway to Computer Science Excellence
0 votes

In this why questions why the left recursion is not removed as it is necessary for $LL1 $

Why they given the option without removing the left recursion



in Compiler Design by Active
edited by | 131 views

1 Answer

0 votes
Because He is not interested in asking Whether the Grammar is $LL(1)$ Or Not. Of course, The Grammar is Not $LL(1)$ because of Left Recursion. But Why do we say that "The Grammar is Not $LL(1)$ because of Left Recursion" ?

That's because When you make the Predictive Parser table for this Grammar, Some Cell will definitely contain Multiple Entries Which makes it Non-$LL(1)$. But in the Question He wants to ask about what Entries the respective cells will contain.

And One More thing, When Some Grammar is given to you and it does contain Left Recursion, We do not remove left recursion from it and afterwards decide it is $LL(1)$ or not. We decide it for the given Grammar.. Without changing it.
by Boss
Ok I got it and one more question that if it asked to find first and follow of particular variable in grammar then at that time we have to remove the left recursion to find the first and follow ?

PlZ correct me if m wrong
No. When you are asked to Remove Left Recursion, then only you need to remove it.
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,215 questions
59,992 answers
94,655 users