wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following CFG :

(Where S, A, B, C are non -terminals and a, b, c, e, d are terminal)
SSABC
AaAd|
BbB|
CCc|Be|


Number of elements in the FOLLOW(S) are _____
  1. 5

Open in App
Solution

The correct option is A 5
SSABC
AaAd|
BbB|
CCc|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}

It contain 5 elements.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
de-Morgan's Laws for Set Difference
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon