sync/gen_dot.ysl2
author Dirk Zimmermann <dz@pep.security>
Tue, 09 Apr 2019 16:02:46 +0200
branchIOS-1482
changeset 3480 689c15d6bef7
parent 2829 e444c3c960bb
child 3809 d40dc7086275
permissions -rw-r--r--
IOS-1482 Xcode: Change organization name.
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 include yslt.yml2
     5 
     6 tstylesheet {
     7     template "protocol/fsm" document "{@name}.dot", "text"
     8     ||
     9     digraph finite_state_machine {
    10         rankdir=LR;
    11         node [shape = doublecircle];
    12         `apply "state[@end='1']" mode=end`;
    13         node [shape = circle];
    14 
    15         `` apply "state" mode=do
    16     }
    17     ||
    18 
    19     template "state", mode=end > «@name» 
    20     template "state", mode=do apply "event", 0 with "state", "@name";
    21 
    22     template "event" {
    23         param "state";
    24         choose {
    25             when "count(transition) > 0"
    26                 apply "transition|condition/transition", 0
    27                     with "state", "$state", with "event", "@name";
    28             otherwise
    29                 if "@name != 'Init'"
    30                     | «$state» -> «$state» [ label="«@name»" ];
    31         }
    32     }
    33 
    34     template "transition" {
    35         param "state";
    36         param "event";
    37 
    38         | «$state» -> «@target» [ label ="«$event»" ];
    39     }
    40 }
    41