Professional Documents
Culture Documents
b) Syntax tree
c) Semantic tree
d) all of the above
3. In which situation inherited attribute is natural choice
Page 2 of 7
13. A SDD is generalization of CFG in which each grammar has
associated with set of attributes called
a) Synthesized
b) Inherited
c) Evaluated
d) Both a and b YES
14. A parse tree for ----------------- can be always annotated by
evaluating semantic rules for attributes at each node bottom-
up.
a) S-attributed definition
b) Inherited attributes
c) Both a and b YES
d) Syntax directed definition
15. Inherited attributes are convenient for
a) Using attributes exclusively
b) Expressing dependence of programming language YES
construct
c) Evaluating expressions
d) None of these
16. The interdependencies among inherited & synthesized
attributes at nodes in parse tree can be depicted by
a) DAG
b) Dependency graph YES
c) Interdependency graph
d) Wait for graph
17. Consider node for production T->T1*F, so the T.val at this
node defined by
a) T.val:=T1.val*F1.val
b) T.val:=T.val* F.val
c) T.val: =T1.val*F. val YES
d) T.val: =T.val*F. val
18. An (abstract) -------------------- is condensed form of parse
tree useful for representing language constructs
a) Dependency graph YES
b) Evaluation tree
c) Syntax tree
Page 3 of 7
d) None of these
19. DAG is used for
a) Identifying common sub expression in expression YES
b) Identifying parse tree for expression
c) Identifying syntax tree for expression
d) Both b & c
20. A translation scheme is CFG in which attributes are
associated with grammar symbols and --------------at right
side
a) Semantic rules
b) Syntax rules
c) Semantic actions YES
d) None of these
21. If translation have both inherited and synthesized attributes
then
a) An action must not refer to synthesized attribute of a
symbol to right of the action
b) An inherited attribute for symbol on right side of a
production must be computed in action before that symbol
c) A synthesized attribute for nonterminal on left can only be
computed after all attributes it references have been
computed
d) All of above YES
22. Translation scheme with left recursive grammar for
production E->E1+T is
a) E.val:=E1.val+T.val YES
b) E.val:=E.val + T.val
c) Both a and b
d) None of these
23. Syntax-directed translation refers to a method of compiler
implementation where the source language translation is
completely driven by the
a)parser YES
b)scanner
c)ICG
d)CO
Page 4 of 7
24. Number of different types of attributes in annotated parse
tree
a)2 YES
b)3
c)4
d)1
25. __________ acquires data from either parent or sibling
a)inherited attribute YES
b)synthesized attribute
c)ICG
d)CG
26. __________ acquires data from CHILDREN
a)inherited attribute
b)synthesized attribute YES
c)ICG
d)CG
27. Symbol table can store________
a)variables
b)identifiers
c)procedures data
d)all of the above YES
28. Symbol names can be stored in _______ ways
a)2 YES
b)21
c)1
d)none of the above
29. Fixed length variable storing in symbol table is_______
a)advantage
b)disadvantage YES
c)can’t say
d)none of the above
30. Variable length variable storing in symbol table is_______
a)advantage YES
b)disadvantage
Page 5 of 7
c)can’t say
d)none of the above
31. DAG__________
a) Directed acyclic graph YES
b) Directed cyclic grant
c) Directed cyclic graphics
d) in directed acyclic graph
32. ICG stands_______
a)Intermediate cone generator YES
b) Intermediate code glass
c) Intermediate complex generator
d) Intermediate cycles generator
33. Compiler translates the source code to
a) Executable code
b) Machine code
c) Binary code
d) Both B and C YES
34. Which of the following groups is/are token together into
semantic structures?
a) Syntax analyzer
d) Semantic analyzer
Page 6 of 7
a)operator,operand1,operand2,result YES
a)operator,operand1,operand2,operator
a)operator,operand1,operand2,=
a)operator,operand1,operand2, *
37. In TRIPLE we have 1)___2)____3)___
a)operator,operand1,operand2 YES
a)operator, operand2,operator
a)operator,operand2,=
a) operand1,operand2, *
38. Indirect Triple Has _____ Number Of Tables
a)1
b)2 YES
c)4
d)5
39. A translation scheme is CFG in which attributes are
associated with grammar symbols and --------------at right
side
a) Semantic rules
b) Syntax rules
c) Semantic actions YES
d) None of these
40. If translation have both inherited and synthesized attributes
then
a) An action must not refer to synthesized attribute of a
symbol to right of the action
b) An inherited attribute for symbol on right side of a
production must be computed in action before that symbol
c) A synthesized attribute for nonterminal on left can only be
computed after all attributes it references have been
computed
d) All of above YES
Page 7 of 7