Difference between revisions of "Code Generation"

From eplmediawiki
Jump to: navigation, search
(gyQAJAQh)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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].
+
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.
<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]]
+

Latest revision as of 18:51, 21 July 2015

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.

Personal tools
Namespaces

Variants
Actions
Navigation
extras
Toolbox