arrow
arrow
arrow
Consider the Grammar: T → Qx Q → RS R → y | ε S → z | ε Here x, y, z are terminals and T, Q, R, S are non-terminals. What will be the f
Question



Consider the Grammar:
T → Qx
Q → RS
R → y | ε
S → z | ε
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.

{ε}

Correct option is C


1. Understanding the Grammar:
· The non-terminal T produces Qx, where Q produces RS.
· The non-terminal R has productions y and ε.
· The non-terminal S has productions z and ε.
2. Finding the FOLLOW Set for R:
· Since R is part of the production Q → RS, the FOLLOW(S) will contribute to FOLLOW(R).
· FOLLOW(S) includes {x, z} because S appears in Q → RS and Q is followed by x in T → Qx.
3. Conclusion:
· Thus, FOLLOW(R) includes both {z, x}, since x follows Q in T → Qx and z is part of S.
Information Booster:
FOLLOW Sets: Used in parsing to determine which symbols can follow a particular non-terminal in derivations.
Additional Knowledge:
· The terminal y does not appear in FOLLOW(R) because it’s part of R's own production and doesn’t follow R directly in any rule.
· Option (d) {ε} is incorrect because the FOLLOW set includes actual terminals, not empty strings.

Free Tests

Free
Must Attempt

Basics of Education: Pedagogy, Andragogy, and Hutagogy

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
Free
Must Attempt

UGC NET Paper 1 Mock Test 1

languageIcon English
  • pdpQsnIcon50 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt

Basics of Education: Pedagogy, Andragogy, and Hutagogy

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon12 Mins
languageIcon English
test-prime-package

Access ‘UGC NET Computer Science’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
353k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow