Module description

fst -- FSM State
The fst module implements a state in a Finite State Machine. See fsm for more info about using this module.

State structure

fst% ( -- n )
Get the required space for a state variable

State creation, initialisation and destruction

fst-init ( x xt1 xt2 c-addr u n fst -- )
Initialise the state with id n and label c-addr u, entry action xt1, exit action xt2 and data x
fst-(free) ( fst -- )
Free the internal, private variables from the heap
fst-new ( x xt1 xt2 c-addr u n -- fst )
Create a new state on the heap with id n, label c-addr u, entry action xt1, exit action xt2 and data x
fst-free ( fst -- )
Free the state from the heap

Member words

fst-id@ ( fst -- n )
Get the id of the state
fst-label@ ( fst -- c-addr u )
Get the label of the state
fst-label? ( c-addr u fst -- c-addr u false | fst true )
Check the label c-addr u with this state
fst-data@ ( fst -- x )
Get the data of the state
fst-data! ( x fst -- )
Set the data for the state
fst-entry@ ( fst -- xt )
Get the entry action of the state
fst-exit@ ( fst -- xt )
Get the exit action of the state
fst-attributes! ( c-addr u fst -- )
Set the extra graphviz attributes for the state
fst-attributes@ ( fst -- c-addr u )
Get the extra graphviz attributes of the state

Transition words

fst-new-transition ( x xt c-addr u fst1 n fst -- ftr )
Add a new transition to state fst1 with label c-addr u, number events n, action xt and data x
fst-any-transition ( x xt c-addr u fst1 fst -- ftr )
Set the any transition to state fst1 with label c-addr u, action xt and data x
fst-find-transition ( c-addr u fst -- ftr | nil )
Find the transition with label c-addr u, else return nil

Event words

fst-feed ( n fst -- fst | nil )
Feed the event to this state, return the next state or nil if the event did not match any condition
fst-try ( n fst -- fst | nil )
Try the event for this state, return the result

Inspection

fst-dump ( fst -- )
Dump the fst variable

Generated by fsdocgen 0.1.0