• retagged by
1,755 views
2 2 votes
check whether the following grammer is ll(1) grammar or not and also find the table entry of [A,a].

S ->A,

A->aB/Ab,

B->bBC/d,

C->d

Why is this not a LL(1) grammar?

2 Answers

Best answer
8 8 votes
It is not LL(1). For a grammar to be LL(1), it should be unambiguous, should be deterministic and should not have left recursion.

The production A->Ab is left recursive.

Therefore, it is not a LL(1) grammar.
• selected by
2 2 votes
No it will not be LL(1)

Because First (S) ={a}

First(A)={a}⋂{a} ={a} !=NULL

First(B)={b}⋂{d}=∅

First(C)={d}

for First(A) it will be not LL(1), because for LL(1) there First(A) should be NULL
• edited by
Position:
Show:

Related questions

1 1 vote
2 answers 2 answers
5.3k
5.3k views
KISHALAY DAS asked Nov 12, 2016
5,320 views
Consider the following grammar.\[\begin{array}{l}\mathrm{S} \rightarrow \mathrm{AB} \mid \mathrm{BA} \\\mathrm{~A} \rightarrow * \mathrm{~S} \mid \mathrm{E} \\\mathrm{~B}...
0 0 votes
0 0 answers
1.6k
1.6k views
rahul sharma 5 asked Nov 12, 2017
1,592 views
Can LL(k) and LR(k) gammer has null and unit productions?
0 0 votes
1 1 answer
1.1k
1.1k views
rexritz asked Oct 22, 2023
1,142 views
A) $S\rightarrow aA\mid bBa$ $A\rightarrow bA\mid a$ $ B\rightarrow aB\mid \varepsilon$B) $S\rightarrow Aa\mid Bb$ $ A\rightarrow \varepsilon $ $ B\rightarrow...
2 2 votes
2 answers 2 answers
4.2k
4.2k views
sripo asked Nov 10, 2018
4,204 views
Can you give an example which is not LL(1) but is CLR(1)