sync/gen_statemachine.ysl2
changeset 583 2392a33ae121
parent 582 fa50f202b57c
child 589 bdff8843f086
     1.1 --- a/sync/gen_statemachine.ysl2	Tue May 10 10:32:47 2016 +0200
     1.2 +++ b/sync/gen_statemachine.ysl2	Tue May 10 10:41:13 2016 +0200
     1.3 @@ -13,21 +13,31 @@
     1.4  
     1.5      #include "pEpEngine.h"
     1.6  
     1.7 +    // error values
     1.8 +
     1.9      typedef enum _fsm_error {
    1.10          invalid_state = -1,
    1.11          invalid_event = -2
    1.12      } fsm_error;
    1.13  
    1.14 +    // states
    1.15 +
    1.16      typedef enum _«@name»_state {
    1.17      `` for "set:distinct(state/@name)" |> «.»`if "position()!=last()" > , `
    1.18      } «@name»_state;
    1.19  
    1.20 +    // events
    1.21 +
    1.22      typedef enum _«@name»_event {
    1.23      `` for "set:distinct(state/event/@name)" |> «.»`if "position()!=last()" > , `
    1.24      } «@name»_event;
    1.25  
    1.26 +    // actions
    1.27 +
    1.28      `` for "set:distinct(state/event//action/@name)" | void «.»(pEp_identity *partner);
    1.29  
    1.30 +    // state machine
    1.31 +
    1.32      «@name»_state fsm_«@name»(
    1.33              «@name»_state state,
    1.34              «@name»_event event,