8. program construction Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an assembler?

A

Converts low level assembly language into machine code.

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

What is an interpreter?

A

Converts high level language one line at a time into machine code and executes it.

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

What is a compiler?

A

Converts high level language all at once into machine code for use at a later time.

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

What are the stages of compilation?

A
  • lexical analysis
  • syntax analysis
  • semantic analysis
  • code generation
  • code optimisation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens during lexical analysis?

A

Spaces and comments are removed from the code. Identifiers, keywords and operators are replaced with tokens (a variable with a name and value). A symbol table is created, which stores the addresses of all variables, subroutines and labels used in the program.

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

What happens during syntax analysis?

A

The tokens will be checked to see if they fit with the language’s syntax. If a syntax error is found, an error message will occur and the compiling will stop.

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

What happens during semantic analysis?

A

Variables are checked to see if they are declared correctly and use a valid data type. Operations are checked to ensure they are correct for the data type used.

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

What happens during code optimisation?

A

the code is optimised to make it faster and more efficient.

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

What happens during code generation?

A

The code in is generated in machine code.

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