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 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.
  • 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.