![]() |
Created by Malachy Moran-Tun
over 2 years ago
|
|
![]() |
Copied by Malachy Moran-Tun
over 2 years ago
|
|
Question | Answer |
What are the 4 Stages of Compilation? | 1. Lexical analysis 2. Syntax analysis 3. Code generation 4. Code optimisation |
What happens during Lexical Analysis? | > White space is removed from the code, since it it not necessary for a compiler > Illegal identifiers / values are flagged as errors > Tokens, i.e., strings that are recognised by the computer, are created for the keywords and operators (lexemes) in the code - comments are ignored > Tokens are assembled into a symbol table ready for the next step |
What happens during Syntax Analysis? | > Tokenised code is compared to the rules of the programming language > If a section is found not to fit these rules, an error is generated > This process continues until all the code is checked > A full error report is sent to the programmer at the end of compilation |
What happens during Code Generation? | > Stage where machine code is generated > This code may initially be inefficient due to contain unnecessary instructions, or groups of instructions that can be replaced by simpler ones |
What happens during Code Optimisation? | > The machine code is made to have the smallest binary footprint as possible > This is done by removing procedures, variables etc. that aren't used > Unnecessary instructions are removed, or groups are instructions are replaced by simpler ones |
There are no comments, be the first and leave one below:
Want to create your own Flashcards for free with GoConqr? Learn more.