Module canonical

Source
Expand description

This modules implement “Canonical graphs”. This is motivated by the fact that graphs parsed naively may be difficult to work with, from a programming viewpoint: typically, attr_list in the grammar are defined as “[ID = ID, …][ID = ID, …]”. Therefore, we may want to flatten such structures. This is done in the canonical module.

The main structure of the module is Graph, which implements such a flatten graph.

Re-exports§

pub use crate::ast::AList;

Structs§

Edge
A single edge of the graph.
EdgeSet
A set of Edges.
Graph
A Graph is a structure that can be created from a regular Graph, but that is more friendly to work with. For instance, in a Graph, attributes are most often given as a list of list of Attr, while in a Graph, the lists are flatten.
IDEq
An identifier equality, i.e. a statement that has the form ID '=' ID.
Node
A single node of the graph.
NodeSet
A set of Nodes.

Enums§

AttrStmt
An AttrStmt, i.e. a statement that applies to either the whole graph, all edges, or all nodes. Note that, in a canonical graph, AttrStmts contain a single statement.