Git Product home page Git Product logo

statechart's Introduction

C++ StateChart Library

StateCharts (Harel, 1987) is a visual formalism for declarative description of complex interactive systems. It extends the conventional state machine formalism with Hierarchy, Concurrency and Communication.

SCXML is a W3C standard based on StateCharts. This is a C++ library that implements the SCXML specification. Instead of XML, a StateChart is represented as a StateChart protobuf.

Features

Many features from the SCXML standard have been implemented.

  • Composite State
  • Parallel State
  • Datamodel
  • Transitions (Conditional, Eventless)
  • Executable Statements (Raise, Log, Assign, If, ForEach, Send)
  • Serialize/Deserialize the state machine

TODO

  • History

Example

Here's an example of a StateChart that describes a Microwave.

Microwave StateChart

You can see //statechart/example/microwave_example_main.cc for details on how to specify such a StateChart as a StateChart proto and how to use it in code.

Usage

To build the library you'll need bazel. You can download and install it from here.

# Download/Clone the repo.
git clone https://github.com/google/statechart.git
cd statechart

# Build the library
bazel build //statechart/...

# Run unit tests
bazel test //statechart/...

# Run the Microwave example
bazel run //statechart/example:microwave_example_main -- --alsologtostderr

Disclaimer

This is not an officially supported Google product.

References

  • David Harel, 1987, Statecharts: a visual formalism for complex systems, Science of Computer Programming. Link
  • State Chart XML (SCXML): State Machine Notation for Control Abstraction. Link

statechart's People

Contributors

4e1e0603 avatar peterlauqf avatar srgandhe 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.