/    /  Compiler design-Symbol Table Representation

Symbol Table Representation

 

Symbol table have the following attributes:

  1. Data- Types
  2. Name of the Variable
  3. Scope
  4. Address/Location/ Offset
  5. Storage Class
  6. Other Information

 

Example:

main()
{
     Static int a;
     Float f;
     fact();
}

S.NoNameTypeStorage classLocationScope
1aintstatic5000main
2ffloatauto5004main
3factfunction5008

 

The symbol table can be represented in 2 ways:

  1. Fixed Length
  2. Variable Length

 

Example:

Int a, b, c, sum;
Float percentage;
Void readdate();
---
---
---

 

 

Reference Link

Symbol Table Representation