views:

429

answers:

3

Do you know of any existing tool to graphically render the diagram of an Erlang gen_fsm starting from the source code?

+1  A: 

This forum post ("I would like to try some tool than link gen_fsm (or other erlang FSM) and dot (graphviz) file.") might be of use to you:

http://www.trapexit.org/forum/viewtopic.php?p=44468

David James
+1  A: 

The next-state in gen_fsm can be a computed value that static source analysis would not be able to find out in the general case.

Of course; with type annotations it would be possible, but then you could just as well write down your state transitions explicitly to generate your .dot file from.

Christian
+2  A: 

When you say you want to analyze the source code of an Erlang program, it made me wonder if you were by chance interested in dependency analysis of your program itself. (You might only care to analyze the FSM that you are writing, but I wanted to double check).

If so, Erlang's Xref - The Cross Reference Tool, might be of interest: http://ftp.sunet.se/pub/lang/erlang/doc/apps/tools/xref_chapter.html

I'm a new user, so I can't post another hyperlink, but if you search for "erlang xref graphviz" you will find a post on erlang.org where Ulf W describes connecting Xref to GraphViz.

David James