Browse Source

make sync.svg

doc_update_sequoia
Volker Birk 6 years ago
parent
commit
c4cdd0db98
4 changed files with 53 additions and 3 deletions
  1. +3
    -0
      .hgignore
  2. +10
    -1
      sync/Makefile
  3. +2
    -2
      sync/devicegroup.fsm
  4. +38
    -0
      sync/gen_dot.ysl2

+ 3
- 0
.hgignore View File

@ -41,3 +41,6 @@ test/msg_encrypt_for_self.asc
tags
asn.1/pEpEngineASN1/pEpEngineASN1.vcxproj.user
src/sync_fsm.c
*.xml
*.dot
*.svg

+ 10
- 1
sync/Makefile View File

@ -13,4 +13,13 @@ skeleton: .skeletons
.PHONY: clean
clean:
rm -f *.xml *.xsl ../src/sync_fsm.* ../src/*.skeleton .statemachines .skeletons
rm -f *.xml *.xsl ../src/sync_fsm.* ../src/*.skeleton .statemachines .skeletons *.dot *.svg
%.xml: %.fsm
yml2c $< -o $@
%.dot: devicegroup.fsm gen_dot.ysl2
yml2proc -y gen_dot.ysl2 $<
%.svg: %.dot
dot -Tsvg -o $@ $<

+ 2
- 2
sync/devicegroup.fsm View File

@ -26,7 +26,7 @@ protocol DeviceGroup {
}
}
state Sole {
state Sole end=1 {
on KeyGen // injected by generate_keypair()
do sendBeacon;
on CannotDecrypt
@ -70,7 +70,7 @@ protocol DeviceGroup {
}
}
state Grouped {
state Grouped end=1 {
on Init
do enterGroup;
on KeyGen


+ 38
- 0
sync/gen_dot.ysl2 View File

@ -0,0 +1,38 @@
include yslt.yml2
tstylesheet {
template "protocol/fsm" document "{@filename}.dot", "text"
||
digraph finite_state_machine {
rankdir=LR;
node [shape = doublecircle];
`apply "state[@end='1']" mode=end`;
node [shape = circle];
`` apply "state" mode=do
}
||
template "state", mode=end > «@name»
template "state", mode=do apply "event", 0 with "state", "@name";
template "event" {
param "state";
choose {
when "count(transition) > 0"
apply "transition|condition/transition", 0
with "state", "$state", with "event", "@name";
otherwise
if "@name != 'Init'"
| «$state» -> «$state» [ label="«@name»" ];
}
}
template "transition" {
param "state";
param "event";
| «$state» -> «@target» [ label ="«$event»" ];
}
}

Loading…
Cancel
Save