U8 - COMPILATION Flashcards

1
Q

NAME THE SIX STEPS OF THE COMPILATION PROCESS

A

LEXICAL ANALYSIS
SYMBOL TABLE
SYNTAX ANALYSIS
SEMANTIC ANALYSIS
CODER GENERATION
OPTIMISATION

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

LEXICAL ANALYSIS

A

Commments and unneeded spaces are removed
Keywords, constants and indentifiers are replaced with tokens

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

SYMBOL TABLE

A

A table is created to hold the addresses of variables, labels and subroutines

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

SYNTAX ANALYSIS

A

Tokens are checked to see if they match the expected spelling and grammar.
A message appears if an error is found.

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

SEMANTIC ANALYSIS

A

Variables are checked to make sure they are the right data type and have properly declared.
Operations are checked to make sure they are legal for the type of variable being used.

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

CODE GENERATION

A

Machine code is generated for the computer to run

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

OPTIMISATION

A

Optimised code removes unneccessary parts
Making it more efficient, quicker to run and less resource intense.

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

NAME THE SIX ERROR TYPES

A

LINKING ERROR
EXECUTION ERROR
LOGICAL ERROR
SYNTAX ERROR
TRUNCATION ERROR
ROUNDING ERROR

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

SYNTAX ERROR

A

When a program does not follow the expected syntax rules of the language, i.e. missing brackets

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

RUNTIME / EXECUTION ERROR

A

When a program unexpectedly stops due to an invalid operation, i.e. trying to divide by 0

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

LOGICAL ERROR

A

Does not stop the code but produces an unexpected output
The result of inputting an incorrect operation, i.e. Using + instead of -

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

LINKING ERRORS

A

Occurs when compiler is unable to find a subroutine called.
i.e. A module is referenced but not imported

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

TRUNCATION ERROR

A

Numbers are not accurate, program truncates a real number to a set number of d.p.
i.e. 1.6 = 1

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

ROUNDING ERROR

A

Occurs when a program rounds a real number to the nearest whole.
i.e. 1.6 = 2

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