Wednesday, March 10, 2010

Code Generation

This is the programming part.  Source codes are generated by the programmer under the guidance of an experienced systems analyst.  The system specifications provided in the System Design are carried out and translated into codes, in a programming language understood by everybody in the project team.

In computer science, code generation is the process by which a compiler's code generator converts some internal representation of source code into a form (e.g., machine code) that can be readily executed by a machine (often a computer).

Sophisticated compilers typically perform multiple passes over various intermediate forms. This multi-stage process is used because many algorithms for code optimization are easier to apply one at a time, or because the input to one optimization relies on the processing performed by another optimization. This organization also facilitates the creation of a single compiler that can target multiple architectures, as only the last of the code generation stages (the backend) needs to change from target to target.

The input to the code generator typically consists of a parse tree or an abstract syntax tree. The tree is converted into a linear sequence of instructions, usually in an intermediate language such as three address code. Further stages of compilation may or may not be referred to as "code generation", depending on whether they involve a significant change in the representation of the program.

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails