20 votes 20 votes Consider the following grammar: $P\rightarrow xQRS$ $Q\rightarrow yz\mid z$ $R\rightarrow w\mid \varepsilon$ $S\rightarrow y$ What is FOLLOW($Q$)? $\left \{ R \right \}$ $\left \{ w \right \}$ $\left \{ w,y \right \}$ $\left \{ w,\$ \right \}$ Compiler Design gatecse-2017-set1 compiler-design parsing easy + – Arjun asked Feb 14, 2017 • retagged Dec 30, 2023 by Hira Thakur Arjun 6.8k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes In the production: P → xQRS, FOLLOW (Q) = FIRST (R) FIRST (R) = {w, ϵ} >br> Since FIRST (R) = {ϵ}, so FOLLOW (Q) → {w} ∪ FIRST(S) FIRST(S) = {y} So, FOLLOW (Q) = {w, y} varunrajarathnam answered Sep 19, 2020 varunrajarathnam comment Share Follow See all 0 reply Please log in or register to add a comment.
–1 votes –1 votes c is correct akankshadewangan24 answered Apr 10, 2017 akankshadewangan24 comment Share Follow See all 0 reply Please log in or register to add a comment.
–1 votes –1 votes Ans option d Ankit001 answered Jul 17, 2017 Ankit001 comment Share Follow See all 2 Comments See all 2 2 Comments reply Rishi yadav commented Jan 9, 2018 reply Follow Share answer d is not correct because for Follow of Q we have to find first of R and there is epsilon move in first of R so by putting epsilon in P now we have to find first of S hence option C 0 votes 0 votes Rishi yadav commented Jan 9, 2018 reply Follow Share so plz correct ur answer 0 votes 0 votes Please log in or register to add a comment.