GNU Guile state machine compiler.
Guile-SMC is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version. Please see COPYING
file for the terms of GNU General
Public License.
PlantUML (http://www.plantuml.com/) state machine compiler:
(let ((fsm (puml->fsm (current-input-port)))) (format #t "output fsm: ~a~%" fsm) (format #t "transition table:~%") (pretty-print (hash-table->transition-list (fsm-transition-table fsm)) #:display? #t)))
State machine validation:
(let ((fsm (puml->fsm (current-input-port))) (format #t "validation report:~%") (pretty-print (fsm-validate fsm)))
Want more finite-state machines? Now you can generate a FSM from the PlantUML
format that reads a FSM in the PlantUML format – see
examples/pumlpuml.scm
.
Also see other examples the examples
directory.
If you still wonder if there any practical use of that, please take a look at Guile-INI: https://github.com/artyom-poptsov/guile-ini
- Write a PlantUML generator that take a
<fsm>
instance and produces a PlantUML state diagram. - I think it’s possible to implement some FSM profiling facilities that will, for example, measure how much time it takes to go from the entry state of an FSM to an end state and calculate how much time an FSM spends in each state. This measurements can be used to optimize an FSM.
- Produce a timing diagram based on FSM log output in PlantUML format. That
would help with analyzing and optimizing an FSM. It could be implemented
in the
smc
compiler as part of state machine benchmark suite. - It is possible to add compilation to other languages aside from Scheme, but it will be quite hard to implement indeed.