Module stack_graphs::graph
source · Expand description
Defines the structure of a stack graph.
This module contains all of the types that you need to define the structure of a particular stack graph.
The stack graph as a whole lives in an instance of StackGraph
. This type contains
several Arena
s, which are used to manage the life cycle of the data instances that
comprise the stack graph. You cannot delete anything from the stack graph; all of its contents
are dropped in a single operation when the graph itself is dropped.
There are several different kinds of node that can appear in a stack graph. As we search for a path representing a name binding, each kind of node has different rules for how it interacts with the symbol and scope stacks:
- the singleton root node, which allows name binding paths to cross between files
- scope nodes, which define the name binding structure within a single file
- push symbol and push scoped symbol nodes, which push onto the symbol stack new things for us to look for
- pop symbol and pop scoped symbol nodes, which pop things off the symbol stack once they’ve been found
- drop scopes and jump to scope nodes, which manipulate the scope stack
All nodes except for the singleton root node and jump to scope node belong to files.
Nodes are connected via edges.