Before we know about the phases of compiler,we must know waht is compiler.

Compiler :

Compiler is a simple program  which reads a program written in one language (i.e., High Level Language (or) Source Language) and it translates to an equivalent target program (i.e., Low Level Language).

Now we are going to  know  what are the different phases of compilers.

Phases of Compiler:

Compiler consists of 2 phases.

1.Analysis Phase

2.Synthesis phase

1.Analysis Phase :

Analysis Phase performs 3 actions namely

a)Lexical analysis - it contains a sequence of characters called tokens.Input is source program & the output is tokens.

b)syntax analysis - input is token and the output is parse tree

c)Semantic analysis - input is parse tree and the output is expanded version of parse tree

2.Synthesis Phase :

Synthesis Phase performs 3 actions namely

d)Intermediate Code generation - Here all the errors are checked & it produce an intermediate code.

e)Code Optimization - the intermediate code is optimized here to get the target program

f) Code Generation - this is the final step & here the target program code is generated.

Like it on Facebook, +1 on Google, Tweet it or share this article on other bookmarking websites.


Written by
Vijay
I am Business Man
  • No comments found

Latest Articles

In this article, you shall learn how to withdraw your money from your PayPal account. To withdraw your money, the first thing you need to do is ‘Login’
Humans are social being and we need to interact with people. A friend plays an important role in one's life. Sometimes, we face loneliness and feel like
Donald Trump won the election but lost the popular vote. This is the dichotomy of the American election where it is not the case of first past the post.

Related Articles

'As you sow, so shall you reap' is what the Karma is. In simple word it means action or deeds of a person repay him or her. We have seen or heard so many
Sex is a driving force and as per the theories of Hegel and Kant the driving force in a man's life. The philosophers also identified power as another driving
An army veteran has committed suicide and this has brought into focus the great divide that exists between reality and rhetoric. this was something bound
The Indian armed forces consist of the Army. Airforce and Navy. All 3 arms trace their pedigree to of the Raja.  They do not draw any sustenance  from
https://en.wikipedia.org/wiki/Lockheed_F-117_Nighthawk  When I visited the USA in 1998 as part of the air team we were quartered at one of the