What are Compilers?

In computer programming, a compiler is a program that parses or analyzes statements written in a particular programming language and then turns them into “code” or machine language used by the computer’s processor. A programmer in a custom software company has to run an appropriate language compiler to translate source code into object code. Firstly, the programmer writes statements in a language (such as C, C++ or PASCAL) using an editor. The statements are written one line at a time. A file is created containing these source statements. The programmer specifies the name of the file to the appropriate language compiler and runs the compiler. The compiler analyzes or parses the language statements one after the other syntactically. It then builds the output code in one or more successive “passes” or stages. In traditional terms, the output is referred to as object module or object code. Here, the object code is a machine code that is processed or executed by the processor one instruction at a time. In the software product development process, the compiler has many operations including parsing, pre-processing, lexing, code optimizations and code generation. Earlier, the approach taken to design a compiler used to be affected by the resources available, the programmer’s experience in designing it and the difficulty of processing. For simple languages, the compiler was a single piece of program in the past. However, as the source languages became larger and more complex, and high quality output became crucial, the design got split into a number of independent phases. In today’s online software development scenario, the smallest of the compilers has 2-3 phases. These phases are always regarded as front-end, middle-end and back-end. The front end is where the syntactic parsing as well as the translation of the source code takes place. The middle end is used to perform optimizations. The back end phase takes the analysis, optimizations and transformation process a bit further. Then the code is generated for a particular processor and operating system.

0 comments:

 
Owner 2008 adsense-groups.blogspot.com . All rights reserved | Hot Photo Galleries is proudly powered by Blogger.com