Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Code generation (compiler)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Related concepts== The fundamental task of taking input in one language and producing output in a non-trivially different language can be understood in terms of the core [[Transformational grammar|transformational]] operations of [[formal language theory]]. Consequently, some techniques that were originally developed for use in compilers have come to be employed in other ways as well. For example, [[YACC]] (Yet Another [[compiler-compiler|Compiler-Compiler]]) takes input in [[Backus–Naur form]] and converts it to a parser in [[C (programming language)|C]]. Though it was originally created for automatic generation of a parser for a compiler, yacc is also often used to automate writing code that needs to be modified each time specifications are changed.<ref>[http://www.artima.com/weblogs/viewpost.jsp?thread=152273 Code Generation: The Real Lesson of Rails]. Artima.com (2006-03-16). Retrieved on 2013-08-10.</ref> Many [[integrated development environment]]s (IDEs) support some form of automatic [[source-code generation]], often using algorithms in common with compiler code generators, although commonly less complicated. (See also: [[Program transformation]], [[Data transformation]].) ===Reflection=== In general, a syntax and semantic analyzer tries to retrieve the structure of the program from the source code, while a code generator uses this structural information (e.g., [[data type]]s) to produce code. In other words, the former ''adds'' information while the latter ''loses'' some of the information. One consequence of this information loss is that [[Reflection (computer science)|reflection]] becomes difficult or even impossible. To counter this problem, code generators often embed syntactic and semantic information in addition to the code necessary for execution.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)