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 __________.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:_____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}.Q65.
Given the grammars \rightarrow T^{*} S \mid TT \rightarrow U+T \mid UU \rightarrow a \mid bWhich of the following statements is wrong?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?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___________.