Common Lisp Package: S-DOT

See http://martin-loetzsch.de/S-DOT

README:

FUNCTION

Public

CHECK-SYNTAX (GRAPH &KEY (LEVEL 0))

Checks whether the s-expression 'graph' is syntactically correct. Note that it does not check whether the attributes contain useful values.

RENDER-S-DOT (FILE-NAME FORMAT GRAPH &KEY (CHECK-SYNTAX T))

Renders a s-dot graph into a graphic file. 'file-name' should be a pathname. If the file-name is /foo/bar.png, the dot file /foo/bar.dot is created and then rendered. Format should be one out of http://www.graphviz.org/doc/info/output.html, for example svg, ps, gif, png, or jpg. The asdf:run-shell is used to launch dot. If that does not work for you, write a similar function that uses (s-dot->dot) for dot generation and then runs dot on it. Please note that it is more efficient to open a pipe to 'dot' instead of writing a file and reading that in again. A cross-platform pipe implementation can be found at http://cvs.sourceforge.net/viewcvs.py/clocc/clocc/src/port/ext.lisp?view=markup

S-DOT->DOT (STREAM GRAPH &KEY (CHECK-SYNTAX T))

Generates dot syntax from a s-dot expression and writes the result to 'stream'. This code looks indeed ugly. If you really want to understand what's going on, then it might be easier to look in the the XSLT stylesheet at http://www.martin-loetzsch.de/DOTML/dotml-1.3/dotml2dot.xsl . This code does exactly the same.

Private

TEST-S-DOT

Generates a few charts in /tmp/. If you don't have /tmp/, change the directory below to something else

VARIABLE

Private

Undocumented

S-DOT-SYNTAX