Compiler,interpreter Introduction

compilers
 Compiler is program that reads a program written in one language(source language) and translate it into an equivalent program in another language(target language). as an important part of translation process, the compiler report to its user the presence of errors in the source program.



interpreter

An interpreter may be a program that either
  • execute the source code directly
  • translate source code int some efficient intermediate representation()code and immediately executes this
  • explicitly execute stored pre-compiled code made by a compiler which is part of the interpreter system .


Compiler vs. Interpreter


Compiler characteristics:
  • spends a lot of time analyzing and processing the program
  • the resulting executable is some form of machine- specific binary code
  • the computer hardware interprets (executes) the resulting code
  • program execution is fast
Interpreter characteristics:
  • relatively little time is spent analyzing and processing the program
  • the resulting code is some sort of intermediate code
  • the resulting code is interpreted by another program
  • program execution is relatively slow
compilation
There are two parts to compilation they are
  • analysis
  • synthesis  
The analysis part break up the source program into constituent pieces and create an intermediate representation of source program.
The synthesis part construct the desired target program from the intermediate representation. of the two parts synthesis required the most specialized technique.

                                                                                                                                            next topic

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews