retagged by
933 views

2 Answers

2 votes
2 votes

Answer : 3 [ S->XY , Y->ϵ, M->ϵ ]

First(S) = { ( , e }  Follow(S) = { ) , $ }

First(X) = { ( , e }  Follow(X) = { p, ) , $ }

First(Y) = { p , ϵ }  Follow(Y) = { ) , $ }

First(M) = { q , ϵ }  Follow(M) = { p, ) , $ }

So different missing entries are :

1) S->XY [under ( ]

2) Y->ϵ [under $ and ) ]

3) M->ϵ [under ) and $ ] 

edited by
0 votes
0 votes
  First(X) Follow(X)
S (,e $,)
X (,e p,$,)
Y p, ɛ $,)
M q, ɛ p,$,)

LL(1) Parsing Table

  ( ) e p q $
S S->XY   S->XY      
X X->(S)   X->eM      
Y   Y-> ɛ   Y->pS   Y-> ɛ
M   M->ɛ   M->ɛ M->qX M->ɛ

Enteries left are : 5

1.S->XY

2.Y-> ɛ at )

3.Y-> ɛ at $

4.M->ɛ at )

5.M->ɛ at $

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
0 votes
0 votes
1 answer
3
talha hashim asked Nov 9, 2018
475 views
A grammar that has not any epsilon production and also free from unit productions.The maximum number of reduce moves that can be taken during bottom up evaluation of 25 t...
1 votes
1 votes
1 answer
4