search
Log In
0 votes
128 views

First(P) = {+, *, t, epsilon, id} AND Follow(P) = {dollar,id} according to me. In that case M[P, DOLLAR] should have P -> QR

in Compiler Design
edited by
128 views

1 Answer

2 votes
 
Best answer

First (P) = First(QR)

             = First(Q)

              = + , * , t , id

( epsilon will give chance to R, therefore we will also consider First(R) )

First (R) = id


selected by
0
and epsilon will be in FIRST(P) only if epsilon is both in FIRST (Q) and FIRST(R). Am I right?
0
Yes, right

Related questions

1 vote
0 answers
1
359 views
Why ε is not shown in First(S). First(s) does contain ε . And please help me figure out which grammar is this? According to me it is NOT LL(1) (since it is left factored), NOT LR(0) (Since the Item 0 has a R-R conflict), NOT SLR(1) (The item 0 has a RR conflict since Follow(X) = Follow(Y) = {a,b} correct me If i'm wrong
asked Nov 23, 2018 in Compiler Design Hopealways 359 views
8 votes
3 answers
2
0 votes
1 answer
4
148 views
Which of the Statements are True : S1: LR(1) grammar can be LR(0) but not LL(1). S2 : Every regular language is LL(1) S3 : Three address code is linear representation of Syntax Tree.
asked Jan 16, 2019 in Compiler Design Na462 148 views
...