Gate2017 cs Q16

0. Consider the following grammar.
 P → QRS
 Q → yz|z
 R → w|ε
 S → y

What is FOLLOW (Q)?

  • Option : C
  • Explanation :
    FOLLOW(Q) is FIRST(R) hence
    FIRST (R)={w,ε}
    We add ‘w’ in FOLLOW(Q) and for ϵ we calculate FIRST(S)
    FIRST(S) ={y}
    FOLLOW(Q) is {w,y}
Cancel reply

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


Cancel reply

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