0% found this document useful (0 votes)
42 views

Interpreter: Course Instructor:-Manpreet Kaur

This document provides an introduction to interpreters. It defines an interpreter as a program that translates statements of a program into machine code one statement at a time, as opposed to a compiler which translates the entire program at once. It discusses the differences between pure and impure interpreters, how interpreters work by reading and executing one statement before moving to the next, and how p-code compilers work by compiling programs into an intermediate assembly-like language. The objectives are for students to learn about interpreters and how they differ from compilers.

Uploaded by

Ritesh
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Interpreter: Course Instructor:-Manpreet Kaur

This document provides an introduction to interpreters. It defines an interpreter as a program that translates statements of a program into machine code one statement at a time, as opposed to a compiler which translates the entire program at once. It discusses the differences between pure and impure interpreters, how interpreters work by reading and executing one statement before moving to the next, and how p-code compilers work by compiling programs into an intermediate assembly-like language. The objectives are for students to learn about interpreters and how they differ from compilers.

Uploaded by

Ritesh
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

INTERPRETER

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

 Students will learn about interpreter and compiler.


 They will understand the basic difference in between these two
 Working of p-code compiler is known to them.

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

You might also like