sync/gen_dot.ysl2
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Wed, 16 Oct 2019 16:35:08 +0200
branchENGINE-654
changeset 4118 b0995cc07d02
parent 3825 b8d55cc4755e
permissions -rw-r--r--
merged in sync
     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=point];
    12         InitState;
    13         node [shape=doublecircle];
    14         End;
    15         node [shape=circle, style=filled, fillcolor=lightgrey];
    16 
    17         `` apply "descendant::transition";
    18     }
    19     ||
    20 
    21     template "transition" {
    22         const "event", "ancestor::event/@name";
    23         choose {
    24             when "ancestor::fsm/message[@name=$event]"
    25                 | «ancestor::state/@name» -> «@target» [ label="«ancestor::event/@name»", color=blue ];
    26             otherwise
    27                 | «ancestor::state/@name» -> «@target» [ label="«ancestor::event/@name»", color=red ];
    28         }
    29     }
    30 }
    31