Skip to content

Instantly share code, notes, and snippets.

@frame-lang
Last active September 25, 2023 01:13
Show Gist options
  • Save frame-lang/cac0a49613ee241b563845b789e06652 to your computer and use it in GitHub Desktop.
Save frame-lang/cac0a49613ee241b563845b789e06652 to your computer and use it in GitHub Desktop.
Frame Hierarchical State Machine
`import sys`
#![generate_frame_event]
fn main {
var hsm:# = #HierarchicalStateMachine()
hsm.start()
hsm.stop()
}
#HierarchicalStateMachine
-interface-
start
stop
-machine-
$Begin
|start|
-> "start" $Working ^
$Working => $Default
|>|
print("Hello World") ^
$End
|>|
print("End of the World") ^
$Default
|stop|
-> "stop" $End ^
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment