16.2 Translation Software Flashcards
1
Q
Stages in the compilation of a program.
A
1) Lexical analysis
2) Syntax analysis
3) Code generation
3) Optimisation
2
Q
How RPN is used by an interpreter to evaluate expressions?
A
- Expressions evaluated left to right
- Each operator uses the previous two values on the stack.
3
Q
How does an interpreter execute a program without producing a complete translated version of it?
A
- Examines source code one statement at a time
- Checks each statement for errors
- If no error found the statement is executed, if error found the interpreter halts.
4
Q
Why is RPN used?
A
- reading from left to right
- no need to use brackets
- no need for rules of precedence