Program Construction Flashcards

1
Q

Does Assembly code work on all computers

A

No

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

Are compilers one-to-many or one-to-one

A

one-to-many

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

What do compilers do

A

they take all high level code and covert it into a single executable file

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

What are the benefits to compilers

A

They can be run faster than assemblers or interpreters after being compiled.
They allow the source code to be hidden

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

Are assemblers one-to-many or one-to-one

A

one-to-one

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

What do assemblers do

A

They convert low level assembly language directly into machine code

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

Are interpreters one-to-many or one-to-one

A

one-to-many

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

What do interpreters do

A

They convert one line of high level code at a time and turn it into machine code which is then run

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

Why compile over interpret

A

Doesn’t risk someone stealing your source code
Takes a long time to compile something, however it will run faster afterwards

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

Name the three stages to the compilation process

A

Lexical analysis
Syntax analysis
Semantic analysis

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

What happens during the Lexical analysis stage of compilation

A

White spaces and comments are removed, each part is allocated a token, categorizing the code

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

What happens during the syntax analysis stage

A

Tasks are identified to see if they match up with the syntax of the programming language, backus-naur form plays a roll in this stage

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

What happens during the semantic analysis stage

A

compiler checks the meaning of the program, completes checks such as scope resolution, checks the variables have been used, checks for infinite loops.

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

What three kinds of errors that can occur during compilation and interpretation

A

Errors that prevent the program from running at all
Errors that occur as the program is actually running
Execution errors

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