Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following piece of code written in a pseudo - language using static scope and call by reference ( see Sect. 7 . 1

Consider the following piece of code written in a pseudo-language using static
scope and call by reference (see Sect. 7.1.2):
{int x=0;
int A(reference int y{
int x=2;
y=y+1;
return B(y)+x;
}
int B(reference int y
int C(reference int y){
int x=3;
return A(y)+x+y;
}
if (y==1) return C(x)+y;
else return x+y;
}
write (A(x));
}
Assume that static scope is implemented using a display. Draw a diagram show-
ing the state of the display and the activation-record stack when control enters
the function A for the second time. For every activation record, just give value
for the field that saves the previous value of the display.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt or other AI 9 5 5 .

Answered: 1 week ago

Question

10-7 How will MIS help my career?

Answered: 1 week ago

Question

2. How will the team select a leader?

Answered: 1 week ago