< April 2007 >
SuMoTuWeThFrSa
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
2930     

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:

Example Graphviz graph

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.

[permanent link]

Wed, 07 Feb 2007: cfsm in CVS

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.

[permanent link]

Download

cfsm is available here: