The Gateway to Computer Science Excellence
0 votes
93 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 by Loyal (5.6k points)
edited by | 93 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 (26.1k points)
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.
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
50,650 questions
56,192 answers
193,988 comments
94,860 users