# GATE2019-19

9 votes
4.8k views

Consider the grammar given below:

• $S \rightarrow Aa$
• $A \rightarrow BD$
• $B \rightarrow b \mid \epsilon$
• $D \rightarrow d \mid \epsilon$

1
@JEET, $\$$is in follow of$S$& no where we have to calculate follow of$S$while calculating follow of$B$0 Thanks 8 votes Follow of B={d,a} D is right of B so we take terminal first of D that is d if D is € in such case follow of B=follow of A that is a So answer is ad = 31 2 votes Answer is: 31 1. Here B is in the right side of the Production Rule:$A\rightarrow BD\therefore FOLLOW(B)= FIRST(D)FIRST(D)=d$(Therfore it is in$FOLLOW(B)$) Finally Putting$D\rightarrow \varepsilon$in the Production$A\rightarrow BD$then$FOLLOW(B)=FOLLOW(A)FOLLOW(A)=a$(From the Production rule$S\rightarrow Aa$)$\therefore FOLLOW(B)= (d,a)$As we have to write answer in the Decreasing order of INDEX (a,d)$\rightarrow$(31) edited Answer: ## Related questions 5 votes 2 answers 1 3.6k views Which one of the following kinds of derivation is used by LR parsers? Leftmost Leftmost in reverse Rightmost Rightmost in reverse 7 votes 3 answers 2 5k views Consider the augmented grammar given below:$S’ \rightarrow SS \rightarrow \langle L \rangle \mid idL \rightarrow L, S \mid S$Let$I_0 = \text{CLOSURE} (\{[S’ \rightarrow \cdot S ]\}).$The number of items in the set$\text{GOTO} (I_0, \langle \: )$is______ 6 votes 6 answers 3 4k views Consider the following grammar and the semantic actions to support that inherited type declaration attributes. Let$X_1, X_2, X_3, X_4, X_5$, and$X_6$be the placeholders for the non-terminals$D, T, L$or$L_1$...$X_1=L, \: X_2=L, \: X_3=L_1, \: X_4 = TX_1=T, \: X_2=L, \: X_3=T, \: X_4 = L_1\$
12 votes
8 answers
4
5.6k views
The following C program is executed on a Unix/Linux system : #include<unistd.h> int main() { int i; for(i=0; i<10; i++) if(i%2 == 0) fork(); return 0; } The total number of child processes created is ________________ .