GitXplorerGitXplorer
m

StateMachineExtraction

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
bd745fe737db058ef3b4bafc6f991221683eeee2

fix markup

mmringwal committed 10 years ago
Unverified
c034dae7b2714eed3fe65589a44318c52cc1aa6d

initial import, extracted from BTstack repo

mmringwal committed 10 years ago
Unverified
ecc69029d24add5f1407074e5b4fec2fc66304b4

Initial commit

mmringwal committed 10 years ago

README

The README file for this repository.

Annotation-based state machine definition for doubly nested switch-case implementations

  • goals: testability, documentation
  • assumptions: fixed code stucture
  • input: some code (.c)
  • output: graphviz state machine ...
  • documentation: BTstack Wiki page
  • implementation: Python
  • problems:
    • implicit event like "can send packet now", =? deal with guards?
    • "inverse handler" for "global" events

Example:

// @STATEMACHINE(multiplexer)
switch (multiplexer->state) {       // detect state variable, count {
    case W4_MULTIPLEXER:            // implicit state
        switch (event) {            // events start here
            case  L2CAP_OPEN:       // implicit event
                // @ACTION(action description)
                multiplexer->state = OTHER_STATE;
                break;              // break || return -> end case block
        }
        break;
    case OTHER_STATE:
        break;
    }
}