edited by
2,263 views

4 Answers

Best answer
5 votes
5 votes

First (ab) = a = First (ac) thats why it is not LL(1). Because it contain left factoring.

Suppose we derive ab and choose production S-> ac insteed of S-> ab . then we get error message string not present but actualy it is present .So Remove left factoring is solution.

selected by
0 votes
0 votes
Obviously given grammer suffers from common prefix probblem so it can't be LL(1) gammer.
LL is GMRAMMER not language so it will depend on grammer.

What you have done is you converted that grammer into other (obviously equivalent) grammer and then you are finding is it LL(1) or not. Whatever you have done that is correct for your newely generated grammer but not for original grammer.

So in the process of finding LL(1) Grammer dont  do anything with original grammer else answer will be different.
0 votes
0 votes
This grammar is not LL(1)

Explanation

S->ab    Will be kept under the first of S->ab which is 'a'

Similarly S->ac will be also kept under the first of S->ac which 'a'

So under same enteries how we can put more production.

So this grammar is not LL(1)

Related questions

2 votes
2 votes
1 answer
1
sripo asked Nov 10, 2018
3,242 views
Can you give an example which is not LL(1) but is CLR(1)
0 votes
0 votes
1 answer
2
Rahul Ranjan 1 asked Mar 19, 2018
4,961 views
Given a grammar :$E \rightarrow E + T / T$$T \rightarrow i$Can I directly say that grammar is not $LL(1)$ because $LL(1)$ can't parse Left Recursive Grammar, without dra...
1 votes
1 votes
4 answers
3
2 votes
2 votes
2 answers
4
Subhrangsu asked Apr 16, 2022
9,266 views
Is the following grammar LL(1) ?S→ aABbCD | ϵA→ ASd | ϵB→ Sac| hC | ϵC→ Sf |CgD→ aBD | ϵDraw the LL(1) parsing table for the given grammar.