GithubHelp home page GithubHelp logo

ssm's Introduction

SSM - SimpleStateMachine

Tool to generate state machines for c++11.

Features:

  1. Simple description language
  2. Super simple to use under C++11
  3. Using Graphviz dot to generate nice diagrams

Description Language

A simple state machine: example1.sm

export MyStateMachine

MyStateMachine
	MyStateStart: once helloWorld()
		true -> MyStateFinish
	MyStateFinish:

Using it for C++11

Assuming you have following class.:

class MyClass {
public:
	void helloWorld() {
		std::cout<<"Hello World"<<std::endl;
	}
};

To use it with our state machine example1.sm. We first run ./ssm.pl --cpp11 example1.sm this will create a single example1.sm.h

	#include "example1.sm.h"
...
	MyClass myClass;

	MyStateMachine example1(&myClass);
	example1.run();

Last step is compiling: g++ -std=c++11 -o example1 example1.cpp. Done! We can run ./example1 and get the output: Hello World.

Using Graphviz

Running: ./ssm.pl --png example1.sm creates a file example1.sm.png:

alt diagram

You can also run ./ssm.pl --view example1.sm which will display the diagram immediatly.

Getting started

Just download everything from github and you are ready to start.

ssm's People

Stargazers

Joshua Pollack avatar

Watchers

Simon Gene Gottlieb avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.