ConpSci - Program Construction Flashcards

(6 cards)

1
Q

Compilation Process - Lexical Analysis

A

Comments and whitespace are removed
Keywords, variables and constants are replaced by tokens
A symbol table containing the addresses of variables, labels and subroutines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Compilation Process - Syntax Analysis

A

Tokens are checked against syntax rules of the language, if syntax errors are found, error messages are produced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Compilation Process - Semantic Analysis

A

Variables are checked to ensure they are correctly declared, used and data type
Operations are checked to ensure they are valid (quotient not stored as integer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Compilation

A

Compilation only needs to occur once
Can be used by any device without any extra software
Hardware dependent
Faster
Intellectual property protected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Interpretation

A

Debugging is easier
Must be interpreted on every execution
Not hardware dependent
An interpreter is needed to run
Slower

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Assembly

A

One-to-one translation from assembly (low level code) to machine code.

Using assembly provides more control over memory and storage
Less processing required to run
Difficult to learn and complex programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly