(a) [5] Draw the symbol tables created for this program as follows: List in each symbol table all the identifiers in that scope as pairs (identifier,type). Then draw the links (pointers) between the symbol tables that establish the stack structure. duplicate (6) 19 Idely between the op larify your choice rated above and and (b) [5] Let the scope checking algorithm process line 8 of the program. Identify in your answer to the previous question the symbol table corresponding to the current scope as well as the symbol tables corresponding to all the open scopes. 5] Explain then how are the symbol tables inspected to obtain the type of the variable gv and argc on line 8. 2. [15] The following program undergoes scope checking using a stack of symbol tables: 1. void main (int argc, char** argv, char** env) { 2. فی خانه نه 5. 6. int a, float b; if (argc >= 10) { int b; for (int argc = 1; argc < 10; argc++ ) { cout << argv [argc]; 7. 8. 9. } 10. } 11. else { 12. 3. } 4. } char* argv;
(a) [5] Draw the symbol tables created for this program as follows: List in each symbol table all the identifiers in that scope as pairs (identifier,type). Then draw the links (pointers) between the symbol tables that establish the stack structure. duplicate (6) 19 Idely between the op larify your choice rated above and and (b) [5] Let the scope checking algorithm process line 8 of the program. Identify in your answer to the previous question the symbol table corresponding to the current scope as well as the symbol tables corresponding to all the open scopes. 5] Explain then how are the symbol tables inspected to obtain the type of the variable gv and argc on line 8. 2. [15] The following program undergoes scope checking using a stack of symbol tables: 1. void main (int argc, char** argv, char** env) { 2. فی خانه نه 5. 6. int a, float b; if (argc >= 10) { int b; for (int argc = 1; argc < 10; argc++ ) { cout << argv [argc]; 7. 8. 9. } 10. } 11. else { 12. 3. } 4. } char* argv;
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 12PE
Related questions
Question
![(a) [5] Draw the symbol tables created for this program as follows: List in each symbol table
all the identifiers in that scope as pairs (identifier,type). Then draw the links (pointers)
between the symbol tables that establish the stack structure.
duplicate
(6) 19 Idely between the op
larify your choice
rated above and
and
(b) [5] Let the scope checking algorithm process line 8 of the program. Identify in your
answer to the previous question the symbol table corresponding to the current scope as
well as the symbol tables corresponding to all the open scopes.
5] Explain then how are the symbol tables inspected to obtain the type of the variable
gv and argc on line 8.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4fdf3cae-9238-4496-a0e6-492129671272%2Ffee57b99-5092-44f6-8bff-7e134f5ed202%2Fsnbd377_processed.png&w=3840&q=75)
Transcribed Image Text:(a) [5] Draw the symbol tables created for this program as follows: List in each symbol table
all the identifiers in that scope as pairs (identifier,type). Then draw the links (pointers)
between the symbol tables that establish the stack structure.
duplicate
(6) 19 Idely between the op
larify your choice
rated above and
and
(b) [5] Let the scope checking algorithm process line 8 of the program. Identify in your
answer to the previous question the symbol table corresponding to the current scope as
well as the symbol tables corresponding to all the open scopes.
5] Explain then how are the symbol tables inspected to obtain the type of the variable
gv and argc on line 8.
![2. [15] The following program undergoes scope checking using a stack of symbol tables:
1. void main (int argc, char** argv, char** env) {
2.
فی خانه نه
5.
6.
int a, float b;
if (argc >= 10) {
int b;
for (int argc = 1; argc < 10; argc++ ) {
cout << argv [argc];
7.
8.
9.
}
10.
}
11.
else {
12.
3.
}
4.
}
char* argv;](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4fdf3cae-9238-4496-a0e6-492129671272%2Ffee57b99-5092-44f6-8bff-7e134f5ed202%2Fwlnwt9_processed.png&w=3840&q=75)
Transcribed Image Text:2. [15] The following program undergoes scope checking using a stack of symbol tables:
1. void main (int argc, char** argv, char** env) {
2.
فی خانه نه
5.
6.
int a, float b;
if (argc >= 10) {
int b;
for (int argc = 1; argc < 10; argc++ ) {
cout << argv [argc];
7.
8.
9.
}
10.
}
11.
else {
12.
3.
}
4.
}
char* argv;
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning

New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning

Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,