sync/gen_messages.ysl2
branchsync
changeset 2864 dcbed0d35466
parent 2831 be6623599adb
child 3509 a9c0c6f31c56
     1.1 --- a/sync/gen_messages.ysl2	Fri Aug 17 21:28:43 2018 +0200
     1.2 +++ b/sync/gen_messages.ysl2	Tue Aug 21 17:35:00 2018 +0200
     1.3 @@ -17,78 +17,81 @@
     1.4      function "pEp_imports"
     1.5          | IMPORTS Identity, IdentityList, TID, Hash FROM PEP;
     1.6  
     1.7 +    function "header"
     1.8 +    ||
     1.9 +    -- This file is under BSD License 2.0
    1.10 +
    1.11 +    -- «@name» protocol for p≡p
    1.12 +    -- Copyright (c) 2016-2018 p≡p foundation
    1.13 +
    1.14 +    -- Written by Volker Birk
    1.15 +
    1.16 +    ||
    1.17 +
    1.18      template "/" {
    1.19          apply "protocol", 0, mode=overview;
    1.20          apply "protocol/fsm", 0, mode=individual;
    1.21      }
    1.22  
    1.23      template "protocol", mode=overview
    1.24 -        document "generated/{yml:lcase(@name)}.asn1", "text"
    1.25 -    ||
    1.26 -    -- This file is under BSD License 2.0
    1.27 +        document "generated/{yml:lcase(@name)}.asn1", "text" {
    1.28  
    1.29 -    -- «@name» protocol stack for p≡p
    1.30 -    -- Copyright (c) 2016, 2017 p≡p foundation
    1.31 +        call "header";
    1.32 +        ||
    1.33 +        «yml:ucase(@name)»
    1.34 +            { iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) «yml:lcase(@name)»(«@id») }
    1.35  
    1.36 -    -- Written by Volker Birk
    1.37 +        DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
    1.38  
    1.39 -    «yml:ucase(@name)»
    1.40 -        { iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) «yml:lcase(@name)»(«@id») }
    1.41 +        BEGIN
    1.42  
    1.43 -    DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
    1.44 -
    1.45 -    BEGIN
    1.46 -
    1.47 -    `` for "fsm" | IMPORTS «@name» FROM «yml:ucase(@name)»;
    1.48 +        `` for "fsm" | IMPORTS «@name» FROM «yml:ucase(@name)»;
    1.49  
    1.50 -    «@name» ::= CHOICE {
    1.51 -        `` for "fsm" |> «yml:lcase(@name)» [APPLICATION «@id»] «@name»`if "position()!=last()" > , `
    1.52 -    }
    1.53 +        «@name» ::= CHOICE {
    1.54 +            `` for "fsm" |> «yml:lcase(@name)» [APPLICATION «@id»] «@name»`if "position()!=last()" > , `
    1.55 +        }
    1.56  
    1.57 -    END
    1.58 +        END
    1.59  
    1.60 -    ||
    1.61 +        ||
    1.62 +    }
    1.63  
    1.64      template "fsm", mode=individual
    1.65 -        document "generated/{yml:lcase(@name)}.asn1", "text"
    1.66 -    ||
    1.67 -    -- This file is under BSD License 2.0
    1.68 +        document "generated/{yml:lcase(@name)}.asn1", "text" {
    1.69  
    1.70 -    -- «@name» protocol for p≡p version «version/@major».«version/@minor»
    1.71 -    -- Copyright (c) 2016, 2017 p≡p foundation
    1.72 -
    1.73 -    -- Written by Volker Birk
    1.74 +        call "header";
    1.75 +        ||
    1.76 +        «yml:ucase(@name)»
    1.77 +            { iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) «yml:lcase(../@name)»(«../@id») «yml:lcase(@name)»(«@id») }
    1.78  
    1.79 -    «yml:ucase(@name)»
    1.80 -        { iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) «yml:lcase(../@name)»(«../@id») «yml:lcase(@name)»(«@id») }
    1.81 -
    1.82 -    DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
    1.83 +        DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
    1.84  
    1.85 -    BEGIN
    1.86 +        BEGIN
    1.87  
    1.88 -    EXPORTS «@name»;
    1.89 -    `` call "pEp_imports"
    1.90 +        EXPORTS «@name»;
    1.91 +        `` call "pEp_imports"
    1.92  
    1.93 -    Version ::= SEQUENCE {
    1.94 -        major INTEGER (0..255) DEFAULT «version/@major»,
    1.95 -        minor INTEGER (0..255) DEFAULT «version/@minor»
    1.96 -    }
    1.97 +        Version ::= SEQUENCE {
    1.98 +            major INTEGER (0..255) DEFAULT «version/@major»,
    1.99 +            minor INTEGER (0..255) DEFAULT «version/@minor»
   1.100 +        }
   1.101  
   1.102 -    `` apply "message", 0, mode=impl;
   1.103 -    «@name» ::= SEQUENCE {
   1.104 -        header SEQUENCE {
   1.105 -            sequence INTEGER  -- always increases
   1.106 -        },
   1.107 +        `` apply "message", 0, mode=impl;
   1.108 +        «@name» ::= SEQUENCE {
   1.109 +            header SEQUENCE {
   1.110 +                sequence INTEGER  -- always increases
   1.111 +            },
   1.112  
   1.113 -        payload CHOICE {
   1.114 -        `` for "message" |>> «yml:mixedCase(@name)» [APPLICATION «@id»] «@name»`if "position()!=last()" > ,`
   1.115 +            payload CHOICE {
   1.116 +            `` for "message" |>> «yml:mixedCase(@name)» [APPLICATION «@id»] «@name»`if "position()!=last()" > ,`
   1.117 +            }
   1.118          }
   1.119 +
   1.120 +        END
   1.121 +
   1.122 +        ||
   1.123      }
   1.124  
   1.125 -    END
   1.126 -
   1.127 -    ||
   1.128 -
   1.129      template "message", mode=impl
   1.130      ||
   1.131      «@name» ::= SEQUENCE {