|
|
@ -0,0 +1,38 @@ |
|
|
|
include yslt.yml2 |
|
|
|
|
|
|
|
tstylesheet { |
|
|
|
template "protocol/fsm" document "{@filename}.dot", "text" |
|
|
|
|| |
|
|
|
digraph finite_state_machine { |
|
|
|
rankdir=LR; |
|
|
|
node [shape = doublecircle]; |
|
|
|
`apply "state[@end='1']" mode=end`; |
|
|
|
node [shape = circle]; |
|
|
|
|
|
|
|
`` apply "state" mode=do |
|
|
|
} |
|
|
|
|| |
|
|
|
|
|
|
|
template "state", mode=end > «@name» |
|
|
|
template "state", mode=do apply "event", 0 with "state", "@name"; |
|
|
|
|
|
|
|
template "event" { |
|
|
|
param "state"; |
|
|
|
choose { |
|
|
|
when "count(transition) > 0" |
|
|
|
apply "transition|condition/transition", 0 |
|
|
|
with "state", "$state", with "event", "@name"; |
|
|
|
otherwise |
|
|
|
if "@name != 'Init'" |
|
|
|
| «$state» -> «$state» [ label="«@name»" ]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
template "transition" { |
|
|
|
param "state"; |
|
|
|
param "event"; |
|
|
|
|
|
|
|
| «$state» -> «@target» [ label ="«$event»" ]; |
|
|
|
} |
|
|
|
} |
|
|
|
|