search
Log In
0 votes
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$

in Compiler Design
edited by
200 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.
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
4 answers
1
0 votes
1 answer
2
224 views
S → aSbS /bSaS / ϵ S → aABb A→ c/ ϵ B → d/ ϵ Which of the following is LL1. Explain in details.
asked Jun 1, 2019 in Compiler Design Hirak 224 views
1 vote
0 answers
3
596 views
Why ε is not shown in First(S). First(s) does contain ε . And please help me figure out which grammar is this? According to me it is NOT LL(1) (since it is left factored), NOT LR(0) (Since the Item 0 has a R-R conflict), NOT SLR(1) (The item 0 has a RR conflict since Follow(X) = Follow(Y) = {a,b} correct me If i'm wrong
asked Nov 23, 2018 in Compiler Design Hopealways 596 views
8 votes
3 answers
4
...