distinct
authorVolker Birk <vb@pep-project.org>
Tue, 10 May 2016 10:00:50 +0200
changeset 58099cd18ba8a1b
parent 579 99a3e946928a
child 581 fdfcb223d56b
distinct
sync/gen_statemachine.ysl2
     1.1 --- a/sync/gen_statemachine.ysl2	Thu May 05 14:21:40 2016 +0200
     1.2 +++ b/sync/gen_statemachine.ysl2	Tue May 10 10:00:50 2016 +0200
     1.3 @@ -19,17 +19,17 @@
     1.4      } fsm_error;
     1.5  
     1.6      typedef enum _«@name»_state {
     1.7 -    `` apply "state", mode=declare
     1.8 +    `` for "set:distinct(state/@name)" |> «.»`if "position()!=last()" > , `
     1.9      } «@name»_state;
    1.10  
    1.11      typedef enum _«@name»_event {
    1.12 -    `` apply "state/event", mode=declare
    1.13 +    `` for "set:distinct(state/event/@name)" |> «.»`if "position()!=last()" > , `
    1.14      } «@name»_event;
    1.15  
    1.16      «@name»_state fsm_«@name»(«@name»_state state, «@name»_event event)
    1.17      {
    1.18          switch (state) {
    1.19 -            `` apply "state", mode=implement
    1.20 +            `` apply "state"
    1.21              default:
    1.22                  return invalid_state;
    1.23          }
    1.24 @@ -37,10 +37,7 @@
    1.25  
    1.26      ||
    1.27  
    1.28 -    template "state", mode=declare
    1.29 -        | «@name»`if "position()!=last()" > , `
    1.30 -
    1.31 -    template "state", mode=implement
    1.32 +    template "state"
    1.33      ||
    1.34      case «@name»:
    1.35          switch (event) {
    1.36 @@ -52,9 +49,6 @@
    1.37  
    1.38      ||
    1.39  
    1.40 -    template "event", mode=declare
    1.41 -        | «@name»`if "position()!=last()" > , `
    1.42 -
    1.43      template "event"
    1.44      ||
    1.45      case «@name»: