This ANTLR grammar will allow you to parse .dot files using ANTLR.

Currently, the parser builds a tree whose root node is a
graph
or
digraph
, depending on whether the document defines a directed graph or not.
The first child is just a text with the name of the graph, and his siblings are, either
nodes
or
edges
, in the order in which they appear in the document.
Each
node
contains a set of children whose names are the name of the
node
's attributes, and themselves containing just a text node with the value of each one of the attributes.
On the other hand, a
edge
is labeled with the origin of the relationship, and would be a tree node composed of

The files are:


chous - available at acm-sl.org
Last modified: Tue Jan 24 16:27:28 CET 2006