Types of Compiler
Types of Compiler
➢ It converts high level language into machine language. High level language
means English, Hindi etc. and machine level language means binary,
assembly language.
➢ Compiler is a special program that processes statements (instructions)
written in a particular programming language (c, cpp, java, python, etc.)
and turns them into machine language.
Types of Compiler
Following are the different types of Compiler:
• Single Pass Compilers
• Two Pass Compilers
• Multipass Compilers
Advantages:
➢ Compilation process is very fast because all phases are implemented in a
single module.
Disadvantages:
➢ It takes more space in the main memory because all its phases are
implemented in a single module.
Two-Pass Compilers
Advantages:
➢ At a time only one module is placed into the main memory
➢ The performance of the compiler is increased due to two modules.
Disadvantages:
➢ It is slow as compared to a single-pass compiler.
Multi-Pass Compilers
Source Target
Front Middle Back
Code IR IR Code
End End End
Advantages:
➢ At a time only one module is placed into the main memory
➢ The performance of the compiler is increased due to multiple modules.
➢ It consumes less space in the main memory as only one module of it is
placed in the main memory at a time.
Disadvantages:
➢ It is slow as compared to a single-pass compiler.