Interpreter: Course Instructor:-Manpreet Kaur
Interpreter: Course Instructor:-Manpreet Kaur
Course Instructor:-
Manpreet kaur
2
Introduction to various translators
OBJECTIVES
• Students will learn about interpreter, their uses.
• They come to know how it is differ from compiler and
interpreter.
• They learn about p-code compiler
OUTCOMES
4
DEFINITION
• An interpreter is a program which translates statements of a
program into machine code. It translates only one statement of the
program at a time.
HOW IT WORKS?
• It reads only one statement of program, translates it and executes
it. Then it reads the next statement of the program again translates it
and executes it. In this way it proceeds further till all the statements
are translated and executed.
COMPILER VS INTERPRETOR
[4]
Pure and impure interpreters
• . In a pure interpreter, the source program is retained in the source
form all through its interpretation. This arrangement incurs
substantial analysis overheads while interpreting a statement.
• An impure interpreter performs some preliminary processing of the
source program to reduce the analysis overheads during
interpretation. The preprocessor converts the program to an
intermediate representation (IR), which is used during
interpretation. This speeds up interpretation as the code component
of the IR i.e the IC, can be analyzed more efficiently than the source
form of the program
P-CODE COMPILER
• A p-code(portable code ) is an assembly language for a
hypothetical stack machine.
TRANSLATION AND EXECUTION
[5]
FAQ
Define compiler.
Compiler is better in which reference?
Differentiate between the terms compiler and interpreter
REFERENCES
1. Systems programming: john j. donovan,TMH.
2. System Software An introduction to systems
programming Leland L. Beck
3. http://vijaybhargav05bop.blogspot.in/2013/03/assem
bler-compiler-interpreter-linker.html
4. https://www.programiz.com/article/difference-compile
r-interpreter
5. https://www.slideshare.net/Sandeep_Rv/p-code