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
     1 // generate state machine code
     2 
     3 // Copyleft (c) 2016, p≡p foundation
     4 
     5 // Written by Volker Birk
     6 
     7 include yslt.yml2
     8 
     9 tstylesheet {
    10     template "/protocol/fsm"
    11     ||
    12     // state machine for «@name»
    13 
    14     #include "pEpEngine.h"
    15 
    16 
    17     void sm_«@name»(«@name»_state state)
    18     {
    19         switch (state) {
    20             `` apply "state"
    21         }
    22     }
    23 
    24     ||
    25 
    26     template "state"
    27     ||
    28     case «@name»:
    29         // bla
    30         break;
    31 
    32     ||
    33 }
    34 
    35