# Compiler design

200 views

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

$S->Aa|b$

$A->Ac|Sd|Null$

edited

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.
0
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
0
No. When you are asked to Remove Left Recursion, then only you need to remove it.

## Related questions

1 vote
1
334 views
S→ A/a A→ a LL1 or not?