Skip to content
Related Articles

Related Articles

GATE | Quiz for Sudo GATE 2021 | Question 46

View Discussion
Improve Article
Save Article
  • Last Updated : 18 Dec, 2020
View Discussion
Improve Article
Save Article

Which of the following option(s) is/are correct regarding grammar :

A → BA'
A'→ +BA' /ϵ 
B → TB'
B'→ -TB'/ ϵ
T → id / (A) 

Note – This question is multiple select questions (MSQ).
(A) Follow of A Fo(A) = $, )
(B) Follow of B’ Fo(B’) = Fo(B) = +, $, )
(C) Follow of B Fo(B) = +, )
(D) Follow of T Fo(T) = -, +, $, )


Answer: (A) (B) (D)

Explanation: First(X) contains all terminal present in first place of every string derived by X.
Follow of X contains set of all terminal present in the place immediately right X.

Therefore,

Follow of A Fo(A) = $, ) 
Follow of A' Fo(A') = Fo(A) = $ , )
Follow of B Fo(B) = +, $, )
Follow of B' Fo(B') = Fo(B) = +, $, )

And, Follow of T Fo(T) 
= -, Fo(B') 
= -, +, $, ) 

So, option (A), (B), and (D) are correct.

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!