U8 - COMPILATION Flashcards
NAME THE SIX STEPS OF THE COMPILATION PROCESS
LEXICAL ANALYSIS
SYMBOL TABLE
SYNTAX ANALYSIS
SEMANTIC ANALYSIS
CODER GENERATION
OPTIMISATION
LEXICAL ANALYSIS
Commments and unneeded spaces are removed
Keywords, constants and indentifiers are replaced with tokens
SYMBOL TABLE
A table is created to hold the addresses of variables, labels and subroutines
SYNTAX ANALYSIS
Tokens are checked to see if they match the expected spelling and grammar.
A message appears if an error is found.
SEMANTIC ANALYSIS
Variables are checked to make sure they are the right data type and have properly declared.
Operations are checked to make sure they are legal for the type of variable being used.
CODE GENERATION
Machine code is generated for the computer to run
OPTIMISATION
Optimised code removes unneccessary parts
Making it more efficient, quicker to run and less resource intense.
NAME THE SIX ERROR TYPES
LINKING ERROR
EXECUTION ERROR
LOGICAL ERROR
SYNTAX ERROR
TRUNCATION ERROR
ROUNDING ERROR
SYNTAX ERROR
When a program does not follow the expected syntax rules of the language, i.e. missing brackets
RUNTIME / EXECUTION ERROR
When a program unexpectedly stops due to an invalid operation, i.e. trying to divide by 0
LOGICAL ERROR
Does not stop the code but produces an unexpected output
The result of inputting an incorrect operation, i.e. Using + instead of -
LINKING ERRORS
Occurs when compiler is unable to find a subroutine called.
i.e. A module is referenced but not imported
TRUNCATION ERROR
Numbers are not accurate, program truncates a real number to a set number of d.p.
i.e. 1.6 = 1
ROUNDING ERROR
Occurs when a program rounds a real number to the nearest whole.
i.e. 1.6 = 2