Compiler

Fortran Compilers and Tools
32-bit x86 and 64-bit EM64T and AMD64 parallel Linux and Windows compilers. Fortran, C and C++, parallel debugger and parallel performance profiler. Download free trial.
www.pgroup.com

Coding Development Tools
Get solutions for Open Source, C++, Java source code. D/L whitepapers.
Coverity.com/codingsolutions

Java Compiler
Improve your Java skills with hands on training. Register now.
www.traininghott.com/Java

C Compiler
Find and Compare prices on c compiler at Smarter.com.
www.smarter.com

Compilers - Cheap Prices
Save on Compilers. Find the Best Value Fast with Trusted Sellers.
www.NexTag.com

Fortran Compiler
Explore 5,000+ Hardware Choices. Deals On fortran compiler.
Shopzilla.com/computerhardware

Compilers at Amazon
Low prices on Compilers. Qualified orders over $25 ship free.
Amazon.com

Ø Slash Your Tax Debt Ø
Settle IRS debt down to a fraction. Eliminate Liens & Levies.
www.Tax-Resolve.com

Compiler
Find Computer Deals at Yahoo! Low Prices On compiler.
shopping.yahoo.com

Online Best Survey
For the easiest money that you'll ever make, take Online Best Survey.
paydotcom.com




Warning: mkdir() [function.mkdir]: Permission denied in /home/webs/affiliatelib2/CacheManager.php on line 12

Warning: mkdir() [function.mkdir]: No such file or directory in /home/webs/affiliatelib2/CacheManager.php on line 12

Warning: fopen(/home/templatecore2cache//*cluesnet.com/0c/0c71c5ce8ebe2a667e7593a4d20be50c7d277d9d.tc2cache) [function.fopen]: failed to open stream: No such file or directory in /home/webs/affiliatelib2/CacheManager.php on line 130

Warning: fwrite(): supplied argument is not a valid stream resource in /home/webs/affiliatelib2/CacheManager.php on line 131

Warning: fclose(): supplied argument is not a valid stream resource in /home/webs/affiliatelib2/CacheManager.php on line 132







A compiler is a computer program (or set of programs) that translates text written in a programming language (the source language) into another computer language (the target language). The original sequence is usually called the source code and the output called object code. Commonly the output has a form suitable for processing by other programs (e.g., a linker), but it may be a human-readable text file.

The most common reason for wanting to translate source code is to create an executable program. The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine language). A program that translates from a low level language to a higher level one is a decompiler. A program that translates between high-level languages is usually called a language translator, source to source translator, or language converter. A language rewriting is usually a program that translates the form of expressions without a change of language.

A compiler is likely to perform many or all of the following operations: lexical analysis, preprocessing, parsing, semantic analysis, code generation (compiler), and code optimization.

History Software for early computers was exclusively written in assembly language for many years. Higher level programming languages were not invented until the benefits of being able to reuse software on different kinds of CPUs started to become significantly greater than the cost of writing a compiler. The very limited Computer storage capacity of early computers also created many technical problems when implementing a compiler.

Towards the end of the 1950s, machine-independent programming languages were first proposed. Subsequently, several experimental compilers were developed. The first compiler was written by Grace Hopper, in 1952, for the A-0 programming language programming language. The FORTRAN team led by John Backus at IBM is generally credited as having introduced the first complete compiler, in 1957. COBOL was an early language to be compiled on multiple architectures, in 1960.http://www.interesting-people.org/archives/interesting-people/199706/msg00011.html

In many application domains the idea of using a higher level language quickly caught on. Because of the expanding functionality supported by newer programming languages and the increasing complexity of computer architectures, compilers have become more and more complex.

Early compilers were written in assembly language. The first self-hosting compiler — capable of compiling its own source code in a high-level language — was created for Lisp programming language by Hart and Levin at Massachusetts Institute of Technology in 1962.http://www.ai.mit.edu/research/publications/browse/0000browse.shtmlSince the 1970s it has become common practice to implement a compiler in the language it compiles, although both Pascal (programming language) and C (programming language) have been popular choices for implementation language. Building a self-hosting compiler is a bootstrapping (compilers) problem -- the first such compiler for a language must be compiled either by a compiler written in a different language, or (as in Hart and Levin's Lisp compiler) compiled by running the compiler in an Interpreter (computing).

