Re: [Cbor] CDDL 2.0 import and paths
Carsten Bormann <cabo@tzi.org> Thu, 02 March 2023 17:36 UTC
Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4E0ACC13A35A for <cbor@ietfa.amsl.com>; Thu, 2 Mar 2023 09:36:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.899
X-Spam-Level:
X-Spam-Status: No, score=-6.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BjL_CKjYMCSc for <cbor@ietfa.amsl.com>; Thu, 2 Mar 2023 09:36:27 -0800 (PST)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [134.102.50.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BF616C13A356 for <cbor@ietf.org>; Thu, 2 Mar 2023 09:36:25 -0800 (PST)
Received: from [192.168.217.124] (p548dc9a4.dip0.t-ipconnect.de [84.141.201.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4PSJDk5tZXzDCdJ; Thu, 2 Mar 2023 18:36:22 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <799E5143-965F-425A-8A2B-B8FF0AE44A32@tzi.org>
Date: Thu, 02 Mar 2023 18:36:22 +0100
X-Mao-Original-Outgoing-Id: 699471382.19175-a8d4e319f599d39333417ef09817fb27
Content-Transfer-Encoding: quoted-printable
Message-Id: <DA0E9209-FE56-4852-93EA-AB5AC33E0FD1@tzi.org>
References: <Y9FYSKde6bXgzep3@hephaistos.amsuess.com> <BAFC97D5-3B5A-4ED5-ADEC-93CB53CC2128@tzi.org> <799E5143-965F-425A-8A2B-B8FF0AE44A32@tzi.org>
To: cbor@ietf.org
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/S1iG6ES8E6JrOHqi2F_Ru7CGUzg>
Subject: Re: [Cbor] CDDL 2.0 import and paths
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Mar 2023 17:36:30 -0000
On 2023-02-06, at 21:04, Carsten Bormann <cabo@tzi.org> wrote:
>
>> ;# import rfc9052 as COSE
>>
>> which would rename the names in the imported rules to start with COSE(*).
>
> This is now implemented in cddlc 0.1.3.
We had a great CDDL2 Design Team meeting this morning.
Before I implement what we discussed there, I think I should be publishing some other recent code:
$ cddlc -2tcddl -icose=rfc9052 -scose.COSE_Key
➔
$.start.$ = cose.COSE_Key
cose.COSE_Key = {
1 => tstr / int,
? 2 => bstr,
? 3 => tstr / int,
? 4 => [+ tstr / int],
? 5 => bstr,
* cose.label => cose.values,
}
cose.label = int / tstr
cose.values = any
So what did this do? Let’s try verbose mode and ignore the actual output:
$ cddlc -v -2tcddl -icose=rfc9052 -scose.COSE_Key >/dev/null
::: generated from options:
$.start.$ = cose.COSE_Key ;; the -s option
;# import rfc9052 as cose ;; the -i option
:::
** IMPORTING rfc9052.cddl
IMPORTED cose.COSE_Key from rfc9052.cddl
IMPORTED cose.label from rfc9052.cddl
IMPORTED cose.values from rfc9052.cddl
… well, OK, I added my own comments “;;” up there.
Help text:
$ cddlc
Usage: cddlc.rb [options] file.cddl
[…]
-s, --start=RULE Start rule name
-i, --import=IMPORT Import [namespace=]reference
-I, --include=INCLUDE Include [namespace=]reference
Now in cddlc 0.1.4. Get it with
gem update cddlc
Grüße, Carsten
- [Cbor] CDDL 2.0 import and paths Christian Amsüss
- Re: [Cbor] CDDL 2.0 import and paths Michael Richardson
- Re: [Cbor] CDDL 2.0 import and paths Carsten Bormann
- Re: [Cbor] CDDL 2.0 import and paths Michael Richardson
- Re: [Cbor] CDDL 2.0 import and paths Carsten Bormann
- Re: [Cbor] CDDL 2.0 import and paths Michael Richardson
- Re: [Cbor] CDDL 2.0 import and paths Jeremy O'Donoghue
- Re: [Cbor] CDDL 2.0 import and paths Carsten Bormann
- Re: [Cbor] CDDL 2.0 import and paths Carsten Bormann
- Re: [Cbor] CDDL 2.0 import and paths Michael Richardson
- Re: [Cbor] CDDL 2.0 import and paths Carsten Bormann
- Re: [Cbor] CDDL 2.0 import and paths Carsten Bormann
- Re: [Cbor] CDDL 2.0 import and paths Carsten Bormann