The SCCD (Statecharts + Class Diagrams) compiler and runtime.

Joeri Exelmans 9848616e00 Added readme to chatroom example 5 lat temu
bsml_features e92f44ba01 Rename python src dirs to match installed names (can set to 'src' dir so you don't have to re-install after every change). Updated SCCD schema to accept all existing tests. Added XML namespace to tests. Compiler checks input file against SCCD schema. New compiler dependency 'lxml' (largely compatible with xml.etree) for dealing with XML namespaces and schemas. 5 lat temu
examples 9848616e00 Added readme to chatroom example 5 lat temu
legacy 7d7f3832fe Remove JavaScript stuff. Move existing SCCD examples, doc and textualnotations to 'legacy' folder. Update setup script. Add digital watch example (doesn't run yet, need to figure out how to connect existing Python code with the statechart model) 5 lat temu
src 4bb02bb8e3 Add new chatroom example. Added threads-backend and threadsafe eventloop-backend. 5 lat temu
test 25a125a19e Move most of the statechart language's "builtin" functions to an action language library. 5 lat temu
.gitignore a6753bd559 Fixed all tests. 5 lat temu
LICENSE 04ec602b01 initial commit (from svn repo) 9 lat temu
README.md 3064fa0c4e Rename some things, update README. 5 lat temu

README.md

Statechart interpreter with semantic variation

Dependencies

Mandatory

  • CPython >= 3.6 or PyPy >= 7.3.0 (Compatible with Python 3.6)
  • The following packages from PyPi:
    • lark-parser for parsing action code and various fragments of the statechart language
    • lxml for parsing the statechart XML input format
    • termcolor for colored terminal output
    • dataclasses (not needed for Python >= 3.7)

Optional

  • state-machine-cat to render statecharts as SVG images. Runs on NodeJS, installable from NPM.

Installation

There's a setup.py script in the src directory.

Alternatively, you can just set your PYTHONPATH environment variable to the absolute path of the src directory. This is recommended for development.

Running the tests

Assuming you followed the installation instructions above, run:

python3 -m sccd.test.run test/test_files

Runtime environment variables

The following environment variables can be set to change the behavior of the runtime. These options can be set while running the tests, or while running one of the examples.

  • SCCDDEBUG: When set, additional debug information is printed, such as the individual transitions taken.
  • SCCDTIMINGS: When set, at exit, the runtime will print information about how much time in total was spent during various parts of its execution, such as loading the model (if model was loaded from a file), generating transition candidates, executing transitions, executing actions, and more.

Included tools

The following Python modules are runnable from terminal:

  • sccd.test.run, already mentioned, runs tests.
  • sccd.render will render test files and statecharts as SVG images. Depends on state-machine-cat command.
  • sccd.statechart.cmd.check_model will check if a model is valid.
  • sccd.action_lang.cmd.prompt is an interactive prompt for the action language that is part of the statechart language.