Mapa mental
1.8

Contenido del mapa
1.8
Translation of code
- A translator converts the source code/high level code into a low level code ready for execution
- Assembler
- A assembler program converts a program written in assembly language into machine code
- Compiler
- A compiler translates the entire high level programming language into machine code prior to execution
- High level lines of code can translate to many different machine code commands, whereas one assembly line of code translates to one command in machine code.
- Adv: Executable code executes faster
- Compiled program can be re-run without further translation.
- Interpreter
- An interpreter converts high level language code one line at a time, into machine code.
- Adv: Useful for debugging
- Interpretation has to be repeated each time the program is run
Compilation process
- Lexical Analysis
- Comments/spaces are removed
- Keywords, constants and identifiers replaced by tokens
- Symbol table is created holding the address of variables
- Identifier and reserved word table produced
- Syntax Analysis
- Tokens checked to see if they match the spelling/grammar expected using standard language definitions
- If syntax errors are found, error messages are produced
- Uses BNF rules/ syntax diagrams
- Semantic analysis
- Variables are checked to ensure that they have been properly declared and used
- Variables are checked to ensure they are of the correct data type
- Operations checked to ensure they are legal for the type of variable being used (e.g. the result of an integer division is stored as an integer)
- Code generation
- Machine code is generated
- A linker editor makes sure previously compiled libraries are loaded into the program at compilation
- Code Optimisation
- The code is improved if necessary to make it more efficient
- Errors
- Translation errors occur when source code is being compiled
- Examples: Syntax errors, semantic errors
- Execution errors occur when the program is running
- Examples: Truncation error, logical error (negative number for age), rounding error
- Translation errors occur when source code is being compiled
- Lexical Analysis
Imágenes y archivos del mapa
Información
- Descripción
- Mapa Mental sobre 1.8, creado por Cj L el 27/04/2019.
- Creado por
- Cj L
- Visitas
- 0
- Valoración
