You are on page 1of 7

Compiler Design Review Questions

1. What is a compiler?

A. system program that converts instructions to machine language


B. system program that converts machine language to high-level language
C. system program that writes instructions to perform
D. None of the mentioned
2. The output of the lexical analyzer is _______
A. a syntax tree
B. a set of RE
C. string character
D. a set of tokens
3. What is the use of a symbol table in compiler design?
A. Finding name’s scope
B. Type checking
C. Keeping all of the names of all entities in one place
D. All of the mentioned
4. Who is responsible for the creation of the symbol table?
A. Assembler
B. Compiler
C. Interpreter
D. All of the mentioned
5. Which of the following is known as a compiler for a high-level language that runs on one
machine and produces code for a different machine?
A. Cross compiler
B. Multipass compiler
C. Optimizing compiler
D. One pass compiler
6. Which phase of the compiler checks the grammar of the programming?
A. Semantic Analysis
B. Syntax Analysis
C. Code Optimization
D. Code Generation
7. Which of the following concept of FSA is used in the compiler?
A. Code optimization
B. Code generation
C. Lexical analysis
D. d) Parser

8. The bottom-up parsing method is also called

A. Shift reduce parsing


B. Predictive parsing
C. Recursive descent parsing
D. None of these
9. Which of the following parser is a top-down parser?
A. A LR parser
B. Recursive descent parser
C. An LALR parser
D. Operator precedence parser
10. Which phase of the compiler is also known as Parser?
A. Semantic Analysis
B. Code Optimization
C. Syntax Analysis
D. Lexical Analysis
11. Keywords are recognized in a compiler during ____________
A. the code generation
B. the lexical analysis of the program
C. the data flow analysis
D. the program parsing
12. Which derivation is generated by the bottom-up parser?
A. Left-most derivation in reverse
B. Right-most derivation
C. Right-most derivation in reverse
D. Left-most derivation
13. In which parsing, the parser constructs the parse tree from the start symbol and transforms it
into the input symbol
A. Top-down parsing
B. Bottom-up parsing
C. All of above
D. None of above
14. Which is considered as the sequence of characters in a token?
A. Lexeme
B. Mexeme
C. Texeme
D. Pattern
15. Which language is accepted by the push-down automata?
A. Type 1 language
B. Type 2 language
C. Type 0 language
D. Type 3 language
16. What are the problems with top-down parsing?
A. Backtracking
B. Left recursive
C. Left factoring
D. Ambiguity
E. All
17. The phase Syntax Analysis is modeled on the basis of
A. High level language
B. Low level language
C. Context free grammar
D. Regular grammar
18. Compiler translates the source code to
A. Executable code
B. Machine code
C. Binary code
D. Both B and C
19. Grammar of the programming is checked at _______ phase of compiler.
A. Semantic analysis
B. Syntax analysis
C. Code optimization
D. Code generation
20. A compiler is preferable to an interpreter because
A. Debugging can be faster and easier
B. If one changes a statement, only that statement needs re-compilation
C. It is much helpful in the initial stages of program development
D. It can generate stand alone programs that often take less time for execution
21. top-down parser generates
A. Left-most derivation in reverse
B. Left-most derivation
C. Right-most derivation in reverse
D. Right –most derivation
22. Which of the following parsers is the most powerful?
A. SLR
B. LALR
C. Canonical LR
D. Operator-precedence
23. Which table is a permanent database that has an entry for each terminal symbol?
A. Reductions
B. Identifier table
C. Literal table
D. Terminal table
24. The method which merges the bodies of two loops is
A. Constant folding
B. Loop jamming
C. Loop unrolling
D. None of these
25. Synthesized attribute can be easily simulated by a
A. LR grammar
B. LL grammar
C. Ambiguous grammar
D. None of these
26. The most general phase structured grammar
A. Context sensitive
B. Context free
C. Regular
D. None of these
27. The lexical analyzer takes ____ as input and produces a list of ___ of output.
A. Machine code, mnemonic
B. Tokens, source code
C. Source code, tokens
D. Both a and b

28. A compiler for a high-level language that runs on one machine and produce code for
different machine is called
A. One pass compiler
B. multipass compiler
C. cross compiler
D. optimizing compiler
29. The graph that shows the basic blocks and their successor relationship is called
A. Hamiltonian graph
B. Control graph
C. Flow graph
D. DAG

30. _____ constructs the desired target program from the intermediate representation of the
source program.
A. Analysis part
B. Lexical part
C. Synthesis part
D. None of these
31. The parsing technique that avoids backtracking is
A. Top-down parsing
B. Recursive-descent parsing
C. Predictive parsing
D. Both (b) and (c)
32. Loader is a program that
A. Places programs into memory and prepares them for execution
B. Automates the translation of assembly language into machine language
C. Accepts a program written in a high level language and produces an object program
D. Appears to execute a source program as if it were machine language
33. Type checking is normally done during
A. Code optimization
B. Syntax directed translation
C. Lexical analysis
D. Syntax analysis
34. The graph depicting the inter-dependencies of the attribute of different nodes in a parse is
called
A. Dependency graph
B. Karnaugh’s graph
C. Steffi graph
D. Flow grap
35. Left factoring is the process of factoring out the common
A. Prefixes of alternates
B. Suffixes of alternates
C. Both(a) and (b)
D. None of these
36. The errors that can be pointed out by the compiler are known as
A. Internal errors
B. Logical errors
C. Semantic errors
D. Syntax errors
37. Which among the following is/are interpreted language?
A. C++
B. Java
C. Visual basic
D. Both B and C
38. Pee Hole optimization __________
A. Loop Optimization
B. Local Optimization
C. Constant folding
D. Data Flow analysis
39. An intermediate code form is __________
A. Postfix notation
B. Syntax Trees
C. Three Address code
D. All of the mentioned
40. The final phase compiler design is ____________
A. Syntax analysis
B. Lexical analysis
C. Target code generator
D. Intermediate code generator

You might also like