scxml-2
源码:https://github.com/jp-embedded/scxmlcc
scxml状态机的一个c++编译器
scxml目的是制作一个开源的具有状态机编译器完全特征的,可以从scxml状态图中生成简单的有效的c++状态机。
特点:
scxmlcc并没有支持scxml的全部特征。不过大部分核心功能已经实现。
除了标准之外,自定义的结构也被实现。意味着像数据模型(data model),actions,以及conditions可以用c++来实现,然后加入到状态机当中,而不是需要在scxml中实现。
因此把状态机和逻辑分开了。
实现的功能有以下:
- 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