Home | Download | ANTLRWorks | Wiki | About ANTLR | Feedback | Support | Bugs | v2


Latest version is 3.0.1
Download now! »

Download
» Home
» Download
» ANTLRWorks
» News
»Using ANTLR
» Documentation
» FAQ
» Articles
» Grammars
» File Sharing
» Runtime API
» Tech Support
» Bug Tracking
»About ANTLR
» What is ANTLR
» Why use ANTLR
» Showcase
» Testimonials
» Getting Started
» Software License
» ANTLR WebLogs
» ANTLR Workshops
»StringTemplate
»ANTLR v2
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



GraphViz Dot grammar

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
  • −−
    or
    −>
    , depending on whether the document defines a directed graph or not, and
  • the name of the
    node
    which appears as the target of the relationship.

The files are:


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