retagged by
6,806 views
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$)?

  1. $\left \{ R \right \}$              
  2. $\left \{ w \right \}$                
  3. $\left \{ w,y \right \}$                   
  4. $\left \{ w,\$ \right \}$
retagged by

7 Answers

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}

–1 votes
–1 votes
Ans option d
Answer:

Related questions

25 votes
25 votes
7 answers
2
khushtak asked Feb 14, 2017
7,039 views
Consider the following table:$$\begin{array}{|l|}\hline \textbf {Algorithms} & \textbf{Design Paradigms } & \\\hline \text{P. Kruskal} & \text{i. Divide and Conquer} \...
30 votes
30 votes
8 answers
3
20 votes
20 votes
8 answers
4
Arjun asked Feb 14, 2017
8,723 views
The probability that a $k$-digit number does NOT contain the digits $0, 5,$ or $9$ is$0.3^{k}$$0.6^{k}$$0.7^{k}$$0.9^{k}$