(Where S, A, B, C are non -terminals and a, b, c, e, d are terminal) S→SABC A→aAd|∈ B→bB|∈ C→Cc|Be|∈
Number of elements in the FOLLOW(S) are _____
5
Open in App
Solution
The correct option is A 5 S→SABC A→aAd|∈ B→bB|∈ C→Cc|Be|∈
FOLLOWS(S) = FIRST(A) ⇒[a]∪[First(B)]=[a]∪[b]∪[FIRST(C)] =[a]∪[b]∪b,c,e,e (∈ can not be part of FOLLOW)
= {a, b, c, e} ∪ (S) (S is start symbol so its FOLLOW contain S)
= {a, b, c, e, S}