merging
authorVolker Birk <vb@pep-project.org>
Thu, 12 May 2016 17:43:00 +0200
changeset 61228a7b63fa309
parent 611 d74ad0ae95c6
parent 610 1e3d39516f43
child 614 6bf3b8a6fb1b
merging
     1.1 --- a/sync/Makefile	Thu May 12 17:42:45 2016 +0200
     1.2 +++ b/sync/Makefile	Thu May 12 17:43:00 2016 +0200
     1.3 @@ -1,6 +1,9 @@
     1.4  ../src/sync_fsm.c: sync.fsm gen_statemachine.ysl2
     1.5  	yml2proc -y gen_statemachine.ysl2 $< -o $@
     1.6  
     1.7 +../src/sync_codec.c: sync.fsm gen_codec.ysl2
     1.8 +	yml2proc -y gen_codec.ysl2 $< -o $@
     1.9 +
    1.10  sync.xml: sync.fsm fsm.yml2
    1.11  	yml2proc -P sync.fsm -o sync.xml
    1.12  
     2.1 --- a/sync/gen_statemachine.ysl2	Thu May 12 17:42:45 2016 +0200
     2.2 +++ b/sync/gen_statemachine.ysl2	Thu May 12 17:43:00 2016 +0200
     2.3 @@ -8,9 +8,6 @@
     2.4  
     2.5  tstylesheet {
     2.6  
     2.7 -    key "ActionByNames", "/protocol/fsm/state/event//action", "@name";
     2.8 -    variable "UniqueActions", "/protocol/fsm/state/event//action[generate-id()=generate-id(key('ActionByNames',@name)[1])]";
     2.9 -
    2.10      template "/protocol/fsm" {
    2.11          document "../src/sync_fsm.h", "text"
    2.12          ||
    2.13 @@ -52,13 +49,6 @@
    2.14  
    2.15          void fsm_«@name»_inject(PEP_SESSION session, «@name»_event event);
    2.16  
    2.17 -        // decoders
    2.18 -
    2.19 -        `` apply "$UniqueActions[starts-with(@name,'send')]",0 mode="proto" with "pfx", "'decode'"
    2.20 -
    2.21 -        // encoders 
    2.22 -
    2.23 -        `` apply "$UniqueActions[starts-with(@name,'send')]",0 mode="proto" with "pfx", "'encode'"
    2.24          ||
    2.25          ||
    2.26          #include "sync_fsm.h"
    2.27 @@ -112,23 +102,6 @@
    2.28          > );\n
    2.29      }
    2.30  
    2.31 -    def "xsl:typeOfActionParam" {
    2.32 -        param "n", "name(.)";
    2.33 -        result "name(ancestor::event/child::parm[child::*[position()=2 and name(.)=$n]]/child::*[position()=1])";
    2.34 -    }
    2.35 -
    2.36 -    template "action", mode="proto" {
    2.37 -        param "pfx";
    2.38 -        > void «$pfx»«substring-after(@name, 'send')»(
    2.39 -        if "count(parm/*) = 0"
    2.40 -            > void
    2.41 -        for "set:distinct(parm/*)" {
    2.42 -            > «xsl:typeOfActionParam()» «name(.)»
    2.43 -            if "position() != last()" > ,
    2.44 -        }
    2.45 -        | );
    2.46 -    }
    2.47 -
    2.48      template "transition" | return «@target»;
    2.49  }
    2.50