Editing Code Generation

Jump to: navigation, search

Please note that you are now editing the latest revision of this page, which is not the approved one shown by default.

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
Right on!There is no excuse wehtsoaver for not commenting code, it is just pure laziness and/or sloppiness.Some people have told me it takes too much time - this is also pure nonsense.I can, however, understand people if they don't care about the code they write and admit it.
+
Code generation is the compiler's phase in which the meaning of the source text (the compiler's input) is unparsed and output in the [http://eplmediawiki.di.uminho.pt/index.php/Target_Language target language].
 +
<br><br>
 +
 
 +
Sophisticated compilers may use several cascaded code generation stages to fully compile code; this is due to the fact that algorithms for code optimization are more readily applicable in an intermediate code form, and also facilitates a single compiler that can target multiple architectures as only the final code generation stage (the ''backend'') would need to change from target to target.
 +
<br><br>
 +
 
 +
The input to the code generator stage typically consists of a parse tree, abstract syntax tree, or intermediate language code. Since the target machine may be a physical machine such as a microprocessor, or an abstract machine such as a virtual machine or an intermediate language (human-readable code), the output of code generator could be machine code, assembly code, code for an abstract machine (like JVM), or anything between.
 +
<br><br>
 +
 
 +
In a more general sense, code generation is used to produce programs in some automatic manner, reducing the need for human programmers to write code manually. Code generations can be done either at runtime, including load time, or compiler time. Just-in-time compilers are an example of a code generator that produce native or nearly native code from byte-code or the like when programs are loaded onto the compilers. On the other hand, a compiler-compiler, (yacc, for example) almost always generates code at compiler time. A preprocessor is an example of the simplest code generator, which produces target code from the source code by replacing predefined keywords.  
 +
 
 +
[[Category:Basic Concepts]]

Please note that all contributions to eplmediawiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Eplmediawiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools
Namespaces

Variants
Actions
Navigation
extras
Toolbox