p≡p engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

42 lines
1.1 KiB

// This file is under GNU General Public License 3.0
// see LICENSE.txt
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";
const "transitions", "transition|descendant::condition/transition|descendant::alternative/transition";
choose {
when "count($transitions) > 0"
apply "$transitions", 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»" ];
}
}