Stages of compilation Flashcards

1
Q

What are the 4 stages of compilation?

A

Lexical analysis, Syntax analysis, Code generation, Code optimisation.

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

What is Lexical analysis?

A

1) All white space and comments removed
2) Remaining code is turned into tokens
3) Symbol table is created

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

What is Syntax analysis?

A

Syntax of program is checked against the rules.

Abstract syntax tree created.

If any code breaks the syntax rules errors are generated.

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

What is Code generation?

A

Syntax tree converted into object code.

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

What is Code optimisation?

A

Code is optimised to run as fast as possible.

Involves removing redundant code.

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