12
I have some questions about the process of compiling a code:
- What is the compilation process? How it works?
- What are the steps in the compilation process?
- What is the difference between build x mount (Assembler)
12
I have some questions about the process of compiling a code:
12
Compilation is the act / process of translating a program done in a high-level language into a machine language, so that its instructions are executed by the processor, ie creates the executable of a program written in a high-level language.
## How it works?
A sequence of Analises: Léxica, Sintática e Semântica
on top of the source code in order to identify the respective errors, an intermediate code is generated (if I do not miss the memory of the middleman of the c
is an extension file .o
), an optimization of this code is made and the construction of the same for certain architecture (x86, amd64, Arm, Sparc) at the end of the process has a machine code (in windows for example the .exe
), is made the binding
of methods and libraries (The process follows a sequence pipes e filtros
basically).
Below is an example that demonstrates the sequence flow of the process:
Preprocessing (Join lines that have been separated by exhaust sequences; Removes comments and replaces them with whitespace; Expands macros; Processes pre-processing directives (usually compiler guidelines)).
Lexicographic analysis.
Analise Sintatica.
Analise Semantica.
Generate intermediate code.
Code optimization.
Generates object code for a given architecture (different architectures work completely differently ex: Parc reads strings in the opposite way to x86).
Generates machine code for the given architecture (it is in this phase that is called the linker
(its function is to replace all function calls and variable accesses in object files with the actual address)).
The assembly is performed to translate a program into assembly language (Assembly) for its binary language equivalent through the assembler. has usually the following steps:
Disciplines and Books where these concepts are taught:
Computer Architecture
Logic (is taught about drifting trees (used in the processes of analysis))
Programming Languages (we see at intermediate level everything about the analysis and the whole process itself) - ROBERT W. SEBESTA Programming Languages
Compiler Theory
Browser other questions tagged compilation compilers
You are not signed in. Login or sign up in order to post.