Compilers And Interpreters Flashcards
What are the stages of compilation
lexical analysis
Comments and unneeded spaces are removed
Keywords, constants and identifiers are replace by tokens
A symbol table is created which holds the addresses of variabls, labels and subroutines
What are the stages of compilation
syntax analysis
Tokens are checked to see if they match the spelling and grammar expected, using standard language definitions.
If syntax errors are found error messages are produced
What are the stages of compilation
code generation
Machiene code is genertaed
Code optimimisation may be employed to make it more efficient/ faster/ less resources intense
All stages of compilation process
Lexical anaylisis Symbol table construction Syntax error Semantic analysis Code generation Optimisation
What are the stages of compilation
semantic analysis
Variabls are checked to ensure that they have been properly declared and used and are the right data type
Operations are checked to ensure that they are legal for the type of variable
Compilers
Converts high level code into low level code, in whole blocks of code at a time