Compiler Design Mid - I, September - 2014

1.A compiler is a translator that converts source program to a ________________.
  • HLL
  • Exe Code
  • Assembly Code
  • Machine Code
Answer: D
2.The number of tokens in the following code is __________.
if (x > y) z = 0;
  • 10
  • 9
  • 8
  • 7
Answer: A
3.The grammar that is used for lexical analysis phase is _____________.
  • CFG
  • CSG
  • REGULAR
  • UNRESTRICTED
Answer: C
4.In a compiler construction phase, the phase that removes comment lines is ______________.
  • Syntax Analyzer
  • Semantic Analyzer
  • Lexical Analyzer
  • Lexical Analyzer
Answer: A
5.The grammar S → Sa | aS | a is _________.
  • Left recursive
  • Right recursive
  • ambiguous
  • unambiguous
Answer: C
6.The maximum value for k in LR(k) is _________
  • 0
  • 1
  • 2
  • 3
Answer: B
7.The most powerful Bottom-up Parser is _____________.
  • SLR
  • LALR
  • CLR
  • Operator-Precedence
Answer: C
8.The value of _________________ attribute is computed from the value of attributes at the siblings and parent of that node.
  • L-attribute
  • S-attribute
  • Synthesized
  • Inherited
Answer: D
9.Synthesized attributes can be easily simulated by ____________.
  • LL grammar
  • LR grammar
  • Operator grammar
  • Ambiguous grammar
Answer: B
10.A parse tree showing the values of attributes at each node is called _______________.
  • syntax
  • augmented
  • annotated
  • semantic
Answer: C
11.Using the facilities offered by a language to compile itself is the essence of _____________ process.
Answer: bootstrapping
12._________________ is a rule that describes the character that can be grouped into tokens.
Answer: Pattern
13.The grammar whose parsing table has no multiply defined entries is said to be _________ grammar.
Answer: LL(1)
14.In LL(1) parser, ‘1’ indicates _______________.
Answer: number of look ahead sysbols
15.The type of grammar that is used in parser construction is ___________.
Answer: CFG
16.YACC stands for ____________________________.
Answer: Yet Another Compiler Compiler
17.In bottom-up parsing, the body of the production, which is reduced to its non-terminal is called a ___________.
Answer: handle
18.The grammar that does not contain null production and two adjacent non-terminals on the RHS of any production is called __________ grammar.
Answer: operator
19.S-attribute definition is also called as ______________.
Answer: postfix SDT
20.The output file from the YACC compiler is __________
Answer: Y.tab.c