Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | A DCG for a subset of the DOT language |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.1.0 |
SHA1 sum: | e6fd689f586d4d6d74874c4a041aa637b8fb0cd9 |
Author: | Lee Coomber <github@coomber.org> |
Packager: | Eyal <edechter@mit.edu> |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.1.0 | 0cc63200260cfc765ff1ffd212eb157d959cb822 | 1 | http://github.com/edechter/dot_dcg.git |
5f4d7d481d0cfb1272cdd9faf117e223a08047bc | 1 | https://github.com/edechter/dot_dcg.git | |
a89589270905202b49a435e06642d0bf66377f49 | 23 | http://github.com/edechter/dot_dcg.git | |
https://github.com/edechter/dot_dcg.git | |||
e6df6e284040736be13ebe1f184ad4125a51dbee | 1 | http://github.com/edechter/dot_dcg.git | |
e6fd689f586d4d6d74874c4a041aa637b8fb0cd9 | 1 | https://github.com/edechter/dot_dcg.git |
This PROLOG library provides a definite clause grammar (DCG) for generating and parsing expressions in the DOT graph language. The DCG allows you to generate DOT expressions from a PROLOG DSL, and it allows you to parse DOT expressions into a the DSL.
doc_dcg is developed for SWI Prolog and available as a pack for installation:
?- pack_install(dot_dcg).
?- use_module(library(dot_dcg).
?- dot(Dot, `digraph mygraph { node1;node2 [label=\"My node\"];node1->node2; }`, []). Dot = digraph("mygraph", [node_stmt("node1"), node_stmt("node2", [attr("label", ""My node"")]), edge_stmt(["node1", "node2"])])
?- dot(digraph("mygraph", [edge_stmt(["node1", "node3"]), node_stmt("node2", [attr("label", "\"My node\"")]), edge_stmt(["node1", "node2"])]), X, []), format(X). digraph mygraph {node1->node3;node2 [label="My node"];node1->node2}
Pack contains 6 files holding a total of 12.0K bytes.