• Home
  • Blog
  • About
kenneth kiraly

SMC - The State Machine Compiler

9/29/2012

 
I learned about The State Machine Compiler (SMC) tool a few weeks back.  This tool is very useful for auto-generating complete state machine code (and it can generate state machine diagrams as well, using Graphviz).

To use SMC, you simply define your state machine using the SMC input language (which uses a yacc-like syntax), and compile it.  SMC can output the generated state machine pattern class code to a multitude of different languages (C, Java, C++, C#, Python, Perl, and so on - even Javascript!)  The generated code is very loosely coupled with your main application code, which makes it easy to integrate and maintain.  In addition, the output code generated by the tool belongs to you, and you can use/license it as you wish.

The SMC website (http://smc.sourceforge.net/) provides a wealth of information, including documentation, tutorials, FAQs, and so on.  If you are planning on creating a state machine in your code any time soon, it is worth checking out SMC.
SMC Example 2
(Example graph from the SMC website)

Comments are closed.

    Author

    Kenneth Kiraly


    Archives

    June 2013
    December 2012
    November 2012
    October 2012
    September 2012
    August 2012
    July 2012


    Categories

    All
    Computing
    Cool
    Interesting
    Kindle


    RSS Feed




Content copyright (c) 2004-2021 Kenneth Kiraly
All Rights Reserved.