(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
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++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning