C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
Bartleby Related Questions Icon

Related questions

Question
[画像:3. | The following program undergoes scope checking using a stack of symbol tables: 1. void main() { 2. 5. 6. 7. 8. int a; int b%3B int c%;B if (a == b) { float c%;B for (int c = 1; c <10%;B c++ ) { cout << a; 9. } 10. } 11. 12. 13. int a; else { } /* else */ } /* main */ (a) [10] Draw the symbol tables created for this program as follows: List in each sym- bol 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. (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. Explain then how are the symbol tables inspected to obtain the type of variable a.]
expand button
Transcribed Image Text:3. | The following program undergoes scope checking using a stack of symbol tables: 1. void main() { 2. 5. 6. 7. 8. int a; int b%3B int c%;B if (a == b) { float c%;B for (int c = 1; c <10%;B c++ ) { cout << a; 9. } 10. } 11. 12. 13. int a; else { } /* else */ } /* main */ (a) [10] Draw the symbol tables created for this program as follows: List in each sym- bol 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. (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. Explain then how are the symbol tables inspected to obtain the type of variable a.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning