Home » Theory of Computation » Theory of computation miscellaneous » Question

Theory of computation miscellaneous

Theory of Computation

  1. Consider the following grammar:

    What is FOLLOW(Q) ?
    1. {R}
    2. {w}
    3. {w, y}
    4. {w, $}
Correct Option: C

Follow (Q) ?
Follow (Q) is First (R) Hence First (R) = {W, E}.
We add ‘W’ in Follow (Q) and for ∑.
We calculate :
First (S) = {y}
So, follow (Q) = First (R S)
= {{W} – ∑} ∪ First (S)
Follow (Q) = {W, y} ( ∴ First (S) = {y} )
Hence option (c) is correct.



Your comments will be displayed only after manual approval.