What Is A Compiler
What Is A Compiler
Definition Purpose
Software that translates high-level code to low-level code. Enables execution of programs on computers.
High-Level Languages Low-Level Languages Assembly Language
A programming language close to A language close to machine code, A low-level language using mnemonics
human language, easy to read and harder for humans to understand, but (short codes) to represent machine
write. directly interacts with hardware. instructions.
2 Syntax Analysis
Checks grammar, builds parse tree.
Semantic Analysis 3
Ensures meaningfulness, type checking.
Code Optimization 5
Improves performance, efficiency.
6 Code Generation
Produces machine code or target language.
Code Linking 7
Combines code with libraries for execution.
Types of Compilers
Self Compiler Cross Compiler Source-to-Source Compiler
Runs and produces code for the Runs on one machine, produces Translates code from one language
same machine. code for another. to another.
Compiler Types: Continued
Single Pass Compiler Two Pass Compiler
All phases in one module. Two passes for translation.
Multi-Pass Compiler
Multiple passes for complex processing.
Just-in-Time (JIT) Compilers
1 Dynamic Compilation2 Performance
Optimization
Compiles code during
execution. Improves performance over
time.
3 Optimized Performance
Improved runtime performance.
Incremental Compilers
1 Compile Only 2 Faster Compilation
Changes
Reduces compilation time
Recompiles only modified during development.
code.