Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



Consider the Grammar :

$T \rightarrow Qx$
$Q \rightarrow RS$
$R \rightarrow y \mid \varepsilon$
$S \rightarrow z \mid \varepsilon$

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$ ?






Solution

From production

$Q \rightarrow RS$

FOLLOW of $R$ includes FIRST of $S$ except $\varepsilon$

FIRST($S$) = ${z, \varepsilon}$

So add $z$

Since $S \rightarrow \varepsilon$, also include FOLLOW($Q$)

From

$T \rightarrow Qx$

FOLLOW($Q$) = ${x}$

Thus

FOLLOW($R$) = ${z, x}$


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...