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