<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.4 (Ruby 3.2.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-cbor-update-8610-grammar-01" category="std" consensus="true" submissionType="IETF" updates="8610" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.18.2 -->
  <front>
    <title abbrev="CDDL grammar updates">Updates to the CDDL grammar of RFC 8610</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-cbor-update-8610-grammar-01"/>
    <author initials="C." surname="Bormann" fullname="Carsten Bormann">
      <organization>Universität Bremen TZI</organization>
      <address>
        <postal>
          <street>Postfach 330440</street>
          <city>Bremen</city>
          <code>D-28359</code>
          <country>Germany</country>
        </postal>
        <phone>+49-421-218-63921</phone>
        <email>cabo@tzi.org</email>
      </address>
    </author>
    <date year="2023" month="December" day="15"/>
    <area>ART</area>
    <workgroup>CBOR</workgroup>
    <keyword>Concise Data Definition Language</keyword>
    <abstract>
      <?line 68?>

<t>The Concise Data Definition Language (CDDL), as defined in
RFC 8610 and RFC 9165,
provides an easy and unambiguous way to express structures for
protocol messages and data formats that are represented in CBOR or
JSON.</t>
      <t>The present document updates RFC 8610 by addressing errata and making
other small fixes for the ABNF grammar defined for CDDL there.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://cbor-wg.github.io/update-8610-grammar/"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-cbor-update-8610-grammar/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        CBOR Working Group mailing list (<eref target="mailto:cbor@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/cbor/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/cbor/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/cbor-wg/update-8610-grammar"/>.</t>
    </note>
  </front>
  <middle>
    <?line 79?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>The Concise Data Definition Language (CDDL), as defined in
<xref target="RFC8610"/> and <xref target="RFC9165"/>,
provides an easy and unambiguous way to express structures for
protocol messages and data formats that are represented in CBOR or
JSON.</t>
      <t>The present document updates <xref target="RFC8610"/> by addressing errata and making
other small fixes for the ABNF grammar defined for CDDL there.</t>
      <section anchor="conventions-and-definitions">
        <name>Conventions and Definitions</name>
        <t>The Terminology from <xref target="RFC8610"/> applies.
The grammar in <xref target="RFC8610"/> is based on ABNF, which is defined in <xref target="STD68"/>
and <xref target="RFC7405"/>.</t>
      </section>
    </section>
    <section anchor="clari">
      <name>Clarifications and Changes based on Errata Reports</name>
      <dl>
        <dt><em>Compatibility</em>:</dt>
        <dd>
          <t>errata fix</t>
        </dd>
      </dl>
      <t>A number of errata reports have been made around some details of text
string and byte string literal syntax: <xref target="Err6527"/> and <xref target="Err6543"/>.
These are being addressed in this section, updating details of the
ABNF for these literal syntaxes.
Also, <xref target="Err6526"/> needs to be applied (backslashes have been lost during
RFC processing in some text explaining backslash escaping).</t>
      <section anchor="e6527">
        <name>Err6527 (text string literals)</name>
        <t>The ABNF used in <xref target="RFC8610"/> for the content of text string literals
is rather permissive:</t>
        <figure anchor="e6527-old1">
          <name>Old ABNF for strings with permissive ABNF for SESC, but not allowing hex escapes</name>
          <sourcecode type="abnf"><![CDATA[
; RFC 8610 ABNF:
text = %x22 *SCHAR %x22
SCHAR = %x20-21 / %x23-5B / %x5D-7E / %x80-10FFFD / SESC
SESC = "\" (%x20-7E / %x80-10FFFD)
]]></sourcecode>
        </figure>
        <t>This allows almost any non-C0 character to be escaped by a backslash,
but critically misses out on the <tt>\uXXXX</tt> and <tt>\uHHHH\uLLLL</tt> forms
that JSON allows to specify characters in hex (which should be
applying here according to Bullet 6 of <xref section="3.1" sectionFormat="of" target="RFC8610"/>).
(Note that we import from JSON the unwieldy <tt>\uHHHH\uLLLL</tt> syntax,
which represents Unicode code points beyond U-FFFF by making them look
like UTF-16 surrogate pairs; CDDL text strings are not using UTF-16 or
surrogates.)</t>
        <t>Both can be solved by updating the SESC production to:</t>
        <figure anchor="e6527-new1">
          <name>Updated string ABNF to allow hex escapes</name>
          <sourcecode type="abnf" name="cddl-new-sesc.abnf"><![CDATA[
; new rules collectively defining SESC:
SESC = "\" ( %x22 / "/" / "\" /                 ; \" \/ \\
             %x62 / %x66 / %x6E / %x72 / %x74 / ; \b \f \n \r \t
             (%x75 hexchar) )                   ; \uXXXX
hexchar = non-surrogate / (high-surrogate "\" %x75 low-surrogate)
non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /
                ("D" %x30-37 2HEXDIG )
high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG
low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG
]]></sourcecode>
        </figure>
        <t>(Notes:
In ABNF, strings such as <tt>"A"</tt>, <tt>"B"</tt> etc. are case-insensitive, as is
intended here.
We could have written <tt>%x62</tt> as <tt>%s"b"</tt>, but didn't, in order to
maximize ABNF tool compatibility.)</t>
        <t>Now that SESC is more restrictively formulated, this also requires an
update to the BCHAR production used in the ABNF syntax for byte string
literals:</t>
        <figure anchor="e6527-old2">
          <name>Old ABNF for BCHAR</name>
          <sourcecode type="abnf"><![CDATA[
; RFC 8610 ABNF:
bytes = [bsqual] %x27 *BCHAR %x27
BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / CRLF
bsqual = "h" / "b64"
]]></sourcecode>
        </figure>
        <t>In BCHAR, the updated version explicitly allows <tt>\'</tt>, which is no
longer allowed in the updated SESC:</t>
        <figure anchor="e6527-new2">
          <name>Updated ABNF for BCHAR</name>
          <sourcecode type="abnf" name="cddl-new-bchar.abnf"><![CDATA[
; new rule for BCHAR:
BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / "\'" / CRLF
]]></sourcecode>
        </figure>
      </section>
      <section anchor="err6543-byte-string-literals">
        <name>Err6543 (byte string literals)</name>
        <t>The ABNF used in <xref target="RFC8610"/> for the content of byte string literals
lumps together byte strings notated as text with byte strings notated
in base16 (hex) or base64 (but see also updated BCHAR production above):</t>
        <figure anchor="e6527-old2a">
          <name>Old ABNF for BCHAR</name>
          <sourcecode type="abnf"><![CDATA[
; RFC 8610 ABNF:
bytes = [bsqual] %x27 *BCHAR %x27
BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / CRLF
]]></sourcecode>
        </figure>
        <section numbered="false" anchor="change-proposed-by-errata-report-6543">
          <name>Change proposed by Errata Report 6543</name>
          <t>Errata report 6543 proposes to handle the two cases in separate
productions (where, with an updated SESC, BCHAR obviously needs to be
updated as above):</t>
          <figure anchor="e6543-1">
            <name>Errata Report 8653 Proposal to Split the Byte String Rules</name>
            <sourcecode type="abnf"><![CDATA[
; Err6543 proposal:
bytes = %x27 *BCHAR %x27
      / bsqual %x27 *QCHAR %x27
BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / CRLF
QCHAR = DIGIT / ALPHA / "+" / "/" / "-" / "_" / "=" / WS
]]></sourcecode>
          </figure>
          <t>This potentially causes a subtle change, which is hidden in the WS production:</t>
          <figure anchor="e6543-2">
            <name>ABNF definition of WS from RFC 8610</name>
            <sourcecode type="abnf"><![CDATA[
; RFC 8610 ABNF:
WS = SP / NL
SP = %x20
NL = COMMENT / CRLF
COMMENT = ";" *PCHAR CRLF
PCHAR = %x20-7E / %x80-10FFFD
CRLF = %x0A / %x0D.0A
]]></sourcecode>
          </figure>
          <t>This allows any non-C0 character in a comment, so this fragment
becomes possible:</t>
          <sourcecode type="cddl"><![CDATA[
foo = h'
   43424F52 ; 'CBOR'
   0A       ; LF, but don't use CR!
'
]]></sourcecode>
          <t>The current text is not unambiguously saying whether the three apostrophes
need to be escaped with a <tt>\</tt> or not, as in:</t>
          <sourcecode type="cddl"><![CDATA[
foo = h'
   43424F52 ; \'CBOR\'
   0A       ; LF, but don\'t use CR!
'
]]></sourcecode>
          <t>... which would be supported by the existing ABNF in <xref target="RFC8610"/>.</t>
        </section>
        <section numbered="false" anchor="no-change-needed-after-addressing-e6527-section-e6527">
          <name>No change needed after addressing <xref format="title" target="e6527"/> (Section <xref format="counter" target="e6527"/>)</name>
          <t><cref anchor="headingbug">note that the HTML rendering of the heading is
butchered by xml2rfc, as noted in
https://github.com/ietf-tools/xml2rfc/issues/683; we except
this to have been fixed before this document is published</cref></t>
          <t>This document takes the simpler approach of leaving the processing of
the content of the byte string literal to a semantic step after
processing the syntax of the <tt>bytes</tt>/<tt>BCHAR</tt> rules as updated by
<xref target="e6527-new1"/> and <xref target="e6527-new2"/>.</t>
          <t>The rules in <xref target="e6543-2"/> are therefore applied to the result of this
processing where <tt>bsqual</tt> is given as <tt>h</tt> or <tt>b64</tt>.</t>
          <t>Note that this approach also works well with the use of byte strings
in <xref section="3" sectionFormat="of" target="RFC9165"/>.
It does require some care when copy-pasting into CDDL models from ABNF
that contains single quotes (which may also hide as apostrophes
in comments); these need to be escaped or possibly replaced by <tt>%x27</tt>.</t>
          <t>Finally, our approach would lend support to extending <tt>bsqual</tt> in CDDL
similar to the way this is done for CBOR diagnostic notation in <xref target="I-D.ietf-cbor-edn-literals"/>.</t>
        </section>
      </section>
    </section>
    <section anchor="small-enabling-grammar-changes">
      <name>Small Enabling Grammar Changes</name>
      <t>The two subsections in this section specify two small changes to the
grammar that are intended to enable certain kinds of specifications.</t>
      <section anchor="empty">
        <name>Empty data models</name>
        <dl spacing="compact">
          <dt><em>Compatibility</em>:</dt>
          <dd>
            <t>backward (not forward)</t>
          </dd>
        </dl>
        <t><xref target="RFC8610"/> requires a CDDL file to have at least one rule.</t>
        <figure anchor="empty-old">
          <name>Old ABNF for top-level rule cddl</name>
          <sourcecode type="abnf"><![CDATA[
; RFC 8610 ABNF:
cddl = S 1*(rule S)
]]></sourcecode>
        </figure>
        <t>This makes sense when the file has to stand alone, as a CDDL data
model needs to have at least one rule to provide an entry point (start
rule).</t>
        <t>With CDDL modules <xref target="I-D.ietf-cbor-cddl-modules"/>, CDDL files can also include directives,
and these might be the source of all the rules that
ultimately make up the module created by the file.
Any other rule content in the file has to be available for directive
processing, making the requirement for at least one rule cumbersome.</t>
        <t>Therefore, we extend the grammar as in <xref target="empty-new"/>
and make the existence of at least one rule a semantic constraint, to
be fulfilled after processing of all directives.</t>
        <figure anchor="empty-new">
          <name>Updated ABNF for top-level rule cddl</name>
          <sourcecode type="abnf" name="cddl-new-cddl.abnf"><![CDATA[
; new top-level rule:
cddl = S *(rule S)
]]></sourcecode>
        </figure>
      </section>
      <section anchor="tagnum">
        <name>Non-literal Tag Numbers</name>
        <dl spacing="compact">
          <dt><em>Compatibility</em>:</dt>
          <dd>
            <t>backward (not forward)</t>
          </dd>
        </dl>
        <t>The existing ABNF syntax for expressing tags in CDDL is:</t>
        <figure anchor="tag-old">
          <name>Old ABNF for tag syntax</name>
          <sourcecode type="abnf"><![CDATA[
; extracted from RFC 8610 ABNF:
type2 /= "#" "6" ["." uint] "(" S type S ")"
]]></sourcecode>
        </figure>
        <t>This means tag numbers can only be given as literal numbers (uints).
Some specifications operate on ranges of tag numbers, e.g., <xref target="RFC9277"/>
has a range of tag numbers 1668546817 (0x63740101) to 1668612095
(0x6374FFFF) to tag specific content formats.
This can currently not be expressed in CDDL.</t>
        <t>This update extends this to:</t>
        <figure anchor="tag-new">
          <name>Updated ABNF for tag syntax</name>
          <sourcecode type="abnf" name="cddl-new-tag.abnf"><![CDATA[
; new rules collectively defining the tagged case:
type2 /= "#" "6" ["." tag-number] "(" S type S ")"
tag-number = uint / ("<" type ">")
]]></sourcecode>
        </figure>
        <t>So the above range can be expressed in a CDDL fragment such as:</t>
        <sourcecode type="cddl"><![CDATA[
ct-tag<content> = #6.<ct-tag-number>(content)
ct-tag-number = 1668546817..1668612095
; or use 0x63740101..0x6374FFFF
]]></sourcecode>
        <t>Note that this syntax reuses the angle bracket syntax for generics;
this reuse is innocuous as a generic parameter/argument only ever
occurs after a rule name (<tt>id</tt>), while it occurs after <tt>.</tt> here.
(Whether there is potential for human confusion can be debated; the
above example deliberately uses generics as well.)</t>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>The grammar fixes and updates in this document are not believed to
create additional security considerations.
The security considerations in <xref section="5" sectionFormat="of" target="RFC8610"/> do apply, and
specifically the potential for confusion is increased in an
environment that uses a combination of CDDL tools some of which have
been updated and some of which have not been, in particular based on
<xref target="clari"/>.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC8610">
          <front>
            <title>Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures</title>
            <author fullname="H. Birkholz" initials="H." surname="Birkholz"/>
            <author fullname="C. Vigano" initials="C." surname="Vigano"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="June" year="2019"/>
            <abstract>
              <t>This document proposes a notational convention to express Concise Binary Object Representation (CBOR) data structures (RFC 7049). Its main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8610"/>
          <seriesInfo name="DOI" value="10.17487/RFC8610"/>
        </reference>
        <referencegroup anchor="STD68">
          <reference anchor="RFC5234" target="https://www.rfc-editor.org/info/rfc5234">
            <front>
              <title>Augmented BNF for Syntax Specifications: ABNF</title>
              <author fullname="D. Crocker" initials="D." role="editor" surname="Crocker"/>
              <author fullname="P. Overell" initials="P." surname="Overell"/>
              <date month="January" year="2008"/>
              <abstract>
                <t>Internet technical specifications often need to define a formal syntax. Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications. The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power. The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges. This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications. [STANDARDS-TRACK]</t>
              </abstract>
            </front>
            <seriesInfo name="STD" value="68"/>
            <seriesInfo name="RFC" value="5234"/>
            <seriesInfo name="DOI" value="10.17487/RFC5234"/>
          </reference>
        </referencegroup>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="RFC7405">
          <front>
            <title>Case-Sensitive String Support in ABNF</title>
            <author fullname="P. Kyzivat" initials="P." surname="Kyzivat"/>
            <date month="December" year="2014"/>
            <abstract>
              <t>This document extends the base definition of ABNF (Augmented Backus-Naur Form) to include a way to specify US-ASCII string literals that are matched in a case-sensitive manner.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7405"/>
          <seriesInfo name="DOI" value="10.17487/RFC7405"/>
        </reference>
        <reference anchor="RFC9165">
          <front>
            <title>Additional Control Operators for the Concise Data Definition Language (CDDL)</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="December" year="2021"/>
            <abstract>
              <t>The Concise Data Definition Language (CDDL), standardized in RFC 8610, provides "control operators" as its main language extension point.</t>
              <t>The present document defines a number of control operators that were not yet ready at the time RFC 8610 was completed:,, and for the construction of constants; / for including ABNF (RFC 5234 and RFC 7405) in CDDL specifications; and for indicating the use of a non-basic feature in an instance.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9165"/>
          <seriesInfo name="DOI" value="10.17487/RFC9165"/>
        </reference>
        <reference anchor="I-D.ietf-cbor-cddl-modules">
          <front>
            <title>CDDL Module Structure</title>
            <author fullname="Carsten Bormann" initials="C." surname="Bormann">
              <organization>Universität Bremen TZI</organization>
            </author>
            <date day="17" month="June" year="2023"/>
            <abstract>
              <t>   At the time of writing, the Concise Data Definition Language (CDDL)
   is defined by RFC 8610 and RFC 9165.  The latter has used the
   extension point provided in RFC 8610, the _control operator_.

   As CDDL is being used in larger projects, the need for corrections
   and additional features has become known that cannot be easily mapped
   into this single extension point.  Hence, there is a need for
   evolution of the base CDDL specification itself.

   The present document defines a backward- and forward-compatible way
   to add a module structure to CDDL.


   // Previous versions of the changes in this document were part of
   // draft-bormann-cbor-cddl-2-draft and previously draft-bormann-cbor-
   // cddl-freezer.  This submission extracts out the functionality that
   // is ready for further WG work.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-cbor-cddl-modules-00"/>
        </reference>
        <reference anchor="I-D.ietf-cbor-edn-literals">
          <front>
            <title>CBOR Extended Diagnostic Notation (EDN): Application-Oriented Literals, ABNF, and Media Type</title>
            <author fullname="Carsten Bormann" initials="C." surname="Bormann">
              <organization>Universität Bremen TZI</organization>
            </author>
            <date day="20" month="November" year="2023"/>
            <abstract>
              <t>   The Concise Binary Object Representation, CBOR (STD 94, RFC 8949),
   defines a "diagnostic notation" in order to be able to converse about
   CBOR data items without having to resort to binary data.

   This document specifies how to add application-oriented extensions to
   the diagnostic notation.  It then defines two such extensions for
   text representations of epoch-based date/times and of IP addresses
   and prefixes (RFC 9164).

   To facilitate tool interoperation, this document also specifies a
   formal ABNF definition for extended diagnostic notation (EDN) that
   accommodates application-oriented literals.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-cbor-edn-literals-06"/>
        </reference>
        <reference anchor="Err6526" target="https://www.rfc-editor.org/errata/eid6526">
          <front>
            <title>Errata Report 6526</title>
            <author>
              <organization/>
            </author>
            <date/>
          </front>
          <seriesInfo name="RFC" value="8610"/>
        </reference>
        <reference anchor="Err6527" target="https://www.rfc-editor.org/errata/eid6527">
          <front>
            <title>Errata Report 6527</title>
            <author>
              <organization/>
            </author>
            <date/>
          </front>
          <seriesInfo name="RFC" value="8610"/>
        </reference>
        <reference anchor="Err6543" target="https://www.rfc-editor.org/errata/eid6543">
          <front>
            <title>Errata Report 6543</title>
            <author>
              <organization/>
            </author>
            <date/>
          </front>
          <seriesInfo name="RFC" value="8610"/>
        </reference>
        <reference anchor="RFC9277">
          <front>
            <title>On Stable Storage for Items in Concise Binary Object Representation (CBOR)</title>
            <author fullname="M. Richardson" initials="M." surname="Richardson"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="August" year="2022"/>
            <abstract>
              <t>This document defines a stored ("file") format for Concise Binary Object Representation (CBOR) data items that is friendly to common systems that recognize file types, such as the Unix file(1) command.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9277"/>
          <seriesInfo name="DOI" value="10.17487/RFC9277"/>
        </reference>
      </references>
    </references>
    <?line 375?>

<section anchor="updated-collected-abnf-for-cddl">
      <name>Updated Collected ABNF for CDDL</name>
      <t>This appendix provides the full ABNF from <xref target="RFC8610"/> with the updates
applied in the present document.</t>
      <figure anchor="collected-abnf">
        <name>ABNF for CDDL as updated</name>
        <sourcecode type="abnf" name="cddl-updated-complete.abnf"><![CDATA[
cddl = S *(rule S)
rule = typename [genericparm] S assignt S type
     / groupname [genericparm] S assigng S grpent

typename = id
groupname = id

assignt = "=" / "/="
assigng = "=" / "//="

genericparm = "<" S id S *("," S id S ) ">"
genericarg = "<" S type1 S *("," S type1 S ) ">"

type = type1 *(S "/" S type1)

type1 = type2 [S (rangeop / ctlop) S type2]
; space may be needed before the operator if type2 ends in a name

type2 = value
      / typename [genericarg]
      / "(" S type S ")"
      / "{" S group S "}"
      / "[" S group S "]"
      / "~" S typename [genericarg]
      / "&" S "(" S group S ")"
      / "&" S groupname [genericarg]
      / "#" "6" ["." tag-number] "(" S type S ")"
      / "#" DIGIT ["." uint]                ; major/ai
      / "#"                                 ; any
tag-number = uint / ("<" type ">")


rangeop = "..." / ".."

ctlop = "." id

group = grpchoice *(S "//" S grpchoice)

grpchoice = *(grpent optcom)

grpent = [occur S] [memberkey S] type
       / [occur S] groupname [genericarg]  ; preempted by above
       / [occur S] "(" S group S ")"

memberkey = type1 S ["^" S] "=>"
          / bareword S ":"
          / value S ":"

bareword = id

optcom = S ["," S]

occur = [uint] "*" [uint]
      / "+"
      / "?"

uint = DIGIT1 *DIGIT
     / "0x" 1*HEXDIG
     / "0b" 1*BINDIG
     / "0"

value = number
      / text
      / bytes

int = ["-"] uint

; This is a float if it has fraction or exponent; int otherwise
number = hexfloat / (int ["." fraction] ["e" exponent ])
hexfloat = ["-"] "0x" 1*HEXDIG ["." 1*HEXDIG] "p" exponent
fraction = 1*DIGIT
exponent = ["+"/"-"] 1*DIGIT

text = %x22 *SCHAR %x22
SCHAR = %x20-21 / %x23-5B / %x5D-7E / %x80-10FFFD / SESC

SESC = "\" ( %x22 / "/" / "\" /                 ; \" \/ \\
             %x62 / %x66 / %x6E / %x72 / %x74 / ; \b \f \n \r \t
             (%x75 hexchar) )                   ; \uXXXX
hexchar = non-surrogate / (high-surrogate "\" %x75 low-surrogate)
non-surrogate = ((DIGIT / "A"/"B"/"C" / "E"/"F") 3HEXDIG) /
                ("D" %x30-37 2HEXDIG )
high-surrogate = "D" ("8"/"9"/"A"/"B") 2HEXDIG
low-surrogate = "D" ("C"/"D"/"E"/"F") 2HEXDIG

bytes = [bsqual] %x27 *BCHAR %x27
BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / "\'" / CRLF
bsqual = "h" / "b64"

id = EALPHA *(*("-" / ".") (EALPHA / DIGIT))
ALPHA = %x41-5A / %x61-7A
EALPHA = ALPHA / "@" / "_" / "$"
DIGIT = %x30-39
DIGIT1 = %x31-39
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
BINDIG = %x30-31

S = *WS
WS = SP / NL
SP = %x20
NL = COMMENT / CRLF
COMMENT = ";" *PCHAR CRLF
PCHAR = %x20-7E / %x80-10FFFD
CRLF = %x0A / %x0D.0A
]]></sourcecode>
      </figure>
    </section>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA+1b63LbyJX+30/RC+/EpEcgRV0ombYmo+vYWx7ZsTTl1FrK
sgk0SUQgwMFFEqPSPMv+2CfZvFi+c7obACVamcumUqlaVZkk+nr6XL5zadj3
fXE9kJtCFFER64H0fpiHqtC5LFJZTLU8PDp6JyeZms1UJtOx/HhyKHf7vXVP
qNEo05jrLQ0pzXRPiDANEjXDkmGmxoUf6WLsB6M0880Qn1bx7TQ/pkmFyItM
q9lAvj0+PxF2qQHvJ55JehqIQBUDmRehCNIk10leYkCRlVooTB3I/Y/n4ibN
riZZWs4H8vDg/UdxpRdoCgdC+vIwTYIo1/JIFUoe6XGUREWUJvKdSialmmhx
rZMS20jZXEHKmYrigST6v6WTdNJsQmOiYlqOwAM+2M2ku+JsHsaZ4w3ktCjm
+aDbtcM7Zn4nSldN7AqhymKaZkSNj39SGoYeqiwvdCIP0mymkoR7QM9A/pBE
1zrLo+Kv/1PIg0zPMOj8P9/yAGKtBgkf0rwYq2AqNzfXt7bWuS+IisXATjAN
aYh9jvyN3c3tl7alTIoMo77TtOmCG+fTNMG4r7de+lsbPX+jt+v3N19u9LhT
W5apUfpt8ZeIOSZEQjQXIJMOBWWiA2NQGMZ4Pjs/6u8OpBolYyGiZPxg7M7W
+rbp9QOVa9P4stdHI5ShyNKYdn7rH3VqZaOV/VkaljFpkv3xaJQOEz+OCp2p
GKPwBHVbvVCmfbsXrVY/0YQy1+MyHtBPKQuVTXRD5FbUQTpz0u/Skt2b6Crq
/sAzfbIkO9tYo2lnIwTNx1nW397oD0Rzfc9tcHNz08nGAc4SFWlG7O7qLIOa
d3UU0jxPNFY+5i75Uc/TrJDUbbREZ5HOifVmF2axtUB6YhuUY7BJVwTt/EqC
dp4maOfXErS1+esI2tp8kqCtzV9MkBC+70NhYXsqKIQ4J0D9OwAkWyTt9ppU
uQypW4cySgQ2+d//pk2kSkL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