Sponsered Links
Categories
Sponsered Links

The Compiler

 

A C program is made by running a compiler which takes the typed source program and converts it into an object file that the computer can execute. A compiler usually operates in two or more phases and each phase may have stages within it. These phases must be executed one after the other. As we shall see later, this approach provides a flexible way of compiling programs which are split into many files.

 

A compiler works in two-phase as follows:

  • It scans a source program, perhaps generating an intermediate code which helps to simplify the grammar of the language for subsequent processing. It then converts the intermediate code into a file of object code. A separate object file is built for each separate source file.
  • In second phase it behaves like Linker. This program appends standard library code to the object file so that the code is complete and can "stand alone". A C compiler linker suffers the slightly arduous task of linking together all the functions in the C program. Even at this stage, the compiler can fail, if it finds that it has a reference to a function which does not exist.

 

 
 
Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved