sync/gen_messages.ysl2
author Neal H. Walfield <neal@pep.foundation>
Wed, 08 May 2019 12:20:37 +0200
branchemail_comparison
changeset 3649 1dd837adc30b
parent 3552 12acabcf550f
child 4253 64ff1db68934
permissions -rw-r--r--
Fix public key.
vb@2831
     1
// This file is under GNU General Public License 3.0
vb@2831
     2
// see LICENSE.txt
vb@2831
     3
// generated files of this template are under BSD License 2.0
vb@2831
     4
vb@2831
     5
// generate message functions
vb@2831
     6
vb@3512
     7
// Copyleft (c) 2017-2019, p≡p foundation
vb@2831
     8
vb@2831
     9
// Written by Volker Birk
vb@2831
    10
vb@2831
    11
include yslt.yml2
vb@2831
    12
vb@2831
    13
tstylesheet {
vb@2831
    14
    include standardlib.ysl2
vb@2831
    15
    include ./functions.ysl2
vb@2831
    16
vb@2831
    17
    function "pEp_imports"
vb@2831
    18
        | IMPORTS Identity, IdentityList, TID, Hash FROM PEP;
vb@2831
    19
vb@2864
    20
    function "header"
vb@2864
    21
    ||
vb@2864
    22
    -- This file is under BSD License 2.0
vb@2864
    23
vb@2864
    24
    -- «@name» protocol for p≡p
vb@3552
    25
    -- Copyleft 2016-2019 by p≡p foundation
vb@2864
    26
vb@2864
    27
    -- Written by Volker Birk
vb@2864
    28
vb@2864
    29
    ||
vb@2864
    30
vb@2831
    31
    template "/" {
vb@2831
    32
        apply "protocol", 0, mode=overview;
vb@2831
    33
        apply "protocol/fsm", 0, mode=individual;
vb@2831
    34
    }
vb@2831
    35
vb@2831
    36
    template "protocol", mode=overview
vb@2864
    37
        document "generated/{yml:lcase(@name)}.asn1", "text" {
vb@2831
    38
vb@2864
    39
        call "header";
vb@2864
    40
        ||
vb@2864
    41
        «yml:ucase(@name)»
vb@2864
    42
            { iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) «yml:lcase(@name)»(«@id») }
vb@2831
    43
vb@2864
    44
        DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
vb@2831
    45
vb@2864
    46
        BEGIN
vb@2831
    47
vb@2864
    48
        `` for "fsm" | IMPORTS «@name» FROM «yml:ucase(@name)»;
vb@2831
    49
vb@2864
    50
        «@name» ::= CHOICE {
vb@2864
    51
            `` for "fsm" |> «yml:lcase(@name)» [APPLICATION «@id»] «@name»`if "position()!=last()" > , `
vb@2864
    52
        }
vb@2831
    53
vb@2864
    54
        END
vb@2831
    55
vb@2864
    56
        ||
vb@2831
    57
    }
vb@2831
    58
vb@2864
    59
    template "fsm", mode=individual
vb@2864
    60
        document "generated/{yml:lcase(@name)}.asn1", "text" {
vb@2831
    61
vb@2864
    62
        call "header";
vb@2864
    63
        ||
vb@2864
    64
        «yml:ucase(@name)»
vb@2864
    65
            { iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) «yml:lcase(../@name)»(«../@id») «yml:lcase(@name)»(«@id») }
vb@2831
    66
vb@2864
    67
        DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
vb@2831
    68
vb@2864
    69
        BEGIN
vb@2831
    70
vb@2864
    71
        EXPORTS «@name»;
vb@2864
    72
        `` call "pEp_imports"
vb@2831
    73
vb@2864
    74
        Version ::= SEQUENCE {
vb@2864
    75
            major INTEGER (0..255) DEFAULT «version/@major»,
vb@2864
    76
            minor INTEGER (0..255) DEFAULT «version/@minor»
vb@2864
    77
        }
vb@2831
    78
vb@2864
    79
        `` apply "message", 0, mode=impl;
vb@3509
    80
        «@name» ::= CHOICE {
vb@3509
    81
        `` for "message" |> «yml:mixedCase(@name)» [APPLICATION «@id»] «@name»`if "position()!=last()" > ,`
vb@2864
    82
        }
vb@2831
    83
vb@2864
    84
        END
vb@2831
    85
vb@2864
    86
        ||
vb@2831
    87
    }
vb@2831
    88
vb@2831
    89
    template "message", mode=impl
vb@2831
    90
    ||
vb@2831
    91
    «@name» ::= SEQUENCE {
vb@2831
    92
    `` for "field|auto" |> «func:asn1name()» «func:asn1type()»`if "position()!=last()" > ,`
vb@2831
    93
    }
vb@2831
    94
vb@2831
    95
    ||
vb@2831
    96
}
vb@2831
    97