An interpreter is a type of translator.
Define the term interpreter.
Mark scheme
Award one mark for any of the following up to a maximum of two marks:
- Translates/converts (high-level/source) code one line/statement at a time (1)
- Translates/converts the code and executes/runs each line as it goes (1)
- Executes/runs each line/statement immediately after it is translated (1)
- Reports/stops with an error message as soon as a syntax error is found (1)
Allow 'runs' for executes, 'converts' for translates and 'instruction' for line/statement
Do not accept translates the whole program before it is run
Do not accept produces/creates object code, an executable file or machine code that is saved
Example answers and how they were marked
An interpreter is a program that translates high-level code line by line. Each line is run as soon as it has been translated, so any errors are shown straight away.
Why: Line-by-line translation (1) and each line executed immediately (1); the point about errors would be a third creditworthy point but the maximum is two.
An interpreter translates code one line at a time.
Why: Line-by-line translation (1); no point for immediate execution.
An interpreter translates the whole program before it is run.
Why: Near-miss describing a compiler; the scheme's 'Do not accept' line rules out whole-program translation.