Compiler Design


Q61.

Consider the augmented grammar given below: S'\rightarrow S S \rightarrow \lt L \gt |id L \rightarrow L,S|S Let I_0=CLOSURE(\{[S'\rightarrow \cdot S]\}) . The number of items in the set GOTO(I_0,\lt) is __________.
GateOverflow

Q62.

A given grammar is called ambiguous if
GateOverflow

Q63.

Consider the following given grammar: S \rightarrow Aa A \rightarrow BD B \rightarrow b|\epsilon D \rightarrow d|\epsilon Let a, b, d and $ be indexed as follows: Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is {a, b, d, $}, then the answer should be 3210). Answer:_____
GateOverflow

Q64.

Consider the following grammar: stmt\rightarrow if expr then else expr; stmt| \dot{O} expr\rightarrowterm relop term|term term\rightarrow id|number if\rightarrowa|b|c number\rightarrow [0-9] where relop is a relational operate (e.g \lt ,\gt,...), \dot{O} refers to the empty statement, and if ,then, else are terminals. Consider a program P following the above grammar containing ten if terminals. The number of control flows paths in P is ____________. For example the program if e_1 then e_3 else e_3 has 2 controls flow paths e_{1} \rightarrow e_{2} and e_{1} \rightarrow e_{3}.
GateOverflow

Q65.

Given the grammars \rightarrow T^{*} S \mid TT \rightarrow U+T \mid UU \rightarrow a \mid bWhich of the following statements is wrong?
GateOverflow

Q66.

C onsider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #. Which one of the following is correct for the given parse tree?
GateOverflow

Q67.

Consider the following grammar. S\rightarrow aSB|d B\rightarrow b The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is___________.
GateOverflow

Q68.

Recursive descent parsing is an example of
GateOverflow

Q69.

Which one of the following kinds of derivation is used by LR parsers?
GateOverflow

Q70.

Which one of the following is a top-down parser?
GateOverflow