java.lang.Object
org.jhotdraw8.graph.io.GraphvizReader<V,A>
- Type Parameters:
V- the vertex data typeA- the arrow data type
Reads a graph from a graphviz "dot" file.
Parses the following productions. Does not support subgraphs!
graph : [ strict ] (graph | digraph) [ ID ] '{' stmt_list '}'
stmt_list : [ stmt [ ';' ] stmt_list ]
stmt : node_stmt
| edge_stmt
| attr_stmt
| ID '=' ID
| subgraph
attr_stmt : (graph | node | edge) attr_list
attr_list : '[' [ a_list ] ']' [ attr_list ]
a_list : ID '=' ID [ (';' | ',') ] [ a_list ]
edge_stmt : (node_id | subgraph) edgeRHS [ attr_list ]
edgeRHS : edgeop (node_id | subgraph) [ edgeRHS ]
node_stmt : node_id [ attr_list ] * node_id : ID [ port ]
port : ':' ID [ ':' compass_pt ] * | ':' compass_pt
subgraph : [ subgraph [ ID ] ] '{' stmt_list '}'
compass_pt : (n | ne | e | se | s | sw | w | nw | c | _)
edgeop : -> | --
References:
- Graphviz. DOT Language.
- graphviz.org
-
Constructor Summary
ConstructorsConstructorDescriptionGraphvizReader(@NonNull BiFunction<String, Map<String, String>, V> vertexFactory, @NonNull Function<Map<String, String>, A> arrowFactory, @NonNull Supplier<MutableDirectedGraph<V, A>> graphFactory) GraphvizReader(@NonNull Function<String, V> vertexFactory, @NonNull Function<Map<String, String>, A> arrowFactory) -
Method Summary
-
Constructor Details
-
GraphvizReader
-
GraphvizReader
-
-
Method Details
-
newInstance
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-