You are on page 1of 7

No Q & A

1. A grammar oriented compiling technique known as

a) Syntax directed translation YES

b) Data flow engines


c) One pass compiler
d) Two pass compiler
2. A parse tree showing the value of attributes at each node

a) Annotated parse tree YES

b) Syntax tree
c) Semantic tree
d) all of the above
3. In which situation inherited attribute is natural choice

a) Evaluation of arithmetic expression


b) Keeping track of variable declaration YES

c) Checking for correct use of L-values and R-values


d) Both b and c
4. Syntax directed translation is desirable because
a) It is based on syntax
b) It is easy to modify
c) Its description is independent of any implementation
d) All of above YES
5. Synthesized attributes can easily simulated by
a) LL grammar YES
b) Ambiguous grammar
c) LR grammar
d) None of the above
6. A syntax directed definition is said to be ----------- if
dependency graph contains cycle
a) DAG YES
b) Circular
c) Noncircular
d) None of the above
Page 1 of 7
7. Which one of the following restricts the class of syntax
directed definitions that can be implemented
a) Parse tree methods YES
b) Rule-based methods
c) Oblivious methods
d) None of the above
8. Syntax directed definition is a--------------type of grammar.
a) LL grammar
b) Context free grammar YES
c) LK grammar

d) All of the above


9. An SDD without side effects is called
a) Context free grammar
b) Operator grammar
c) Attribute grammar
d) Both a and c YES
10. An SDD that involves only synthesized attributes is
called-------------------.
a) S-Attributed YES
b) L-Attributed
c) Both a and b
d) None of the above
11. ---------------- are useful tool for determining an evaluation
order for the attribute instances in given parse tree.
a) DAG
b) Dependency graph YES
c) Graph coloring graph
d) None of these
12. The translation of token stream is result obtained by
evaluated the
a) Productions
b) Syntax rules YES
c) Semantic rules
d) None of these

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

b) Intermediate code generation

c) Lexical analyzer YES

d) Semantic analyzer

35. Types of 3address code representation are__________


a)3 YES
b)4
c)2
d)5
36. In QUADRUPLE we have 1)___2)____3)___4)____

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

You might also like