Programming-General: What are the 5 stages in which a source code is transformed to a executable file?
I receive this question in a test:
What 开发者_StackOverflow社区are the 5 stages in which a source code is transformed to a executable file?
The five stages are bogus. Standard ML of New Jersey, for example, was at one point a 33-pass compiler, going from source code to machine code (no textual assembly; it blasts machine code right into memory). I doubt there are exactly five representations that the code goes through. In the lcc C compiler there are these representations:
- Unpreprocessed source
- Preprocessed source
- IR Dags
- Textual assembly
- Relocatable object code
- Executable binary
These days most other compilers translate source into abstract syntax, and in fact the designers of lcc said in retrospect that they wish they had used abstract-syntax trees.
This seems like one of those sad situations where you need to find out what your instructor wants to hear and regurgitate it back. And don't take it too seriously.
There can not be fixed 5 steps. Depends on what language is the source code in and what compiler is used.
One minute on google would have resolved your question
Compiler is the magic word
If your eyes can't find the right line :)
Compilation in general is split into roughly 5 stages:
Preprocessing, Parsing, Translation, Assembling, and Linking.
精彩评论