44 views
1. S → aSbS /bSaS / ϵ
1. S → aABb

A→ c/ ϵ

B → d/ ϵ

Which of the following is LL1. Explain in details.

0
both in LL1

LL1 only checks FIRST of grammar and if there same alphabet or not.
+1
But it is mentioned that 1 is not LL1
0
yes, thanks for correcting

+1 vote

$1)$ $FT(S)=\left \{ a,b,\epsilon \right \}$

$FL(S)=${ a,b,$}  NonTerminal a b$ S $S->aSbS$. ,  $S->\epsilon$ $S->bSaS$. ,  $S->\epsilon$ $S->\epsilon$

yes it is not $LL(1).$

$2)$ $FT(S)=\left \{ a \right \}$

$FT(A)=\left \{ c,\epsilon \right \}$

$FT(B)=\left \{ d,\epsilon \right \}$

$FL(S)=${$}$FL(A)=${d,b}$FL(B)=${b}  NonTerminal a b c d$ $S$ $S->aABb$ $A$ $A\rightarrow \epsilon$ $A\rightarrow c$ $A\rightarrow \epsilon$ $B$ $B\rightarrow \epsilon$ $B->d$

It is $LL(1).$

selected by
0
Thanks.. :)

+1 vote
1
2