Lecture 1 Flashcards

1
Q

Components of language translator

A

Source program
Pre processor
Modified source program
Compiler
Target assembly code
Assembler
Relocatable machine code
Linker loader
Target machine code

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

Job of a preprocessor

A

Collects source program which may be divided into different modules. The modified source program is then fed to a compiler.

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

Job of a compiler

A

Reads a program in one language–source program– and translate into an equivalent program in another language–target language

A role of the compiler is to report any errors in the source program that it detects during the translation process.

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

What is an interpreter?

A

An interpreter is another component of a language translator.

It does not produce a target program as a translation; instead, it directly executes the operations specified in the source program on inputs supplied by the user.

source program–>
Interpreter –> output
input –>

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

Compiler vs Interpreter

A

The target program produced by a compiler is much faster than that of an interpreter at mapping inputs to outputs.

An interpreter can give better error diagnostics than a compiler.

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

Examples of compilers and interpreters

A

Compilers: Rust, C, C++, COBOL

Interpreters: PERL, Python, Ruby, awk, sed, shells, Scheme/Lisp/ML, postscript/pdf, Java VM

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

What is a hybrid compiler

A

A hybrid compiler combine both compilation and interpretation process in translating a source language. E.g Java language translator

THERS AN IMAGE HERE

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

Job of an assembler

A

The compiler may produce an assembly-language program as its output, because assembly language is easier to produce as output and is easier to debug.

The assembly language is then processed by a program called an assembler that produces relocatable machine code as its output.

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

What is the job of the loader/linker?

A

The linker resolves external memory addresses, where the code in one file may refer to a location in another file.

The loader then puts together all of the executable object files into memory for execution.

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