java.lang.Object
com.darkcollective.relix.semantic.internal.SymbolCollector

public final class SymbolCollector extends Object
Performs the symbol-collection pass over all files reachable from the root.

Files are visited in dependency-first order (the order returned by ImportGraph.processingOrder()), so that when a file is processed all symbols from its imports are already in the table.

For each file the collector:

  1. Resolves import statements — copies exported symbols from already- processed dependency files into the current file's namespace.
  2. Registers source declarations as SourceRelationSymbols; stores the full SourceDeclaration for execution-time use.
  3. Registers := assignments as either InlineRelationSymbol (inline table, with type-inferred schema) or QueryRelationSymbol (RA expression, with a placeholder schema — the real schema is filled in by the schema-inference pass in Task 4).
  4. Registers def statements as ScalarFunctionSymbols.
  5. Collects query statements from the root file only.

Namespace handling

Each file's namespace is taken from its namespace declaration, defaulting to "default". When an import brings a symbol from a file with a different namespace into the current file, the symbol is re-registered under the current namespace so that unqualified lookups (which search "default" first) work correctly.

Error handling

Registration conflicts (shadow-policy violations) and unresolved import names are accumulated in the error list rather than thrown; all other files continue to be processed.