C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Data structure for symbol table
The scope of a name and symbol table is arranged in the hierarchy structure as shown below: int value=10; void sum_num() { int num_1; int num_2; { int num_3; int num_4; } int num_5; { int_num 6; int_num 7; } } Void sum_id { int id_1; int id_2; { int id_3; int id_4; } int num_5; } The above grammar can be represented in a hierarchical data structure of symbol tables: The global symbol table contains one global variable and two procedure names. The name mentioned in the sum_num table is not available for sum_id and its child tables. Data structure hierarchy of symbol table is stored in the semantic analyzer. If you want to search the name in the symbol table then you can search it using the following algorithm:
Next TopicRepresenting Scope Information
|