Dot Parser - An AST & Parser for Graphviz files
Installation
Add the following to your cargo.toml file:
dot_parser = 0.1
Example Usage
At its core, this crate exposes a GraphViz struct, which represents
the root of an AST describing a given graphviz file. As an example of how
to use this, we could write the following:
use FromStr;
use DotGraph;
let graph_text = "digraph G { A -> B }";
let result = from_str.unwrap;
Using the AST
Once parsed, the ast provides information about the original underlying graphviz graph - for example, the following code reads in the node ids presented the toplevel lines:
use DotGraph;
use Node;
use FromStr;
let dot_graph = from_str.unwrap;
let mut node_ids = vec!;
if let Directed = dot_graph
Filing Bugs
Since this is still very much in development, if you encounter an issue, please file a bug! Please include the original graphviz string you were trying to parse to help us debug the issue faster