[Cbor] 0.8.19: .abnfb too (Re: cddl 0.8.17: Add .abnf (draft-ietf-cbor-cddl-control))

Carsten Bormann <cabo@tzi.org> Fri, 26 February 2021 10:53 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 4FE1A3A12D8 for <cbor@ietfa.amsl.com>; Fri, 26 Feb 2021 02:53:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.102
X-Spam-Level:
X-Spam-Status: No, score=0.102 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H1dHEUfh48EH for <cbor@ietfa.amsl.com>; Fri, 26 Feb 2021 02:53:37 -0800 (PST)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 81FD73A12D4 for <cbor@ietf.org>; Fri, 26 Feb 2021 02:53:37 -0800 (PST)
Received: from [192.168.217.118] (p5089a828.dip0.t-ipconnect.de [80.137.168.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4Dn62l2Rdjzyms; Fri, 26 Feb 2021 11:53:35 +0100 (CET)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <AC771EE9-9672-4B2D-B66A-2C815D102687@tzi.org>
Date: Fri, 26 Feb 2021 11:53:34 +0100
Cc: Paul Kyzivat <pkyzivat@alum.mit.edu>
X-Mao-Original-Outgoing-Id: 636029614.854709-ca51f1f6f97c9cd0df9cd21e01d6e7f7
Content-Transfer-Encoding: quoted-printable
Message-Id: <E0A35B5A-AC1B-4DF0-8A50-1553AA45A962@tzi.org>
References: <AC771EE9-9672-4B2D-B66A-2C815D102687@tzi.org>
To: cbor@ietf.org
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/pQufGRjwgFPhqpyIvQMwivl97WI>
Subject: [Cbor] 0.8.19: .abnfb too (Re: cddl 0.8.17: Add .abnf (draft-ietf-cbor-cddl-control))
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
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: Fri, 26 Feb 2021 10:53:41 -0000

0.8.19 now implements .anbfb as well.

You can now do seriously weird things such as:


message = text .abnfb ("message" .cat rfc4505)

rfc4505 = '
message     = [ email / token ]
              ;; to be prepared in accordance with Section 3

UTF1        = %x00-3F / %x41-7F ;; less "@" (U+0040)
UTF2        = %xC2-DF UTF0
UTF3        = %xE0 %xA0-BF UTF0 / %xE1-EC 2(UTF0) /
              %xED %x80-9F UTF0 / %xEE-EF 2(UTF0)
UTF4        = %xF0 %x90-BF 2(UTF0) / %xF1-F3 3(UTF0) /
              %xF4 %x80-8F 2(UTF0)
UTF0        = %x80-BF

TCHAR       = UTF1 / UTF2 / UTF3 / UTF4
              ;; any UTF-8 encoded Unicode character
              ;; except "@" (U+0040)

email        = "too@much.work"work"; for this example
;email       = addr-spec
              ;; as defined in [IMAIL]

token       = 1*255TCHAR
'


or


oid = bytes .abnfb ("oid" .cat cbor-tags-oid)

cbor-tags-oid = '
oid = 1*arc
roid = *arc
arc = [nlsb] %x00-7f
nlsb = %x81-ff *%x80-ff
‘

Enjoy!

Grüße, Carsten