Giter Club home page Giter Club logo

scxmlcc's Introduction

Home | Documentation | Latest Release | scxmlgui

Welcome to scxmlcc.

The scxml state machine to c++ compiler.

What?

The goal of scxmlcc is to make a Open Source full featured state machine compiler that can generate simple and effective C++ state machines from scxml state charts.

This project is developed and professionally supported by jp-embedded ApS and is released under the GNU GPL v3. However, the generated state machine code is not covered by license.

Why?

There are several reasons why this project started.

  • Typically, state machine implementations depend on external libraries or specific, often expensive, design tools. The generated state machines from this scxml compiler has no external dependencies. It uses STL only.
  • Instead of inventing yet another standard for describing state machines, scxmlcc uses the scxml standard, so the behavior is well defined, and gives freedom to use any xml editor or statechart design tool which supports scxml (or just xml).
  • State machine implementations often lack features to make it usable for real applications. scxmlcc uses the scxml standard which is featured for real applications.
  • From a programming perspective, implementing state machines often lead to using if-else or switch-case constructs, because it seems like the simplest. Most programs start out fairly simple and well structured, but as new features are implemented, this very often leads to deeply nested constructs. Scxmlcc aims at being easy to implement to make it a real alternative.

Features

scxmlcc does not yet support all features of the scxml standard. Most of the core constructs are in place though. Besides the standard, custom constructs is implemented. This means that constructs like the data model, actions and conditions can be implemented in C++ and then be attached to the state machine, instead of implementing them in scxml. Thus, seperating the state machine and the logic.

The generated state machines use standard C++ constructs as much as possible such as abstract classes and templates to minimize the code needed to implement the state machine. However we try not to overdo templates to keep the code readable, while making the code as efficient as possible. Macros are totally avoided. If you like macros to for example define custom actions, you can easily add them on your own.

The folowing features are currently implemented:

  • Hierarchical states.
  • Internal, external, targetless, eventless and conditional transitions.
  • Custom data model.
  • Custom enter/exit state actions.
  • Custom transition actions and conditons.
  • Zero runtime overhead for emtpy actions and conditions.
  • LCA calculation is done (mostly) compile time.
  • Final states

Next todo on the feature list is to complete the core constructs of the scxml standard. Most importantly, this include:

  • Parallel states (in progress)
  • History states

If you have any suggestions on features to prioritize, please create an issue.

For a chat, you can also write to me on messenger here

For more information, see Documentation

scxmlcc's People

Contributors

jp-embedded avatar

Watchers

 avatar  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.