sync/fsm.yml2
author Volker Birk <vb@pep.foundation>
Wed, 29 Aug 2018 21:49:28 +0200
branchsync
changeset 2903 33549a7c7191
parent 2877 70189b383730
child 2907 92f22b19b09e
permissions -rw-r--r--
safeguards
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 // FSM Y language 1.2
     5 
     6 // Copyleft (c) 2016, 2017, p≡p foundation
     7 
     8 // Written by Volker Birk
     9 
    10 decl version(major, minor);
    11 
    12 // a protocol family has a name and an ID
    13 
    14 decl protocol @name (id);
    15 
    16 // each protocol in a family has a finite state machine
    17 
    18 decl fsm< protocol >;
    19 
    20 // a state has a name and a timeout; after the timeout the state machine will
    21 // be reset
    22 
    23 decl state @name (timeout=0);
    24 
    25 // events have names
    26 
    27 decl event @name, on is event;
    28 
    29 // external events can have IDs
    30 
    31 decl external @name (id);
    32 
    33 // a transistion moves the statemachine to another state
    34 
    35 decl transition @target, go is transition;
    36 
    37 // an action is executed; if an action name starts with 'send' then it is
    38 // sending a message
    39 
    40 decl action @name, do is action;
    41 
    42 // send network messages
    43 
    44 decl send @name;
    45 
    46 // a condition is for different cases
    47 
    48 decl condition @name, if is condition;
    49 
    50 // some events have messages on the line signalling the event to the
    51 // communication partner
    52 
    53 decl message @name (id, type="anycast", security="trusted");
    54 
    55 // messages can have transmitted fields…
    56 
    57 decl field @type @name;
    58 
    59 // … or automatically calculated fields…
    60 
    61 decl auto < field >;
    62