Compilers in education Compiler construction and compiler optimization are taught at universities as part of the computer science curriculum. Such courses are usually supplemented with the implementation of a compiler for an educational programming language. A well-documented example is Niklaus Wirth's PL/0 compiler, which Wirth used to teach compiler construction in the 1970s.http://www.246.dk/pl0.html In spite of its simplicity, the PL/0 compiler introduced several influential concepts to the field:

  • Program development by stepwise refinement (also the title of a 1971 paper by Wirthhttp://www.acm.org/classics/dec95/)
  • The use of a recursive descent parser
  • The use of EBNF to specify the syntax of a language
  • A code generation (compiler) producing portable P-code
  • The use of T-diagrams in the formal description of the bootstrapping (compilers) problem


  • Compiler output One method used to classify compilers is by the platform (computing) on which the generated code they produce executes. This is known as the target platform.

    A native or hosted compiler is one whose output is intended to directly run on the same type of computer and operating system as the compiler itself runs on. The output of a cross compiler is designed to run on a different platform. Cross compilers are often used when developing software for embedded systems that are not intended to support a software development environment.

    The output of a compiler that produces code for a virtual machine (VM) may or may not be executed on the same platform as the compiler that produced it. For this reason such compilers are not usually classified as native or cross compilers.

    Compiled versus interpreted languages Higher-level programming languages are generally divided for convenience into compiled languages and interpreted languages. However, there is rarely anything about a language that requires it to be exclusively compiled, or exclusively interpreted. The categorization usually reflects the most popular or widespread implementations of a language — for instance, BASIC is thought of as an interpreted language, and C a compiled one, despite the existence of BASIC compilers and C interpreters.

    In a sense, all languages are interpreted, with "execution" being merely a special case of interpretation performed by transistors switching on a CPU. Modern trends toward just-in-time compilation and bytecode also blur the traditional categorizations.

    There are exceptions. Some language specifications spell out that implementations must include a compilation facility; for example, Common Lisp. Other languages have features that are very easy to implement in an interpreter, but make writing a compiler much harder; for example, APL, SNOBOL4, and many scripting languages allow programs to construct arbitrary source code at runtime with regular string operations, and then execute that code by passing it to a special evaluation function. To implement these features in a compiled language, programs must usually be shipped with a runtime library that includes a version of the compiler itself.

    Hardware compilation The output of some compilers may target hardware at a very low level. For example a Field Programmable Gate Array (FPGA) or structured Application-specific integrated circuit (ASIC). Such compilers are said to be hardware compilers or synthesis tools because the programs they compile effectively control the final configuration of the hardware and how it operates; there are no instructions that are executed in sequence - only an interconnection of transistors or lookup tables.For example, XST is the Xilinx Synthesis Tool used for configuring FPGAs. Similar tools are available from Altera, Synplicity, Synopsys and other vendors.

    Compiler design The approach taken to compiler design is affected by the complexity of the processing that needs to be done, the experience of the person(s) designing it, and the resources (eg, people and tools) available.

    A compiler for a relatively simple language written by one person might be a single, monolithic, piece of software. When the source language is large and complex, and high quality output is required the design may be split into a number of relatively independent phases, or passes. Having separate phases means development can be parceled up into small parts and given to different people. It also becomes much easier to replace a single phase by an improved one, or to insert new phases later (eg, additional optimizations).

    The division of the compilation processes in phases (or passes) was championed by the Production Quality Compiler-Compiler Project (PQCC) at Carnegie Mellon University. This project introduced the terms front end, middle end (rarely heard today), and back end.

    All but the smallest of compilers have more than two phases. However, these phases are usually regarded as being part of the front end or the back end. The point at where these two ends meet is always open to debate. The front end is generally considered to be where syntactic and semantic processing takes place, along with translation to a lower level of representation (than source code).

    The middle end is usually designed to perform optimizations on a form other than the source code or machine code. This source code/machine code independence is intended to enable generic optimizations to be shared between versions of the compiler supporting different languages and target processors.

    The back end takes the output from the middle. It may perform more analysis, transformations and optimizations that are for a particular computer. Then, it generates code for a particular processor and OS.

    This front-end/middle/back-end approach makes it possible to combine front ends for different programming language with back ends for different CPUs. Practical examples of this approach are the GNU Compiler Collection, LLVM, and the Amsterdam Compiler Kit, which have multiple front-ends, shared analysis and multiple back-ends.

    One-pass versus multi-pass compilers Classifying compilers by number of passes has its background in the hardware resource limitations of computers. Compiling involves performing lots of work and early computers did not have enough memory to contain one program that did all of this work. So compilers were split up into smaller programs which each made a pass over the source (or some representation of it) performing some of the required analysis and translations.

    The ability to compile in a one-pass compiler is often seen as a benefit because it simplifies the job of writing a compiler and one pass compilers are generally faster than multi-pass compilers. Many languages were designed so that they could be compiled in a single pass (e.g., Pascal (programming language)).

    In some cases the design of a language feature may require a compiler to perform more than one pass over the source. For instance, consider a declaration appearing on line 20 of the source which affects the translation of a statement appearing on line 10. In this case, the first pass needs to gather information about declarations appearing after statements that they affect, with the actual translation happening during a subsequent pass.

    The disadvantage of compiling in a single pass is that it is not possible to perform many of the sophisticated compiler optimization needed to generate high quality code. It can be difficult to count exactly how many passes an optimizing compiler makes. For instance, different phases of optimization may analyse one expression many times but only analyse another expression once.

    Splitting a compiler up into small programs is a technique used by researchers interested in producing provably correct compilers. Proving the correctness of a set of small programs often requires less effort than proving the correctness of a larger, single, equivalent program.

    While the typical multi-pass compiler outputs machine code from its final pass, there are several other types:



    Front end The front end analyses the source code to build an internal representation of the program, called the intermediate representation or IR. It also manages the symbol table, a data structure mapping each symbol in the source code to associated information such as location, type and scope. This is done over several phases, which includes some of the following:

  • Line reconstruction. Languages which stropping their keywords or allow arbitrary spaces within identifiers require a phase before parsing, which converts the input character sequence to a canonical form ready for the parser. The top-down parsing, recursive descent parser, table-driven parsers used in the 1960s typically read the source one character at a time and did not require a separate tokenizing phase. Atlas Autocode, and Edinburgh IMP (and some implementations of Algol60 and CORAL66) are examples of stropped languages whose compilers would have a Line Reconstruction phase.
  • Lexical analysis breaks the source code text into small pieces called tokens. Each token is a single atomic unit of the language, for instance a keyword (computer), identifier or symbol. The token syntax is typically a regular language, so a finite state automaton constructed from a regular expression can be used to recognize it. This phase is also called lexing or scanning, and the software doing lexical analysis is called a lexical analyzer or scanner.
  • Preprocessor. Some languages, e.g., C language, require a preprocessing phase which supports Macro (computer science) substitution and conditional compilation. Typically the preprocessing phase occurs before syntactic or semantic analysis; e.g. in the case of C, the preprocessor manipulates lexical tokens rather than syntactic forms. However, some languages such as Scheme support macro substitutions based on syntactic forms.
  • Syntax analysis involves parsing the token sequence to identify the syntactic structure of the program. This phase typically builds a parse tree, which replaces the linear sequence of tokens with a tree structure built according to the rules of a formal grammar which define the language's syntax. The parse tree is often analyzed, augmented, and transformed by later phases in the compiler.
  • Semantic analysis is the phase in which the compiler adds semantic information to the parse tree and builds the symbol table. This phase performs semantic checks such as type checking (checking for type errors), or object binding (associating variable and function references with their definitions), or definite assignment (requiring all local variables to be initialized before use), rejecting incorrect programs or issuing warnings. Semantic analysis usually requires a complete parse tree, meaning that this phase logically follows the parsing phase, and logically precedes the code generation (compiler) phase, though it is often possible to fold multiple phases into one pass over the code in a compiler implementation.


  • Back end The term back end is sometimes confused with code generation (compiler) because of the overlapped functionality of generating assembly code. Some literature uses middle end to distinguish the generic analysis and optimization phases in the back end from the machine-dependent code generators.

    The main phases of the back end include the following:

  • Compiler analysis: This is the gathering of program information from the intermediate representation derived from the input. Typical analyses are data flow analysis to build use-define chains, dependence analysis, alias analysis, pointer analysis, escape analysis etc. Accurate analysis is the basis for any compiler optimization. The call graph and control flow graph are usually also built during the analysis phase.
  • Compiler optimization: the intermediate language representation is transformed into functionally equivalent but faster (or smaller) forms. Popular optimizations are inline expansion, dead code elimination, constant propagation, loop transformation, register allocation or even automatic parallelization.
  • Code generation (compiler): the transformed intermediate language is translated into the output language, usually the native machine language of the system. This involves resource and storage decisions, such as deciding which variables to fit into registers and memory and the selection and scheduling of appropriate machine instructions along with their associated addressing modes (see also Sethi-Ullman algorithm).


  • Compiler analysis is the prerequisite for any compiler optimization, and they tightly work together. For example, dependence analysis is crucial for loop transformation.

    In addition, the scope of compiler analysis and optimizations vary greatly, from as small as a basic block to the procedure/function level, or even over the whole program (interprocedural optimization). Obviously, a compiler can potentially do a better job using a broader view. But that broad view is not free: large scope analysis and optimizations are very costly in terms of compilation time and memory space; this is especially true for interprocedural analysis and optimizations.

    The existence of interprocedural analysis and optimizations is common in modern commercial compilers from HP, IBM, Silicon Graphics, Intel, Microsoft, and Sun Microsystems. The open source GNU Compiler Collection was criticized for a long time for lacking powerful interprocedural optimizations, but it is changing in this respect. Another good open source compiler with full analysis and optimization infrastructure is Open64, which is used by many organizations for research and commercial purposes.

    Due to the extra time and space needed for compiler analysis and optimizations, some compilers skip them by default. Users have to use compilation options to explicitly tell the compiler which optimizations should be enabled.

    Related techniques Assembly language is not a high-level language and a program that compiles it is more commonly known as an assembler, with the inverse program known as a disassembler.

    A program that translates from a low level language to a higher level one is a decompiler.

    A program that translates between high-level languages is usually called a language translator, source to source translator, language converter, or language rewriting. The last term is usually applied to translations that do not involve a change of language.

    See also

    Notes References

    External links



    compiler from FOLDOC
    compiler < programming, tool > A program that converts another program from some source language (or programming language) to machine language (object code).

    compiler jock from FOLDOC
    compiler jock. A programmer who specialises in writing compilers. [Jargon File] (1995-01-19) Try this search on Wikipedia, OneLook, Google

    Compiler - Wikipedia, the free encyclopedia
    A compiler is a computer program (or set of programs) that translates text written in a computer language (the source language) into another computer language (the target language ...

    compiler
    The Free Online Dictionary of Computing (http://foldoc.doc.ic.ac.uk/) is edited by Denis Howe < dbh@doc.ic.ac.uk >. Previous: Competitive Access Provider Next: Compiler-Compiler

    Compiler Technology and Computer Architecture Group » Home
    The personal web log of a web site builder and designer ... Welcome to the Compiler Technology and Computer Architecture Group of the University of Hertfordshire School of Computer ...

    abc: The AspectBench Compiler for AspectJ - Introduction
    The distribution of an optimising, extensible compiler for AspectJ, freely available under the LGPL. The abc project is a joint effort between the University of Oxford (UK), McGill ...

    AskOxford: compiler
    compiler • noun 1 a person who compiles information. 2 a computer program that translates instructions from a high-level language into a machine-code or lower-level form which ...

    wxMSW Compiler choice
    Compares compile times and final file sizes of wxMSW compiled with Borland C++ 5.5, Open Watcom 1.0, Gcc 3.2, Visual C++ 6, and Digital Mars.

    PRECC - A PREttier Compiler-Compiler
    an infinite-lookahead parser generator for context dependent grammars which generates ANSI C code. Specification scripts are in very extended BNF with inherited and synthetic ...

    Free Crosswords - Free Online Crossword Compiler - Free Daily Sudoku
    Offers archive of puzzles in various sizes, solving software, and a crossword builder.





     
    Copyright © 2008 opini8.com - All rights reserved.
    Home | Terms of Use | Privacy Policy
    All Trademarks belong to their repective owners.
    Many aspects of this page are used under
    commercial commons license from Yahoo!