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

public final class ImportGraph extends Object
Directed dependency graph of all .relix files reachable from a root.

Built by build(java.lang.String, com.darkcollective.relix.lang.ast.Script, com.darkcollective.relix.semantic.ScriptLoader) which loads files transitively via a ScriptLoader, detects import cycles, and records missing-file and syntax errors, the latter at the position the frontend reports. After construction the graph is immutable.

Use processingOrder() to obtain the files in dependency-first order — every file appears after all files it imports — suitable as the iteration order for the symbol-collection pass.

Cycle detection

Cycles are detected during loading via a DFS in-progress set. When a cycle is found the cycle path is recorded as a SemanticError (line 0, col 0), loading of that branch is abandoned, and loading continues from other branches. All errors are accessible via loadErrors().

Path resolution

Import paths written in source (import './helpers.relix') are resolved relative to the importing file's directory before being used as graph node keys. See resolvePath(String, String).