sync/gen_statemachine.ysl2
changeset 711 d88dea0f5448
parent 690 3ae86b68fdfe
child 743 e4b613ebac2f
     1.1 --- a/sync/gen_statemachine.ysl2	Sun May 29 14:35:39 2016 +0200
     1.2 +++ b/sync/gen_statemachine.ysl2	Thu Jun 02 13:46:38 2016 +0200
     1.3 @@ -10,7 +10,7 @@
     1.4      include ./functions.ysl2
     1.5  
     1.6      template "/protocol/fsm" {
     1.7 -        document "../src/sync_fsm.h", "text"
     1.8 +        document "../src/sync_fsm.h", "text" {
     1.9          ||
    1.10          #pragma once
    1.11  
    1.12 @@ -45,7 +45,14 @@
    1.13  
    1.14          typedef enum _«@name»_event {
    1.15              «@name»_event_NONE = 0,
    1.16 -        `` for "func:distinctName(state/event)" |> «@name»`if "position()!=last()" > , `
    1.17 +        ||
    1.18 +        for "func:distinctName(state/event[not(not(/protocol/fsm/tag/@name=@name))])" {
    1.19 +            const "name", "@name";
    1.20 +            |> «$name» = «/protocol/fsm/tag[@name=$name]/@id»,
    1.21 +        }
    1.22 +        for "func:distinctName(state/event[not(/protocol/fsm/tag/@name=@name)])"
    1.23 +            |> «@name»`if "position()!=last()" > , `
    1.24 +        ||
    1.25          } «@name»_event;
    1.26  
    1.27          // actions
    1.28 @@ -77,6 +84,7 @@
    1.29          #endif
    1.30  
    1.31          ||
    1.32 +        }
    1.33          document "../src/sync_driver.c", "text"
    1.34          ||
    1.35          // Driver for «@name» state machine