Difference between One Pass and Two Pass Compiler
One pass | Two-pass |
---|---|
It performs Translation in one pass | It performs Translation in two pass |
It scans the entire file only once. | It requires two passes to scan the source file. |
It generates Intermediate code | It does not generate Intermediate code |
It is faster than two pass assembler | It is slower than two pass assembler |
A loader is not required | A loader is required. |
No object program is written. | A loader is required as the object code is generated. |
Perform some professing of assembler directives. | Perform processing of assembler directives not done in pass-1 |
The data structure used are: The symbol table, literal table, pool table, and table of incomplete. |
The data structure used are: The symbol table, literal table, and pool table. |
These assemblers perform the whole conversion of assembly code to machine code in one go. | These assemblers first process the assembly code and store values in the opcode table and symbol table and then in the second step they generate the machine code using these tables. |
Example: C and Pascal uses One Pass Compiler. | Example: Modula-2 uses Multi Pass Compiler. |
Single Pass vs Two-Pass (Multi-Pass) Compilers
This article explores the concept of compiler passes in the field of software development, focusing on two types: the Single Pass Compiler and the Two-Pass Compiler (Multi-Pass Compiler). It explains their differences, advantages, and use cases, providing insights into the world of compiler design.
Contact Us