genfsm tool

Dave Touretzky edited this page Dec 26, 2016 · 3 revisions

genfsm is a tool that translates Python files containing embedded state machines written in state machine shorthand into pure Python files. The input file normally has extension .fsm and the output file has extension .py, although this is not required. genfsm is part of the cozmo-tools GitHub repository, which also includes the cozmo_fsm package.

Invoking genfsm

Typically genfsm is called by passing it an input file and letting it generate the output file name by changing the extension from .fsm to .py:

 $ genfsm MyThing.fsm
 Wrote generated code to MyThing.py.

If a different output file name is desired, it can be specified as the second argument.

A first argument of "-" tells genfsm to read from stdin (standard input).

A second argument of "-" tells genfsm to write to stdout (standard output).

Error messages are written to stderr.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.