Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Scopes and Symbol Tables Consider the following code: 1 int a = 0 ; 2 int b = 0 ; 3 void print ( )
Scopes and Symbol Tables
Consider the following code:
int a ;
int b ;
void print
printf d d a b ;
int fun
int a c ;
a ; b ; c ;
print
return c ;
void fun int c
int a ;
a ; b c ;
print ;
int main
a fun;
fun;
print ;
return ;
Draw the symbol tables in separation for all scopes in this program. Assume each
table contains two columns: name and type.
What is the output of the above code with static scoping? Justify your answer by
showing the tree of the symbol tables.
What is the output of the above code with dynamic scoping? Justify your answer by
showing the tree of the symbol tables
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started