Sunday May 20
Move
Display 0 | 5 | 10 | 15 Stories

Gadget

Topics
Top Story

Waterproof LCD for Bathrooms

Waterproof LCD for Bathrooms

  Have you been wishing for a waterproof LCD TV for use in you bathroom? Good for you, Vu has launched...

PlayStation 4 Release date and Features

PlayStation 4 Release date and Features

  The next generation PlayStation may arrive sooner than we think.. maybe even in 2009! But based...

XBox 720 Release date and Features

  In an interview with the head of Microsoft’s Interactive Entertainment Business division, Peter...

Wii 2 Release date and Features

  Nintendo are selling Wii’s faster than stores can stock them and some may believe that they...

PSP 2 Release date and Features

  The PS2P should be available in 2009 - 10, to compete with the upgraded Nintendo DS. Some features...

Upcoming Game Consoles

Gadget

Move
Display 0 | 5 | 10 | 15 Stories

Software Tutorials

Topics
Top Story

How to Enable / Disable Autoformat in word 2007

How to Enable / Disable Autoformat in word 2007

  The interface of Office 2007 does does not offer an intuitive tool to enable or disable the autocorrect...

How to use old MSN Messenger without upgrading

  If you dont like the newer version of MSN Live Messenger and want to use the old MSN Messenger...

Software Tutorials

 

Move
Display 0 | 5 | 10 | 15 Stories

General

Topics
Top Story

PRAM model of Parallel Computation

PRAM model of Parallel Computation

  A PRAM consists of a control unit, global memory, and an unbounded set of processors,each with its...

The Crisis of Credit Visualized

A Vimeo video by Jonathan Jarvis attempting to visually explain the credit crisis -   The Crisis...

How to carry money while travelling

If you are planning to go abroad for any purpose, like higher studies, tourism or business purpose,...

How to call from US to india

  There are many ways to call back to india You can take a sim card from the Matrix company and...

Translation of source code to object module : The Preprocessor Compilation Process

The preposessor (We'll be talking of the C preprocessor) is a seperate program invoked by the compiler...

Virtua Kitchen - The Kitchen Operating System

What is a Synergistic Processing Element / SPE

What is a Power Processor Element / PPE

What is the Element Interconnect Bus / EIB

What is the Cell Architecture

Why use Automated Testing Tools

What is the Software Testing Life Cycle (STLC)

What is Software Testing

AudioSurf - Ride Your Music !

Ubuntu 8.10 is out!

Move
Display 0 | 5 | 10 | 15 Stories

Programming

Topics
Top Story

Code for Writing a xlsx file in java

Here is a small code to write xlsx file though java code.    You may need to include some of...

Code for Reading a xlsx file in java

Here is a small code to read xlsx file thoug java code.    You may need to include some of the...

How to read and write data from socket in java

   ServerSocket serverSocket=new ServerSocket(port);  // The below statement will wait for the...

Producer Consumer Problem in C using Semaphores and Shared Memory

  The classic bounded-buffer problem can be implemented using a variety of synchronization mechanisms....

Common Intermediate Language

Common Intermediate Language (formerly called Microsoft Intermediate Language or MSIL) is the lowest-level...

Common Type System in C#

Common Language Runtime

A Quick Introduction to C# Features

Code for updating database using hibernate framework in java

Conversion of int to byte and vice versa

Web Crawler in Python

Neural Network in Python

Programming

Move
Display 0 | 5 | 10 | 15 Stories

Graphics

Topics
Top Story
Move
Display 0 | 5 | 10 | 15 Stories

Linux

Topics
Top Story

Linux

 

Move
Display 0 | 5 | 10 | 15 Stories

Web

Topics
Top Story

What is Kosmix

  I am guessing that you looked up the term ' What is Kosmix ' on google after hearing somewhere about...

What is a meta tag

  There was a time when I didnt know of Meta tags myself. I'm glad I do now as they have really helped...

Why some search results have no description

  Before I go on to explain why some search results have no description , I woud like to state that...

What is the Facebook Bill of Rights

Have you also been wondering what the facebook bill of rights is? Here is the short answer to the popular...

The Fastest Safari Browser

  Apple has announced the public beta of Safari 4 for Macintosh and Windows PCs, which is the fastest...

Web

Move
Display 0 | 5 | 10 | 15 Stories

Games

Topics
Top Story

Games

 

Move
Display 0 | 5 | 10 | 15 Stories

Windows

Topics
Top Story

Windows

 

Translation of source code to object module : The Preprocessor Compilation Process

(0 votes, average: 0 out of 5)




Article Index
Translation of source code to object module : The Preprocessor Compilation Process
The Compilation Process
All Pages

The preposessor (We'll be talking of the C preprocessor) is a seperate program invoked by the compiler as the first part of translation of the source code generated by a programmer.The source code is translated from a source file (encoded in a source character set) to an object module (remember the .obj files that you see while compiling C programs?).This end product is known as a translation unit.It should be noted that the properties of scoping , visibility and linkage apply to this translation unit and not the source code.

                   compilation translation unit

For the sake of clarity , I restate that the translation unit shown above above is the product of preprocessing and the properties of scoping , visibility and linkage cannot be applied at any stage before obtaining this unit.

 

The compilation process is a non-deterministic , abstract finite state machine .

 

The above statement is quite short and simple but it's complete meaning is rarely understood by novices.Note the three things said abut the compilation process.I'll continue to break down and analyze each part of this important sentence.

Non-deterministic : The first term is 'non-deterministic'. Compilation is said to be non-deterministic as loopholes are left in implementation - deliberately. Four kinds of situations may occur :

  • Implementation defined : As the name suggests , these are left to the implementing agent . An example would be a right shift assign operator. These need to be documented.
  • Undefined : When a program can give two different results on two different systems or architectures depending on the support that the hosted environment provides. An example would be that of an int overflow behavior.
  • Unspecified : These are left to be implemented in the most efficient manner.These behaviors need not be documented. A good example would be the order of evaluation of arguments passed to a function. There is no decided order in which arguments are evaluated , resulting in possibly different behavior on different calls to a particular function.
Fn(++a,++a) - Here the ',' is not an operator but a separator and the order of execution is unspecified.The sequence point is at beginning of function.
In order to explain examples more clearly , three terms need to be understood first
Side Effects : Anything that changes state.
Sequence Point : Sequence of operations in the abstract machine.
Agreement Points : Subject to constraints.
It is required that multiple side effects are not made while crossing a sequence point.This point will be illustrated in the following example :
ARY[b++] = ++b+c;  - Here the sequence point at the end ( ; terminator ) and multiple side-effects are made without crossing the sequence point , hence the order of evaluation is undefined.
Early evaluation oriented languages - Arguments are evaluated before body is entered . Eg - C , C++ .
Lazy evaluation oriented languages - Arguments are not evaluated till they actually get used. Eg - SML , DYLAN .
  • Locale Specific : The behavior of these points are dependent on the implementation of the C library, and are not defined by GCC itself. Eg - stripping of spaces between characters.

Abstract : The second term is 'abstract'. The compilation process is said to be abstract because there is no physical implementation of the represented steps.Everything works strictly according to an 'AS-IF' philosophy where steps seem to occur AS-IF a model were being followed , but is not actually (in the processor and control unit).

Finite state machine : The third and last term is 'Finite state machine'.A set of states is maintained and changes in these states reflect actual state of program.

With that , we have finally understood the meaning of the sentence ' The compilation process is a non-deterministic , abstract finite state machine .'  :)

I will now proceed to the eight conceptual phases of translation of the source file by the preprocessor , in the next section.



Tag Cloud

Login Form