CS - Comp Systems - Translators Flashcards
1
Q
Describe the role of a Translator
A
Ensures code is executable (in binary form for processor to handle) because processors can’t understand the English-like instructions used by programmers when coding in high level languages.
2
Q
State the two types of translator
A
Compiler and Interpreter
3
Q
Describe the role of a Compiler
A
Translates source code into object code. Object code is held in a new file and does not need translator software to run.
4
Q
List 4 features of a compiler
A
- translates lines one after another but does not execute immediately after translation.
- once created, object code can run independently of development environment and translator software
- if the object code file contains errors, the program will crash or cause unexpected output.
- compiler is only held in RAM for the time that it takes to translate source code into object code
5
Q
Describe the role of an Interpreter
A
Translates source code directly into machine code. The translator runs throughout this translation and execution process.
6
Q
List 4 features of an Interpreter
A
- source code is translated to machine code one at a time
- software is present in main memory during each execution of program and execution of every line
- execution will stop immediately if the interpreter translates a line of source code that results in an error
- cannot determine the actual error but can indicate the line that was not translated into executable machine code