sync/fsm.yml2
author Neal H. Walfield <neal@pep.foundation>
Wed, 08 May 2019 12:20:37 +0200
branchemail_comparison
changeset 3649 1dd837adc30b
parent 2909 13da9af3bd4f
child 4260 a5d462cd4724
permissions -rw-r--r--
Fix public key.
     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, threshold=10);
    15 
    16 // each protocol in a family has a finite state machine
    17 
    18 decl fsm @name (id, threshold=10);
    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=on);
    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 decl else;
    50 
    51 // some events have messages on the line signalling the event to the
    52 // communication partner
    53 
    54 decl message @name (id, type=anycast, security=trusted);
    55 
    56 // messages can have transmitted fields…
    57 
    58 decl field @type @name;
    59 
    60 // … or automatically calculated fields…
    61 
    62 decl auto < field >;
    63