Professional Documents
Culture Documents
1.2language Processing Activities
1.2language Processing Activities
1.2language Processing Activities
1
Language Processing Activities
• A program generation activity aims to generation of a
program. Source is the application domain and target is
the PL domain. It bridges specification gap.
• A program execution activity aims to execute a program
written in PL. source is PL domain and target is
execution domain. It bridges execution gap.
2
1. Program Generation
Errors
4
2. Program Execution
• Two popular models for program execution are:
1. Program Translation
2. Program Interpretation
5
2.1 Program Translation
Errors
6
2.1 Program Translation
• Characteristics of the program translation model are:
A program must be translated before it can be executed.
The translated program may be saved in file. The saved
program may be executed repeatedly.
A program must be retranslated following modifications.
7
2.2 Program Interpretation
• It reads the source program and stores it in its memory.
8
2.2 Program Interpretation
• In the program interpretation, the CPU use a program
counter(PC) to note the address of the next instruction to
be executed. This instruction is subjected to the
instruction execution cycle consisting following step:
1. Fetch the instruction
2. Decode the instruction to determine the operation to be
performed.
3. Execute the instruction.
9
2.2 Program Interpretation
• At the end of the cycle. The PC is updated and the cycle
is repeated for the next instruction.
• Thus, the PC can indicate which statement of the source
program is to be interpreted next.
Interpreter Memory CPU Memory
PC Source PC M.L.
Program Program
Errors + +
Data Data
10
MCQ
• The _________ is a software system which generates a
program in the target PL.
A. Program Generator
B. Program Specification
C. Program Execution
D. program Interpretation
MCQ
• The _________ is a software system which generates a
program in the target PL.
A. Program Generator
B. Program Specification
C. Program Execution
D. program Interpretation
MCQ
• the CPU use ___________ to note the address of the
next instruction to be executed.
A. program counter(PC)
B. Pretty printer
C. static checker
D. None
MCQ
• the CPU use ___________ to note the address of the
next instruction to be executed.
A. program counter(PC)
B. Pretty printer
C. static checker
D. None
MCQ
• The Program generator _______ to convert _________
• The _________ fetch, decode and execute instruction