Class CallGraphCollector

All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeListener, EK9Listener

public final class CallGraphCollector extends ScopeStackConsistencyListener
Collects call graph information during AST traversal in Phase 5 (PRE_IR_CHECKS).

This listener walks the AST and populates a shared CallGraph with:

  • Callable registrations (functions, methods, programs, operators)
  • Call edges (caller → callee relationships)
  • Allocated types (for RTA filtering of polymorphic calls)
  • Assertion locations (for E81007 and orphan detection)

Thread-safe: Uses a shared CallGraph with ConcurrentHashMap internals. Multiple instances can process different source files in parallel.