[antlr-interest] Using ANTLRWorks DOT Output
Randall R Schulz
rschulz at sonic.net
Wed Jun 27 08:39:05 PDT 2007
Hi,
This is probably for Jean Bovet to answer, but if anyone else knows,
please chime in.
I have discovered a rule in my grammar whose DFA is immense (owing, I
think, to a grammar that is specified very minimally leading to a lot
of ambiguity and my current laziness in just turning on backtracking).
Visualizing the DFA within ANTLRWorks is not too helpful because even
when the zoom is lowered as much as possible while still being able to
read the labels, only a fraction of the graph is visible (and I have a
1600x1200 monitor!).
So I thought I'd start working with the DOT file that ANTLRWorks allows
you to save. However, I find that when I use the "dot" command to
render it, it doesn't look like the graph displayed within ANTLRWorks.
In particular, I notice that the arcs have no arrows and the fonts are
different.
So the question is, what "dot" options does ANTLRWorks use to render the
graphs it generates?
Curiously, I thought I'd figure this out myself,and wrote a little
intermediary shell script to intercept ANTLRWorks' invocations of dot
and capture the arguments it uses to a log file (and then invoke dot as
instructed by ANTLRWorks). When I configure ANTLRWorks run this script
instead of invoke dot directly, the invocations all look like this:
4 arguments:
"-Tdot"
"-o"
"/tmp/GrammarDOTTab50533.out"
"/tmp/GrammarDOTTab50532.in"
This invocation tells dot to produce DOT-format output. Where / how does
the image generation happen?
Thanks.
Randall Schulz
More information about the antlr-interest
mailing list