Go to the first, previous, next, last section, table of contents.


Graphviz

Certain pieces of the STT such as the finite automata and pushdown automata are capable of writing themselves as Graphviz dot files. These text files can then be converted to postscript using the tools in the graphviz distribution and further converted to various image formats using freely available postscript/image conversion tools. My machine has Ghostscript and ImageMagick installed and I have been very pleased with them.

To generate graphviz files, you need to add a few properties to the grammar and recompile it. The `.dot' files will be written where the generated classes are (can override this with the viz-namespace and vis-sourcepath properties). To tell the processor to write the files, say:

property viz-lexical = "true";
property viz-syntactic = "true";

There are several properties which customize the dimensions, colors, and styles of the generated files. Note that visualization of all but the most trivial of grammars is difficult at best since the complexity of the graphs and the size of the images become prohibitive. You'll find yourself wanting to visualize those graphs anyway since it's awfully cool, but you'll only get a gestalt view. Try fiddling with the graph size with the vis-dfa-size and viz-dpa-size properties (see graphviz manual).

Note: The license for GraphViz is "open-source", but it's not free -- caveat emptor, and for that matter, caveat vendor.


Go to the first, previous, next, last section, table of contents.