sync/gen_dot.ysl2
author Krista Grothoff <krista@pep-project.org>
Tue, 13 Dec 2016 14:54:00 +0100
branchENGINE-152
changeset 1483 65bf8eef6d70
parent 1409 e9bcd6142d54
child 1513 e7f7e42385b5
permissions -rw-r--r--
ENGINE-152 ENGINE-153 ENGINE-74 ENGINE-118: commits held in ENGINE-152 until Patrick gives the OK. REQUIRES UPDATE TO LIBETPAN.
vb@1409
     1
include yslt.yml2
vb@1409
     2
vb@1409
     3
tstylesheet {
vb@1409
     4
    template "protocol/fsm" document "{@filename}.dot", "text"
vb@1409
     5
    ||
vb@1409
     6
    digraph finite_state_machine {
vb@1409
     7
        rankdir=LR;
vb@1409
     8
        node [shape = doublecircle];
vb@1409
     9
        `apply "state[@end='1']" mode=end`;
vb@1409
    10
        node [shape = circle];
vb@1409
    11
vb@1409
    12
        `` apply "state" mode=do
vb@1409
    13
    }
vb@1409
    14
    ||
vb@1409
    15
vb@1409
    16
    template "state", mode=end > «@name» 
vb@1409
    17
    template "state", mode=do apply "event", 0 with "state", "@name";
vb@1409
    18
vb@1409
    19
    template "event" {
vb@1409
    20
        param "state";
vb@1409
    21
        choose {
vb@1409
    22
            when "count(transition) > 0"
vb@1409
    23
                apply "transition|condition/transition", 0
vb@1409
    24
                    with "state", "$state", with "event", "@name";
vb@1409
    25
            otherwise
vb@1409
    26
                if "@name != 'Init'"
vb@1409
    27
                    | «$state» -> «$state» [ label="«@name»" ];
vb@1409
    28
        }
vb@1409
    29
    }
vb@1409
    30
vb@1409
    31
    template "transition" {
vb@1409
    32
        param "state";
vb@1409
    33
        param "event";
vb@1409
    34
vb@1409
    35
        | «$state» -> «@target» [ label ="«$event»" ];
vb@1409
    36
    }
vb@1409
    37
}
vb@1409
    38