If we combine or group all the phases of compiler design in a single module known as single pass compiler

Two-pass/multi-pass Compiler is a type of compiler that processes the source code or abstract syntax tree of a program multiple times. In a multi-pass Compiler, we divide phases into two passes:
The first Phase is also referred to as Frontend, Analytical part, and platform independent.
The second phase is also referred to as the Backend, Synthesis part, and Platform dependent.

First: If we want to design a compiler for a different programming language for the same machine. In this case for each programming language, there is a requirement to make the Front end/first pass for each of them and only one Back end/second pass as:

Second: If we want to design a compiler for the same programming language for different machines/systems. In this case, we make different Back end for different Machine/system and make only one Front end for the same programming language as:

| 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. |


Note: here B and C are not final state. it is normal state.




Note: here B and C are not final state. it is normal state.



