Question: Consider the following program. program main int x , y ; proc A; int z ; proc B; call C ; print x ; x

Consider the following program.
program main
int x,y;
proc A;
int z;
proc B;
call C; print x;x:=x+1; end B
proc C;
int x,z;
; call D; print x; end C
call B; print x; end A
proc D;
int x;
proc E;
int y,z;
proc F;
end F
call F; print x;x:=x+1; end E)
call E; print x; end D
call A; print x; (end main)
(a) List the referencing environment (visible variables) in proc C if static scoping is used.
(b) List the referencing environment (visible variables) in proc D if dynamic scoping is
used.
Note: main calls A calls B calls C calls D calls E calls F.
(c) List the units that can be called by proc E if static scoping is used.
(d) Give the program output if static scoping is used.
(e) Give the program output if dynamic scoping is used.
 Consider the following program. program main int x,y; proc A; int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!