9

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

Roberto Aloi
  • 30,570
  • 21
  • 75
  • 112

3 Answers3

2

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 J.
  • 31,569
  • 22
  • 122
  • 174
  • Thanks to Internet Archive (https://web.archive.org/web/20111105111111/http://www.trapexit.org/forum/viewtopic.php?p=44468) I managed to find the mentioned tools - see https://github.com/lavrin/graph_draw and http://erlang.org/pipermail/erlang-questions/2001-October/003717.html. I'm not sure yet whether they're of any use. – erszcz Sep 04 '15 at 13:47
2

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.

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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
David J.
  • 31,569
  • 22
  • 122
  • 174
1

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
  • 9,417
  • 1
  • 39
  • 48