Professional Documents
Culture Documents
Attention Friends... Don't forget to LIKE our Facebook page Here for daily updates
u can mail your Interview Experiences, Inspirational Stories and other Articles to Gr8AmbitionZ@Gmail.com. We will publish them with your Name and Pic..
Home
English
AptitudeShortcuts
ReasoningShortcuts
Current Affairs
Banking Awareness for IBPS POs and Clerks Interview Preparation Tips
SEA RCH YOU R T OPIC HERE.........
Gr8AmbitionZ Search
Like 42,339 people like Gr8AmbitionZ.
SUNDAY,
FEBRUARY
26,
2012
1. Lexical Analyser : Performs Lexical Analysis 2. Syntax Analyser : Performs Syntax Analysis 3. Semantic Analyser : Performs Semantic Analysis 4. Intermediate Code Generator : Performs Intermediate Code Generation 5. Code Optimizer : Performs Code Optimization 6. Code Generator : Generates Target Code
www.gr8ambitionz.com/2012/02/phases-of-compiler.html
1/6
9/23/13
ARM Cortex & 8051 Boards Learn C, C++, C# Dell Laptops Agile Development Tool Hardware Engg in 75 days MLton SML compiler PIC C Compilers
Now lets have a look at the functionalities of all these phases. Lexical Analysis : It is nothing but analyzing the LEXEMs (tokens), in this phase, the compiler scans the entire program and pics the tokens and groups them. Syntax Analysis : Syntax is nothing but the structure. It is nothing but to Analyze the structure of the program (whether it is correct or not) Semantic Analysis : In this the compiler checks the MEANING of the program. (Note : The above two process will execute simultaniously, so in some books they combine these two names and call the process as Syntax and Semantic Analysis) Intermediate Code Generation : After scanning the program, the compiler generates an intermediate code (which is neither High level code nor Low level code, which looks like the Microprocessor Code) Note : Most of the compilers generates the TAC (Three Address Code) as the Intermediate Code. It contains, maximum 3 variable, so we call it as the Three Address Code. (note : we can convert any problem into this TAC form). it just look like, Temp1 = Temp2 + Temp3 (temporary variables) or Temp2 = Id + Temp4 etc, Code Optimization : It helps to improve the Intermediate Code. It make assure that the target code will run EFFICIENTLY in LESS TIME ( i mean, it should give the desired output in less amount of time) Code Generation : It is the final phase. It generates the relocatable machine code or assembly code. It takes care about the target machine and where to store the variables in the target machine. Y ea ofcourse, it takes care about the ORDER of the instruction execution too.
General Knowledge
www.gr8ambitionz.com/2012/02/phases-of-compiler.html
2/6