Code Generation (compiler)
In computer science, code generation is the process by which a compiler's code generator converts some intermediate representation of source code into a form (e.g., machine code) that can be readily executed by a machine.
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. (For more information on compiler design, see Compiler.)
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. (For example, a peephole optimization pass would not likely be called "code generation", although a code generator might incorporate a peephole optimization pass.)
Read more about Code Generation (compiler): Major Tasks in Code Generation, Runtime Code Generation, Related Concepts
Famous quotes containing the words code and/or generation:
“Many people will say to working mothers, in effect, I dont think you can have it all. The phrase for have it all is code for have your cake and eat it too. What these people really mean is that achievement in the workplace has always come at a priceusually a significant personal price; conversely, women who stayed home with their children were seen as having sacrificed a great deal of their own ambition for their families.”
—Anne C. Weisberg (20th century)
“We may consider each generation as a distinct nation, with a right, by the will of its majority, to bind themselves, but none to bind the succeeding generation, more than the inhabitants of another country.”
—Thomas Jefferson (17431826)