1.2 Translators Flashcards
What are Translators ?
Convert programming languages into
machine code.
What is a Assembler ?
Converts assembly mnemonics to machine code.
(Each chip set has its own assembly code.)
What is a interpreter ?
Converts high level code to machine
code one line at a time.
What are some features of interpreters ?
- Machine independent.
- Work with high level languages.
- Requires the source code.
How do interpreters work ?
Run until they hit an error
Have to be interpreted every time.
Requires the source code.
What are some advantages and disadvantages of interpreters ?
Runs immediately.
Runs until it hits an error.
However…
Some parts of the code may never be run.
How does a Compiler work ?
Reads the whole code, then translates it to machine code.
Creates an executable (.exe)
Code only has to be compiled once.
What are some advantages and disadvantages of a Compiler ?
Translates the entire code.
However…
- Takes time to compile.
- Might not compile at all if there are errors.