Você está na página 1de 3

COMPILER DESIGN

QUESTION BANK
UNIT I
ONE MARK QUESTIONS
1. A translator that takes as input a high level language program and translates into machine
language in one step is known as
a) Compiler b) Interpreter c) Preprocessor

d) Assembler

2. Which of the following is used for grouping of characters into tokens?


a) Parser
analyzer

b) Code optimization

c) Code generator

d) Lexical

3. The lexical analyzer takes_________as input and produces a stream of_______as output.
a) Source program, tokens

b)Token, source program

c) Either A and B

d) None of the above

4. What is the function of a loader?


5. What do you mean by syntax tree?
6. The process of assigning load addresses to the various parts of the program and adjusting
the code and data in the program to reflect the assigned addresses is called _______.
a) Assembly

b) Parsing

c) Relocation

d) Symbol resolution

7. What are the phases of Analysis of a source program?


8. What is a compiler?
9. What are the phases of synthesis of a source program?
10. Define pattern.
11. What are the advantages of Assembly language over machine language?
12. What is a preprocessor?
13. The _________ phase converts an intermediate code into an optimized code that takes
lesser space and lesser time to execute.
a) code optimization
b) syntax directed translation
c) code generation
d) intermediate code generation
14. ______________is invoked whenever any fault occurs in the compilation process of
source program
a) syntax analyzer
b) code generator
c)Error handler
d) Lexical analyzer
15. Define Interpreter.
16. What are the common operations in languages?
17. Define lexeme.
18. What do you mean by assembler?
19. What is Symbol table?

20. Define regular definition.


TWO MARK QUESTIONS

1. What is kleen closure and positive closure?


2. What is the role of Scanner?
3. List out cousins of the compiler.
4. Distinguish between compiler and interpreter.
5. Mention the issues in a lexical analyzer.
6. Define lexeme, token with example?
7. What is difference between Assembler and Compiler?
8. What is the role of Linker and Loaders?
9. What are the uses of Preprocessor?
10. What are the representation methods of Intermediate code?
FIVE MARK QUESTIONS
1.
2.
3.
4.

Describe the Analysis-Synthesis model of a compiler.


Explain the role of lexical analyzer in compilation process.
Explain the cousins of compiler with neat diagram?
What is regular Definition? Write regular definition for the identifier and unsigned
numbers in Pascal.
5. Explain lexeme, token and pattern with suitable example.
6. Explain about grouping of phases into passes?
7. Explain the specifications of tokens in Language?
8. Explain the concept of recognition of tokens in scanner.
9. Explain the Differences between compiler and interpreter?
10. Consider the following fragment of C code:
float i,j;
i=i*70+j+2;
Write the output at all phases of the compiler for the above C code.

TEN MARK QUESTIONS


1. What are various phases of compiler? Explain each phase in detail. Write down the
output of each phase for expression a=b+c*50.
2. Explain about Compiler construction tools?
3. What is the role of LEX? Explain the structure of LEX program with an example.
4. Explain the concept of Language processing system.

5. Explain the input buffer scheme for scanning the source program. How the use of
sentinels can improve its performance? Describe in detail.

Você também pode gostar