You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Fabien Freling 44a768a6c0 initial commit 2 years ago
.gitignore initial commit 2 years ago
Makefile initial commit 2 years ago
README.md initial commit 2 years ago
generator.py initial commit 2 years ago
main.cpp initial commit 2 years ago
state-machine.gv initial commit 2 years ago

README.md

State machine generator

This tool is used to describe a state machine in dot format (used by Graphviz). It then generates the corresponding C++ code with identified callbacks.

Usage

  • Create a Python3 virtualenv with pydot installed
  • Create a dot file with the state machine named "state_machine.gv"
  • Run 'make png' to see the PNG representation
  • Run 'make cpp' to generate the C++ code

C++ code

The tool will generate 3 files:

  • 'state_machine.h' and 'state_machine.cpp' that contain the skeleton of the state machine
  • 'state_impl.cpp' that contains the empty callbacks

You can compile these sources with a simple main like the one provided.