GATE 2003 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2003

107 questions

MCQ 1071-mark 107

Questions 86–90 of 107

Q86Syntax-directed Translation1 markMCQ−0.33 if wrong
Which of the following statements is FALSE?

Q87Syntax-directed Translation1 markMCQ−0.33 if wrong
In a bottom-up evaluation of a syntax directed definition, inherited attributes can

Q88Syntax-directed Translation1 markMCQ−0.33 if wrong
Consider the syntax directed definition shown below

S→id:=E{gen(id.place=E.place;);}E→E1+E2{t=newtemp();gen(t=E1.place+E2.place;);E.place=t;}E→id{E.place=id.place;}\begin{array}{ll} S \rightarrow \mathbf{ id :=} E&\qquad \{gen(\mathbf{ id}.place = E.place;);\}\\ E \rightarrow E_1 + E_2 &\qquad \{t = newtemp();\\ &\qquad gen(t = E_1.place + E_2.place;);\\ &\qquad E.place = t;\}\\ E \rightarrow id&\qquad \{E.place = \mathbf{id}.place;\} \end{array}

Here, gen is a function that generates the output code, and newtemp is a function that returns the name of a new temporary variable on every call. Assume that ti's are the temporary variable names generated by newtemp. For the statement 'X:= Y + Z', the 3-address code sequence generated by this definition is

Q89Syntax-directed Translation1 markMCQ−0.33 if wrong
Consider the translation scheme shown below
S →\rightarrow TR
R →\rightarrow+ T {print ('+');}R | ϵ\epsilon
T →\rightarrow num {print (num.val);}
Here num is a token that represents an integer and num. val represents the corresponding integer value. For an input string '9 + 5+ 2', this translation scheme will print

Q90Assemblers, Linkers and Loaders1 markMCQ−0.33 if wrong
Which of the following is NOT an advantage of using shared, dynamically linked libraries as opposed to using statically linked libraries?