6.3 Types of program translator Flashcards
(6 cards)
What does an assembler do?
Translates assembly language to machine code
Are platform specific
1-to-1 relationship to machine code instruction
Translation is quick
Describe the functionality of compliers
Translates high-level languages to machine code
Are platform specific
Take a high-level program as their source code
Check source code for errors line by line
Translate the entire program at once
If source program contains error it will not be translated
Compiled programs run without any other software present
What does an interpreter do?
Translates high-level languages into machine code
Translate line-by-line
Have procedures to translate each kind of program instruction
Check for errors as they translate
Can partially translate source code containing errors
Both the source code and interpreter must be present
Poor protection of source code
Compare compilers to interpreters?
Compilers check source code for errors line-by-line before translating but in an interpreter translation begins immediately.
Compilers entire source code is translated at once but in an interpreter each line is checked for errors and then translated sequentially.
There is no need for source code or compiler to be present when the translated code is executed for compilers. With interpreters both the source code and the interpreter must be present when the program is executed.
Compilers protect the source code from extraction however interpreters offer little protection of source code.
What are intermediate languages and their process of complier and interpreter translation?
Don’t produce machine code straight away
Translate source code into an intermediate language (byte code)
A virtual machine is used to execute byte code on different processors
Allows for platform independence
What is source code and object code?
source code = input to a translator
Object code = translators output