cfsm
cfsm is a small program that accepts a specification for a finite state machine in a high-level text format, and compiles it into a C source and header file. It can also output the FSM in Graphviz dot format so you can make pretty pictures:
The FSMs that cfsm generates are transition checked; if you use the API then it is not possible to make illegal transitions. You can also specify preconditions that must be satisfied prior to moving into or out of a state, and callback functions that will fire when states are entered or left. Don't expect anything groundbreaking here: my goals were paranoia, simplicity and readability/editability of the produced code.
cfsm is licensed under a ISC/BSD licence. The author asserts no license rights over the output (C source/header, dot graph). Please see the LICENSE file in the source distribution for details.
News
Tue, 17 Apr 2007: cfsm rewritten in C
I have rewritten cfsm in C using Lex, Yacc and mtemplate for output generation.
I have started experimenting with renovating parts of OpenSSH's sshd and wanted a nice way to build a transition-checking finite state machine. The result of this desire coupled with a few hours of hacking to distract myself from a hangover is cfsm, which is now available in CVS. I'm not sure when (if ever) I will make a tarball release. If cfsm interests you then please mail me.
Download
cfsm is available here:
- CVSWeb
- AnonCVS from anoncvs@anoncvs.mindrot.org/cvs (SSH on port 22, no password)