stages of cmpilation Flashcards
1
Q
during lexical analysis … (2)
A
- comments and white spaces are removed
- remaining code is turned into a series of tokens
2
Q
during syntax analysis ..(3)
A
- errors are generated (if any tokens break the rules of the program)
- abstract syntax tree is built from tokens produced
- symbol table is created to keep track of variables and subroutines
3
Q
during code generation … (1)
A
- abstract code tree is converted into object code
4
Q
during the optimization stage…(2)
A
- tweaks the code so it will use as little memory as possible
- tweaks the code so it will run as quickly as possible
5
Q
what are the advantages of using high level languages(3)
A
- easier to learn/ understand code
- programs are prone to less errors/bugs
- easier to find programmers who specialise in high level languages
6
Q
what are the advantages of using low level languages(3)
A
- code is optimised to specific architecture (embedded systems)
- code can execute extremely fast
- assembled code occupies less memory in space compared to machine code produced by high level compiler