4.6.3 Types of program translator Flashcards

1
Q

Define Translator.

A

A program which converts code from one computer language to another.

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

What is the purpose of a translator?

A

In order for a program to be executed by a computer’s processor, it must be in the form of machine code program.

This means that programs written in assembly language or high-level languages need to be translated into machine code before they can be executed by a computer.

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

What are the 3 types of program translator?

A

Assembler
Compiler
Interpreter

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

Define Assembler.

A

A translator in low level language, which converts assembly language into machine code.

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

What relationship does assembly language have with machine code?

A

It has a 1 to 1 relationship, so that the translation between the two languages is fairly quick and straight forward.

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

What does it mean: Assemblers are platform specific?

A

It means that a different assembler must exist for each different type of processor instruction set.
(Because each type of processor has a different instruction set)

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

Define Compilers.

A

A translator that converts high level language to machine code (all in one go) and produces an executable file.

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

What is the process of the compiler?

A

there are 2 phases:
- analysis phase (1,2,3,4)
- synthesis phase (5,6)

  1. Lexical analysis - removing white space and comments, replacing key words with tokens.
  2. Syntactic analysis - tokens are compared against the rules of the programming language. Errors are flagged as syntax errors.
  3. Semantic analysis - any logic mistakes found in the program are flagged.
  4. Intermediate Code generation -
  5. Code Optimisation -
  6. Code Generation -
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define Interpreter.

A

Translates high level programming language to machine code and executes line by line.

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

Define Source Code.

A

The human-readable code that a programmer writes in a high level programming language.
It is written in a text editor or integrated development environment(IDE) and follows the syntax of a specific programming language.

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

Define Object Code.

A

The machine-readable code that is generated from the source code. It is an intermediate form that results from the compilation of source code but before the final executable.

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

Define Bytecode.

A

A type of intermediate code that is generated when a program written in a certain high-level language is compiled. Unlike object code, bytecode is designed to be executed by a virtual machine rather than directly by the hardware.

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