Expand description
The Table is a monolithic data structure representing everything the type checker knows about a program.
Individual nodes in the table can be queried using the Entry API (Table::entry) or modified using the EntryMut API (Table::entry_mut).
§Contents of a “node”
Always present:
- NodeKind: Determines how this node will be treated during the stages of compilation
- Parent node: Arranges this node in the hierarchical graph structure
Populated as needed:
- Children: An associative array of names to child nodes in the graph. Child nodes are arranged in a strict tree structure, with no back edges
- Imports: An associative array of names to other nodes in the graph. Not all import nodes are back edges, but all back edges must be import nodes.
- Types: Contains type information populated through type checking and inference. Nodes with unpopulated types may be considered type variables in the future.
- Spans: Positional information from the source text. See cl_structures::span.
- Metas: Metadata decorators. These may have an effect throughout the compiler.
- Sources: Pointers back into the AST, for future analysis.
- Impl Targets: Sparse mapping of
impl
nodes to their corresponding targets. - etc.
Structs§
- The table is a monolithic data structure representing everything the type checker knows about a program.