ErlEsy is a simple graphing tool for Erlang. It allows for automatic generation of state machine diagrams out of Erlang source files. It works by parsing an .erl source file and building a digraph out of it. The digraph can be then transformed into any format that will allow for its graphical representation.
OTP 19
rebar3
accessible via path
ErlEsy can be build by rebar3
rebar3 get-deps
rebar3 compile
You can also use the makefile, with these directives:
make compile
- fetches deps and compiles erlesy
make shell
- starts a erlesy shell
To run ErlEsy open a shell with
make shell
Then you can create any file by using
-spec create_graph(string(), [string()], dot | plantuml) -> ok.
otp_parser:create_graph(FileName, IncludeFiles, Mode).
- FileName should be a path to the .erl file you want to graph
- IncludeFiles is a list of paths towards include files
- Mode is
dot
orplantuml
ErlEsy currently supports two forms of output, a DOT (.gv) formatted file, or PlantUML
DOT file can be used e.g. at http://www.webgraphviz.com/
PlantUML file can be used e.g. at https://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
Suppose your project structure is
project/src/your_fsm.erl
: The FSM or statem you want to graphproject/include/
: Path to include files used by the fsm
Then execute the following in the erlesy folder:
make shell
otp_parser:create_graph("/absolute_path_to_project/project/src/your_fsm.erl",["/absolute_path_to_project/project/include/"], dot].
This will create a .gv
dot file in the same folder the source is located in.