Question: Repeat the previous exercise for a central reference table. Data From Previous Exercises: Show a trace of the contents of the referencing environment A-list during

Repeat the previous exercise for a central reference table.

Data From Previous Exercises:

Show a trace of the contents of the referencing environment A-list during execution of the program in

(a) Figure 3.9. Assume that a positive value is read at line 8.

Figure 3.9:

1. n: integer -- global declaration 2. procedure first() 3. n:= 1 4. procedure second() n: integer 5. -- local declaration 6. first() 7. n:= 2 8. if read.integer() > 0 9. second() 10. else 11. first() 12. write.integer(n)

(b) Exercise 3.14.

Data From Exercise 3.14:

Consider the following pseudocode:
1. n: integer -- global declaration 2. procedure first() 3. n:= 1What does this programprint if the language uses static scoping? What does it print with dynamic scoping? Why?

1. n: integer -- global declaration 2. procedure first() 3. n:= 1 4. procedure second() n: integer 5. -- local declaration 6. first() 7. n:= 2 8. if read.integer() > 0 9. second() 10. else 11. first() 12. write.integer(n)

Step by Step Solution

3.46 Rating (172 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a b Table is shown only at points where it changes call setx0 return from setx ca... View full answer

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 Programming Language Pragmatics Questions!