Lexical Analysis
Syntax Analysis
Semantic Analysis
Code Optimisation
OBJECTIVES
- Achieve the required output of the program
- Not delay the compilation process
- Increase speed of the program
- Decrease resources demand
Code Generation
Machine code is generated
Translator
A computer program used to convert a program from one languate to another
Compiler
Takes the source code of the entire program as input to produce a machine code version of the program which can be run through a single executable file
Interperter
Takes a single code instruction as input, translates and executes it
Compiler Advantages
Compilers Disadvantages
Interperators Advantages
Interperator Disadvantages
Assembler
Syntax Error
Occurs when a command does not folow the expected syntac of a language
Linking Error
Calling a standard function where the correct library has not been linked to the program
Semantic Error
Variable declared illegally
Run Time Error
An error that only occurs when a program is running and is difficult to foresee beofree it is compiled and run (program compiles successfully but doesnt perform correctly)
Logical Error
An error that causes a program to output an incorrect answer to what was expected
Rounding/ Truncation Error
Continued use in further calculations causes inaccuracy