sync/gen_statemachine.ysl2
author Volker Birk <vb@pep-project.org>
Thu, 05 May 2016 13:46:01 +0200
changeset 577 26ebb2727295
child 578 b313077e13f2
permissions -rw-r--r--
generator sample of no use
vb@577
     1
// generate state machine code
vb@577
     2
vb@577
     3
// Copyleft (c) 2016, p≡p foundation
vb@577
     4
vb@577
     5
// Written by Volker Birk
vb@577
     6
vb@577
     7
include yslt.yml2
vb@577
     8
vb@577
     9
tstylesheet {
vb@577
    10
    template "/protocol/fsm"
vb@577
    11
    ||
vb@577
    12
    // state machine for «@name»
vb@577
    13
vb@577
    14
    #include "pEpEngine.h"
vb@577
    15
vb@577
    16
vb@577
    17
    void sm_«@name»(«@name»_state state)
vb@577
    18
    {
vb@577
    19
        switch (state) {
vb@577
    20
            `` apply "state"
vb@577
    21
        }
vb@577
    22
    }
vb@577
    23
vb@577
    24
    ||
vb@577
    25
vb@577
    26
    template "state"
vb@577
    27
    ||
vb@577
    28
    case «@name»:
vb@577
    29
        // bla
vb@577
    30
        break;
vb@577
    31
vb@577
    32
    ||
vb@577
    33
}
vb@577
    34
vb@577
    35