Module dot_parser::ast
source · Expand description
This module implements an Abstract Syntax Tree for Dot graphs. The main
structure is Graph
, which corresponds to the graph
non-terminal in the
grammar.
Re-exports§
pub use either;
Structs§
- A list of attributes. This corresponds to the
a_list
non-terminal of the grammar. - A list of
AList
s, i.e. a list of list of attributes. This (strange) indirection is induced by the grammar. This structure corresponds to theattr_list
non-terminal of the grammar. - The Right hand side of an edge description. This corresponds to the
EdgeRHS
non-terminal of the grammar. Notice that the grammar allows multiple EdgeRHS in sequence, to chain edges:A -> B -> C
. - The description of an edge. This corresponds to the
edge_stmt
non-terminal of the grammar. - This structure is an AST for the DOT graph language. The generic
A
denotes the type of attributes. By default (and when parsing), it is(&'a str, &'a str)
, i.e. two strings, one for the key and one for the value of the attribute. The library provides functions to map from one type to an other. - This structure corresponds to the
node_id
non-terminal of the grammar. If contains the identifier of the node, and possibly a port. - This structure corresponds to the
node_stmt
non-terminal of the grammar. It is basically a node identifier attached to some attributes. - A list of statements. This corresponds to the
stmt_list
non-terminal of the grammar. - A subgraph. This corresponds to the
subgraph
non-terminal of the grammar.
Enums§
- An attribute statement. This corresponds to the rule
attr_stmt
non-terminal of the grammar. - An enum that corresponds to the
compass_pt
non-terminal of the grammar. - An error that can occur when reading from a file.
- This enum type contains errors that can occur when using a DotParser. In principle, those errors should never occur, as all parsing error should be caught by DotParser::parse. Therefore, if such error occurs, it is a bug, probably a missing feature.
- This enum corresponds to the
port
non-terminal of the grammar. - A statement of the graph. This corresponds to the
stmt
non-terminal of the grammar.