Class SymbolCollector
java.lang.Object
com.darkcollective.relix.semantic.internal.SymbolCollector
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:
- Resolves
importstatements — copies exported symbols from already- processed dependency files into the current file's namespace. - Registers
sourcedeclarations asSourceRelationSymbols; stores the fullSourceDeclarationfor execution-time use. - Registers
:=assignments as eitherInlineRelationSymbol(inline table, with type-inferred schema) orQueryRelationSymbol(RA expression, with a placeholder schema — the real schema is filled in by the schema-inference pass in Task 4). - Registers
defstatements asScalarFunctionSymbols. - Collects
querystatements 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.
-
Method Summary