Compiling a Program

Description

A level Computer Science (Applications Generation) Flashcards on Compiling a Program, created by Malachy Moran-Tun on 05/12/2022.
Malachy Moran-Tun
Flashcards by Malachy Moran-Tun, updated more than 1 year ago More Less
Malachy Moran-Tun
Created by Malachy Moran-Tun over 1 year ago
Malachy Moran-Tun
Copied by Malachy Moran-Tun over 1 year ago
1
0

Resource summary

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
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr