3.6.3.1 Types of Program Translator. Flashcards
Define what is meant by a translator.
Translates programs written in high-level languages or assembly code into machine code for execution.
Outline the types of program translators.
Assemblers.
Compilers.
Interpreters.
Define an assembler.
Translates an assembly language into machine code.
Why are assemblers quick and straight forward?
Because each assembly
language instruction has a 1-to-1 relationship to a machine code instruction.
What is meant by platform specific assemblers?
A different assembler must exist for each
different type of processor instruction set.
Define a compiler.
Translates high-level languages into machine code, all at once.
Outline the process of a compiler.
Compilers take a high-level program as their source code,
check it for any errors and then translate the entire program at once.
What happens to the compiler if there is an error in the code?
It will not translate (compile).
Outline what happens once code has been translated (compiler).
Once translated, a compiled program can be run without the requirement for any other software to be present
Why are compilers platform specific?
Because they produce machine code.
Define an interpreter.
Translates high-level languages into machine code, line-by-line.
What allows an interpreter to translate each kind of program instruction?
Interpreters have procedures that can be used to translate each kind of program instruction.
How do interpreters check for errors?
As they go, meaning that a program can be partially translated by an interpreter until the error is reached.
Why is code translated by an interpreter said to be poorly protected?
As when a program is translated, both the program source code and the interpreter must be present. This results in poor protection of the source code
compared to compilers which make the original code difficult to extract.
Compare the error checking of compilers and interpreters.
Compilers check source code errors line-by-line before translating whereas interpreters begin translation immediately.