- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Array Name Representation in Symbol Table?
It is a data structure including data for each identifier, fields for the attribute of the identifier. The data structure enables us to find the data for each identifier fastly and to save or retrieve the information for that record quickly.
The symbol table is searched each time a name is encountered in the source text. When a new name or new data about an existing name is found, the content of the symbol table modifies. Thus, the symbol table should have an effective structure for creating the data held in the table also for inserting new entries to the symbol table.
This representation is used to represent the array name and its dimension and other attributes in the symbol table.
Array names can be represented in the symbol table in two different manners.
- Fixed number of dimensions
- Variable number (No Limit) of dimensions.
Fixed Number of Dimensions
Consider an example of FORTRAN, where the number of dimensions is limited to 3 for an array figure show array representation in the symbol table.
- The word containing A represent dimension of the array. A is 2 bit long.
|Bit 1||Bit 2||Description of Array|
|0||0||Not an Array|
- UL1, UL2, UL3 represents the upper limit for each of the dimension of Array. The Upper Limits of the array can be a formal parameter.
For this possibility, we have provided 3 bits for B to define whether any of the three possible limits are formal parameters.
Here ith bit is 1 that means ULi is a formal parameter.
In the above case 2nd bit is 1 and hence UL2 is passed as a formal parameter, and UL2 in the symbol table now will contain a pointer to Symbol table Record containing the value of UL2.
Example1− Consider the following subroutine in FORTRAN.
SUBROUTINE S (ARRAY, A, B)
INTEGER A, B
REAL ARRAY (5, A, B)
Construct Symbol Table Record for Array in this subroutine.
∴ UL1 = 5
UL2 = Pointer to record for name A.
UL3 = Pointer to record for name B.
Linked Array Representation of Array with no limit on the dimension
- Symbol Table will store multiple dimensions of n array.
- It contains a pointer to an array containing the lower and upper limit of the first dimension, and this array is connected to another array that contains lower and upper limit for the second dimension and so on.
- Random access to the symbol table is facilitated.
- The ease of accessibility is increased.
- Easy to maintain information.
- Problems of pointer indirection and dangling references.
- The additional requirement of the separate array for each dimension
- What is representation of fixed-length and variablelength array representation in the symbol table?
- What is the Symbol Table?
- What is two array representations in the symbol table?
- What Information is Stored in the Symbol Table?
- Different table symbol in SAP HANA database
- What is Instance-based representation?
- What is the maximum length of a table name in MySQL?
- What is the use of the @ symbol in PHP?
- What is Decibel Representation for Wireless Communications?
- What is types of Intermediate Code Representation?
- What is Floating-Point Representation in Computer Architecture?
- What is Fixed Point Representation in Computer Architecture?
- What is the significance of Hyderabad metro rail symbol?
- What is "Processing Symbol Files" message in Xcode?
- Can we use the “.” symbol in MongoDB collection name?