Foundationপ্রথম নীতি থেকে
LEVEL 5 · Compilers

Symbol Table

সিম্বল টেবিল

Identifier → attribute (type, scope, address) mapping — compiler-এর shared notebook যেখানে প্রতিটা name-এর সব জানা কথা।

Scope-structure: stack of hash tables —

global: { print: func(int), g: int }
  fn f: { x: int }
    block: { x: bool }        ← shadowing
  • Declaration-এ insert, use-এ lookup — innermost scope first
  • Passes share করে: checker type বসায়, codegen address বসায়
  • Linker-ও symbol table চালায় — object file-এর .symtab, undefined symbol resolve ওখানেই; একই ধারণা, ভিন্ন file format