Diseño De Compiladores
This article will take 2 minutes to read.
Class taken in my 8th semester of university
Table of Contents
- Table of Contents
- Topic 1. Basic Concepts of the Compilation Process
- Topic 2. The Analysis Phase
- Topic 3. The Translation Process directed by Syntax
- Topic 4. Generation of Intermediate Code
- Topic 5. Execution and Design Environments for Virtual Machines
- Topic 6. Advanced Topics (Translators for other programming paradigms)
Topic 1. Basic Concepts of the Compilation Process
Class 1
What is a programming language?
Special, defined notation to describe computer processes, in a manner understandable to both humans and computers.
Classifications of Programming Languages
- By Abstraction level:
-
Low level
Direct memory access
- Medium Level
-
High Level
Memory Access through operators
-
Very High Level
No memory access?
- By historic evolution
- Machine language
- Associative language
- Procedural language
- Application language
- Inference language
- Neural Networks
-
- By expression of Solution
Imperative/Procedural
- Declarative
- By Paradigm
- Imperative
- OOP
- Functional
- Logical
Day 2 - Translation Process
Term | Definition |
---|---|
Translation | The process of exchanging equivalents. |
Translation takes an input in language A, and either produces an equivalent in language B, or an error.
- Features of a Compiler
- Translates from source code to object code
- Can throw errors
Steps of Compilations
- Lexical Analysis
- Determine if elements (tokens) exist in source language
- Clean source code
- remove whitespace
- remove comments
- (normalize capitalization)
- Syntactic Analysis
- Determine if sequence of elements conforms to correct structure
- Structure is given by the language’s grammar
- Semantic Analysis
- Determine the congruence of the elements according to meaning established as valid by the language.
- Basically it’s the type-checking system
- Intermediate Code Generation (Optional)
- Code optimization (Optional)
- Step that minimizes time or space requirements of the code.
- Object code generation