Asama 3.2 — Implement SymbolCollector that populates SymbolTable from AST #47

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

Goal: Walk the AST and populate the SymbolTable with all definitions and references.

Files to create/modify:

  • src/symbol/symbol_collector.hpp (new)
  • Replace/refactor the simple collectSymbolsRecursive in src/json.hpp

Requirements:

  • SymbolCollector class with collect(ASTNode* root, SymbolTable* table).
  • Walks all AST node types (Program, FunctionDecl, VariableDecl, Block, etc.).
  • Calls table->define() for declarations.
  • Calls table->addReference() for identifier usages.
  • Handles all 19 AST node types.

Success criteria:

  • After parsing source.sqt, SymbolTable contains all functions and variables.
  • saqut symbols source.sqt shows enriched data.
**Goal:** Walk the AST and populate the SymbolTable with all definitions and references. **Files to create/modify:** - src/symbol/symbol_collector.hpp (new) - Replace/refactor the simple collectSymbolsRecursive in src/json.hpp **Requirements:** - SymbolCollector class with collect(ASTNode* root, SymbolTable* table). - Walks all AST node types (Program, FunctionDecl, VariableDecl, Block, etc.). - Calls table->define() for declarations. - Calls table->addReference() for identifier usages. - Handles all 19 AST node types. **Success criteria:** - After parsing source.sqt, SymbolTable contains all functions and variables. - saqut symbols source.sqt shows enriched data.
saqut closed this issue 2026-06-14 21:53:22 +03:00
Sign in to join this conversation.
No description provided.