...
UPPCL AE 2022
April 11, 2025
NTA UGC NET Aug 2024 Paper-2
April 11, 2025
UPPCL AE 2022
April 11, 2025
NTA UGC NET Aug 2024 Paper-2
April 11, 2025

NTA UGC NET Aug 2024 Paper-2

Question 7
Consider the Grammar :
T -> Qx
Q -> RS
R -> y|e
S -> z|e Where e is epsilon
Here x, y, z are terminals and T, Q, R, S are non terminals.
What will be the follow set of the non terminal R ?

A
{x,y}
B
{y,z}

C
{z,x}
D
{e}
Question 7 Explanation: 
Q → RS: In this production, R is followed by S. This means Follow(R) should include First(S).
The First(S) set includes {z, ε} because S can produce either z or ε.
Since Follow(R) will include First(S) (except ε), we add z to Follow(R) from First(S).
Additionally, since S can be ε, the production Q → RS implies that Follow(R) should also include Follow(Q).
Finally, T → Qx tells us that Follow(Q) includes the terminal x. So, Follow(R) will also include x.
Follow(R) includes {z, x}.
Correct Answer: C
Question 7 Explanation: 
Q → RS: In this production, R is followed by S. This means Follow(R) should include First(S).
The First(S) set includes {z, ε} because S can produce either z or ε.
Since Follow(R) will include First(S) (except ε), we add z to Follow(R) from First(S).
Additionally, since S can be ε, the production Q → RS implies that Follow(R) should also include Follow(Q).
Finally, T → Qx tells us that Follow(Q) includes the terminal x. So, Follow(R) will also include x.
Follow(R) includes {z, x}.

Leave a Reply

Your email address will not be published. Required fields are marked *