Sunday, June 10, 2012

compiler


Compiler: A compiler is a program that accepts a program written in a High Level Language and produces an object (low-level) program.
The compilation can be done in two parts: Analysis and Synthesis.
In Analysis part the source program is read and broken down into constituent  pieces. The syntax and the meaning of the source string is determined and then an intermediate code is created from input source program.
In Synthesis part this intermediate form of the source language is taken and converted into an equivalent target program. During this process if certain code has to be optimized for efficient execution then the required code is optimized. 



Properties of Compiler

1. The compiler itself must be bug-free.
2. It must generate correct machine code
3. The generated machine code must run fast
4. The compiler itself must run fast.
5. The compiler must be portable.
6. It must give good diagnostics and error messages.
7. The generated code must work well with existing debuggers
8. It must have Consistent optimization.


Features of good compiler


various features of good compiler are as given below:-
1.  The good compiler  compiles the a large amount code in less time.
2. The good compiler requires less amount of memory space to compile  the source language.
3. the good compiler can compile only the modified code segment if  frequent modifications are required in the source program
4. while handling the hardware interrupts the good compilers interact closely with operating system.



2 comments: