Principles of compiler design–Unit 1–Question Bank

Anna University

Department of Computer Science& Engineering

Question bank

Principles of compiler design

UNIT - 1

Part A

01. What is a translator?

02. Differentiate interpreters and compilers.

03. What are loaders and linkers?

04. What is an assembler?

05. What are the phases of a compiler?

06. What is bootstrapping a compiler?

07. What are the two parts of compilation? Explain briefly?

08. What is a structure editor?

09. What is preprocessor?

10. What is cross compiler?

11. What is lexical analyzer?

12. Give the parse tree for the statement a:= b + c*60.

14. What is a symbol table?

15. Briefly explain code optimization.

16. What are rational preprocessors?

17. What is the use of scanner generator?

18. What are the characteristics of a high-level programming language?

19. What do you mean by syntax and semantics of a language?

20. Give the hierarchy of programming elements.

22. Give some four compiler-generator tools.

23. Define Macros.

24. Define code generation phase.

25. Define intermediate code generation phase.

26. Mention the cousins of the compiler.

27. What are the functions of a linker?

28. What is an object program?

29. Define a token.

30. What is a preprocessor?

31. Give the format of a macro definition.

32. What is the need of syntax analysis?

33. Difference between Assembly language and Machine language.

34. Difference between compiler and interpreter.

Part B

1. Explain the various parameter passing mechanisms of a high level language. [16]

2. Explain about lexical analyzer and its role in detail. [16]

3. Explain the phases of the compiler in detail. Write down the output of each phase for the expression a := b + c * 50. [16]

4. Describe how various phases could be combined as a single pass in a compiler. [16]

5. Write short notes on:

(i) Loaders and Linkers. [8]

(ii) Assemblers. [8]

6.(i)Discuss the compiler construction tools. [8] (ii)Discuss about the Lexical Analyzer and its Role. [8]

7. Explain about Tokens, specification of tokens, recognition of tokens [16]

8. .Explain

i) Functions of lexical Analyzer [8]

ii)Input Buffering technique. [8]

9. Explain i) Types of compiler . [8]

ii) Cousins of compiler. [7]