Compiler Design Question Bank-UNIT 1
Compiler Design Question Bank-UNIT 1
Compiler Design Question Bank-UNIT 1
Source Target
Compiler
Program Program
Error Messages
2. What are the two parts of Compilation? Explain briefly. (Understand) (Apr 2016, Apr 2017)
There are two parts of compilation process
Analysis part
Synthesis part
Analysis Part – It breaks up the source program into constituent pieces and applies the
grammatical structure on them. It uses this structure to create an intermediate representation of
the source program. It also collects information about the source program and stores it in a data
structure called symbol table.
The analysis must provide information to the user if the source program is syntactically
incorrect and semantically unsound, so the user can take the corrective measures. The analysis
part is called as front end of the compiler.
Synthesis Part – It constructs the desired target program from the intermediate representation
and the information in the symbol table. The synthesis part is called as back end of the compiler.
Intermediate
Source Frond End Back end of Target
representation of
Program of Compiler Compiler Program
source Program
3. Illustrate diagrammatically how a language is processed? (Understand) (Apr 2016)
In addition to the compiler, there are several other programs may be required to
produce an executable target program. They are called cousins of compiler. They
are listed below.
1. Preprocessor.
2. Assembler
3. Loader
4. Linker
Each program helps in compilation process.
Source Program
Preprocessor
Compiler
Assembler
Source Program
Interpreter Output
input