Difference between revisions of "Compiler"

From Conservapedia
Jump to: navigation, search
(Redirecting to Compilation)
 
(transfer text from compilation, with a view to subsequent expansion.)
Line 1: Line 1:
#REDIRECT [[Compilation]]
+
A '''compiler''' is a computer program which translates source code written in a high-level [[programming language]] into executable machine code.
 +
 
 +
Most compilers perform the following actions, sometimes in a single pass over the source code, and sometimes in several passes.  Program optimisation may take place before and during the 'code generation' stage.
 +
 
 +
:'''Lexical analysis''': convert source code into sequence of tokens.
 +
 
 +
:'''Syntactic analysis''': structure tokens into parse tree.
 +
 
 +
:'''Semantic analysis''': annotate parse tree with semantic actions.
 +
 
 +
:'''Code generation''': produce the final machine code.

Revision as of 19:44, March 18, 2012

A compiler is a computer program which translates source code written in a high-level programming language into executable machine code.

Most compilers perform the following actions, sometimes in a single pass over the source code, and sometimes in several passes. Program optimisation may take place before and during the 'code generation' stage.

Lexical analysis: convert source code into sequence of tokens.
Syntactic analysis: structure tokens into parse tree.
Semantic analysis: annotate parse tree with semantic actions.
Code generation: produce the final machine code.