Flashcards
Compiling a Program
Flashcards do conjunto (5)
- 1What are the 4 Stages of Compilation?1. Lexical analysis
2. Syntax analysis
3. Code generation
4. Code optimisation - 2What 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 - 3What 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 - 4What 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 - 5What 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
Informações
- Descrição
- A level Computer Science (Applications Generation) FlashCards sobre Compiling a Program, criado por Malachy Moran-Tun em 05-12-2022.
- Criado por
- Malachy Moran-Tun
- Visualizações
- 5
- Histórico
-
- Criado por Malachy Moran-Tun · 30 nov 2022
- Copiado por Malachy Moran-Tun · 5 dez 2022
- Avaliação