Module dot_parser::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.
Structs§
- A single edge of the graph.
- A set of
Edges. - A
Graphis a structure that can be created from a regularGraph, but that is more friendly to work with. For instance, in aGraph, attributes are most often given as a list of list ofAttr, while in aGraph, the lists are flatten. - A single node of the graph.
- A set of
Nodes.
Enums§
- 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.