Question: Problem 3 [6pt] Consider the following pseudo-code with higher-order function support. Assume that the language has one scope for each function, and it allows nested
![Problem 3 [6pt] Consider the following pseudo-code with higher-order function support.](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66fa5111d3f86_78566fa51115922f.jpg)
Problem 3 [6pt] Consider the following pseudo-code with higher-order function support. Assume that the language has one scope for each function, and it allows nested functions (hence, nested scopes). In the pseudo code, declarations with type "int are local declarations; otherwise the variables not declared locally are referring to the outer level of function. function A() { int x = 5; function C(P) { int x = 3; P(); } function D() { print x; } function B() { int x = 4; C(D); } B(); } A() a) (1pt) What would the program print if this language uses dynamic scoping and shallow binding (binding happens when the function is called)? b) (4pt) Justify your answer by showing the tree of symbol tables when execution reaches the display expression. c) (1pt) What would the program print if this language uses static/lexical scoping
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
