Difference between revisions of "Compiler"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(See also)
Line 40: Line 40:
 
* [[Lexical analysis]]
 
* [[Lexical analysis]]
 
* [[Low-level programming language]]
 
* [[Low-level programming language]]
 +
* [[Machine code]]
 
* [[Object code]]
 
* [[Object code]]
 
* [[Parsing]]
 
* [[Parsing]]

Revision as of 20:22, 17 February 2016

A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code).

Description

The most common reason for converting a 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 code). If the compiled program can run on a computer whose CPU or operating system is different from the one on which the compiler runs, the compiler is known as a cross-compiler. More generally, compilers are a specific type of translators.

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 source-to-source compiler or transpiler.

Language rewriter

A language rewriter is usually a program that translates the form of expressions without a change of language. The term compiler-compiler is sometimes used to refer to a parser generator, a tool often used to help create the lexer and parser.

Operations

A compiler is likely to perform many or all of the following operations:

Program faults and compiler correctness

Program faults caused by incorrect compiler behavior can be very difficult to track down and work around; therefore, compiler implementors invest significant effort to ensure compiler correctness.

See also

External links