Asama 3.1 — Implement Symbol struct and SymbolTable class with nested scopes #45

Open
opened 2026-05-26 19:52:14 +03:00 by saqut · 0 comments
Owner

Goal: Build a full symbol table with nested scope support.

Files to create:

  • src/symbol/symbol.hpp (new)
  • src/symbol/symbol_table.hpp (new)

Requirements:

  • Symbol struct: name, kind (enum), type, definitionLoc, references, scope, metadata.
  • SymbolTable: nested scope stack (enterScope/exitScope), define(), resolve(), addReference(), getAllSymbols(), toJson().
  • Nested scopes: variable in inner scope shadows outer.
  • Duplicate definition in same scope returns false.

Success criteria:

  • Nested scopes work correctly.
  • Duplicate definition in same scope returns false.
  • resolve finds symbols across scope boundaries.
**Goal:** Build a full symbol table with nested scope support. **Files to create:** - src/symbol/symbol.hpp (new) - src/symbol/symbol_table.hpp (new) **Requirements:** - Symbol struct: name, kind (enum), type, definitionLoc, references, scope, metadata. - SymbolTable: nested scope stack (enterScope/exitScope), define(), resolve(), addReference(), getAllSymbols(), toJson(). - Nested scopes: variable in inner scope shadows outer. - Duplicate definition in same scope returns false. **Success criteria:** - Nested scopes work correctly. - Duplicate definition in same scope returns false. - resolve finds symbols across scope boundaries.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: saqut/saqut-compiler#45
No description provided.