Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

Pass and Phases of Translation

Pass and Phases of Translation:


A compiler can have many phases and passes.
• Pass: A pass refers to the traversal of a compiler through the entire
program.
• Phase: A phase of a compiler is a distinguishable stage, which takes
input from the previous stage, processes and yields output that can
be used as input for the next stage.
• A pass can have more than one phase.

51
Pass:A pass refers to the traversal of a compiler through the entire
program.
Types of passes:
1.Single(or)one pass compiler
2.Two(or)Multi pass complier

Single pass compiler: All the 6 phases are grouped into a single part
(or)single module, that is called as “single(or)one pass compiler”.

Two(or)Multipass compiler:All the 6 phases are divided into two parts,


that is called as “two(or)multipass compiler”.In this the first part is
called “Analysis part(front end)” and second part is called
“Synthesispart(backend)”.
52
Bootstrapping: Bootstrapping
• Bootstrapping mainly used to design in design of a complier.
• Bootstrapping is a process in which simple language is used to
translate more complicated program.This complicated program
can further handle even more complicated program.
• Applying this technique leads to a self-hosting compiler.
• A compiler is characterized by three languages:
• Source Language
• Target Language
• Implementation Language

54
Types of Compiler

Types of compiler
1.Incremental compiler
2.Cross compiler

Incremental compiler: Incremental compiler is a compiler which


performs the recompilation of only modified source rather than
compling the whole source program.

Features of Incremental language:


• It tracks the dependancies between output and the source
program.
• it produces the same result as full recompile.
• The process of incremental compilation is effective for
maintaince.
56
Cross compiler: A compiler which runs on one
machine and produces the target codefor another
machine.Such a compiler is called as cross compiler.
57

You might also like