1.2.2 Applications Generation Flashcards
1
Q
Lexical Analysis
A
- Comments and white space removed
- Remaining code turned into a series of tokens
- Symbol table is created to keep track of variables and subroutines
2
Q
What does a translator do?
A
Converts source code into machine code
3
Q
What is a Assembler?
A
A translator that converts assembly code into machine code
4
Q
What is a Interpreter?
A
A translator that converts high level source code into machine code line by line
-Good during coding and debugging
5
Q
What is a Complier?
A
- A translator that converts high level source code into machine code all in one go
- Can take a long time
- The final file can be run without source code or a translator
6
Q
Syntax analysis
A
- Will produce an abstract syntax tree that will represent the program
- Check that the code that has been written uses a valid syntax
7
Q
Code Generation and Optimisation
A
1.Code generation is when the compiler converts the output of syntax analysis into object code
- Compilers can be tweaked to optimise either speed or memory
- As it is often difficult to optimise both at the same time