in Compiler Design retagged by
637 views
0 votes
0 votes

I think that the given grammar is LL(1) .  please explain me if I'm wrong.

in Compiler Design retagged by
by
637 views

1 comment

Grammar is not LL(1). Productions B -->1B and B-->$\epsilon$ will be under terminal 1 conflict

1
1

2 Answers

2 votes
2 votes
Best answer

Bro answer is its not LL(1) grammAr...

Look at this production

B->1B|episolon.........here first of 1B is {1}...and as production contain episolon we have to see follow of B...

Follow of B is First of C ...first of C={1}.....so we can say 

IN THE ROW CORRESPONDING TO "B" AND COLUMN NAMED "1" WE HAVE 2 ENTRIES ...SO GRAMMAR IS NOT LL(1) 

selected by

1 comment

I missed to see the follow of LHS when there is B -> eps   

@SHUBHAM SHASTRI thnx alot
1
1
1 vote
1 vote

The Grammar is not LL1

A->0A1/ null                 first( 0,null)             follow( 1,0, $)

 so A->0A1 will be in column (0)

     A->null   will be in column( 0,1,$)

hence it's not LL1

by

1 comment

Yes this is correct. .thnku
1
1