<?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.6.27 (Ruby 3.2.1) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-bormann-cbor-update-8610-grammar-00" category="std" consensus="true" submissionType="IETF" updates="8610" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.16.0 -->
  <front>
    <title abbrev="CDDL grammar updates">Updates to the CDDL grammar of RFC 8610</title>
    <seriesInfo name="Internet-Draft" value="draft-bormann-cbor-update-8610-grammar-00"/>
    <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="March" day="09"/>
    <area>ART</area>
    <workgroup>CBOR</workgroup>
    <keyword>Concise Data Definition Language</keyword>
    <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 <em>control operator</em>.</t>
      <t>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.</t>
      <t>The present document updates errata and makes other small fixes for
the ABNF grammar defined for CDDL in RFC 8610.</t>
      <t><cref anchor="status">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 those grammar changes that are ready
for WG adoption and publication.</cref></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-bormann-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>
    <section anchor="introduction">
      <name>Introduction</name>
      <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 <em>control operator</em>.</t>
      <t>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.</t>
      <t>The present document updates errata and makes other small fixes for
the ABNF grammar defined for CDDL in RFC 8610.</t>
      <t><cref anchor="status_1">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 those grammar changes that are ready
for WG adoption and publication.</cref></t>
      <t><cref anchor="seealso">Proposals for grammar and other changes that need more
work can be found in <xref target="I-D.bormann-cbor-cddl-2-draft"/>.  Proposals for other
additions to the CDDL specification base are in <xref target="I-D.draft-bormann-cbor-cddl-freezer"/>.</cref></t>
      <t>Note that the existing extension point "control operator" (<xref section="3.8" sectionFormat="of" target="RFC8610"/>) can be exercised for new features in parallel to the
work described here; one set of such proposals is in <xref target="I-D.bormann-cbor-cddl-more-control"/>.</t>
      <t>The present document, in conjunction with <xref target="RFC8610"/> as well as
<xref target="RFC9165"/> and <xref target="I-D.bormann-cbor-cddl-more-control"/>, is intended to be the specification
base of what has colloquially been called CDDL 1.1.
Additional documents describe further work on CDDL.</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="RFC5234"/>
and <xref target="RFC7405"/>.</t>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</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 (targets 1.0 and 2.0)</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>
        <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>
        <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"/>).
Both can be solved by updating the SESC production to:</t>
        <figure anchor="e6527-new1">
          <name>Updated string parsing to allow hex escapes</name>
          <sourcecode type="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>
        <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>
        <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 rule for BCHAR</name>
          <sourcecode type="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>
        <sourcecode type="abnf"><![CDATA[
; RFC 8610 ABNF:
bytes = [bsqual] %x27 *BCHAR %x27
BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / CRLF
]]></sourcecode>
        <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>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-e6527">
          <name>No change needed after <xref target="e6527"/></name>
          <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 may leave the door open wider to extending
<tt>bsqual</tt> as proposed in <xref section="A.1" sectionFormat="of" target="I-D.bormann-cbor-cddl-2-draft"/>.</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>
        <sourcecode type="abnf"><![CDATA[
; RFC 8610 ABNF:
cddl = S 1*(rule S)
]]></sourcecode>
        <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 2.0, CDDL files can also include directives<!-- (see
{{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 follows:</t>
        <sourcecode type="abnf"><![CDATA[
; new top-level rule:
cddl = S *(rule S)
]]></sourcecode>
        <t>and make the existence of at least one rule a semantic constraint, to
be fulfilled after processing of all directives.</t>
      </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 CDDL 1.0 syntax for expressing tags in CDDL is (ABNF as in <xref target="RFC5234"/>):</t>
        <sourcecode type="abnf"><![CDATA[
; extracted from RFC 8610 ABNF:
type2 /= "#" "6" ["." uint] "(" S type S ")"
]]></sourcecode>
        <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>CDDL 2.0 extends this to:</t>
        <sourcecode type="abnf"><![CDATA[
; new rules collectively defining the tagged case:
type2 /= "#" "6" ["." tag-number] "(" S type S ")"
tag-number = uint / ("<" type ">")
]]></sourcecode>
        <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>
        <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">
              <organization/>
            </author>
            <author fullname="C. Vigano" initials="C." surname="Vigano">
              <organization/>
            </author>
            <author fullname="C. Bormann" initials="C." surname="Bormann">
              <organization/>
            </author>
            <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>
        <reference anchor="RFC9165">
          <front>
            <title>Additional Control Operators for the Concise Data Definition Language (CDDL)</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann">
              <organization/>
            </author>
            <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="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner">
              <organization/>
            </author>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba">
              <organization/>
            </author>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="RFC5234">
          <front>
            <title>Augmented BNF for Syntax Specifications: ABNF</title>
            <author fullname="D. Crocker" initials="D." role="editor" surname="Crocker">
              <organization/>
            </author>
            <author fullname="P. Overell" initials="P." surname="Overell">
              <organization/>
            </author>
            <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>
        <reference anchor="RFC7405">
          <front>
            <title>Case-Sensitive String Support in ABNF</title>
            <author fullname="P. Kyzivat" initials="P." surname="Kyzivat">
              <organization/>
            </author>
            <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="I-D.bormann-cbor-cddl-more-control">
          <front>
            <title>More Control Operators for CDDL</title>
            <author fullname="Carsten Bormann" initials="C." surname="Bormann">
              <organization>Universität Bremen TZI</organization>
            </author>
            <date day="25" month="February" year="2023"/>
            <abstract>
              <t>   The Concise Data Definition Language (CDDL), standardized in RFC
   8610, provides "control operators" as its main language extension
   point.  RFCs have added to this extension point both in an
   application-specific and a more general way.

   The present document defines a number of additional generally
   application control operators for text conversion (Bytes, Integers,
   JSON) and operations on text.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-bormann-cbor-cddl-more-control-00"/>
        </reference>
        <reference anchor="I-D.draft-bormann-cbor-cddl-freezer">
          <front>
            <title>A feature freezer for the Concise Data Definition Language (CDDL)</title>
            <author fullname="Carsten Bormann" initials="C." surname="Bormann">
              <organization>Universität Bremen TZI</organization>
            </author>
            <date day="24" month="October" year="2022"/>
            <abstract>
              <t>   In defining the Concise Data Definition Language (CDDL), some
   features have turned up that would be nice to have.  In the interest
   of completing this specification in a timely manner, the present
   document was started to collect nice-to-have features that did not
   make it into the first RFC for CDDL, RFC 8610, or the specifications
   exercising its extension points, such as RFC 9165.

   Significant parts of this draft have now moved over to the CDDL 2.0
   project, described in draft-bormann-cbor-cddl-2-draft.  The remaining
   items in this draft are not directly related to the CDDL 2.0 effort.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-bormann-cbor-cddl-freezer-10"/>
        </reference>
        <reference anchor="I-D.bormann-cbor-cddl-2-draft">
          <front>
            <title>CDDL 2.0 -- a draft plan</title>
            <author fullname="Carsten Bormann" initials="C." surname="Bormann">
              <organization>Universität Bremen TZI</organization>
            </author>
            <date day="5" month="March" year="2023"/>
            <abstract>
              <t>   The Concise Data Definition Language (CDDL) today is defined by
   RFC 8610 and RFC 9165.  The latter (as well as some more application
   specific specifications such as RFC 9090) have used the extension
   point provided in RFC 8610, the control operator.

   As CDDL is used in larger projects, feature requirements 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 provides a roadmap towards a "CDDL 2.0".  It is
   based on draft-bormann-cbor-cddl-freezer, but is more selective in
   what potential features it takes up and more detailed in their
   discussion.  It is intended to serve as a basis for prototypical
   implementations of CDDL 2.0.  What specific documents spawn from the
   present one or whether this document is evolved into a single
   CDDL 2.0 specification.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-bormann-cbor-cddl-2-draft-01"/>
        </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">
              <organization/>
            </author>
            <author fullname="C. Bormann" initials="C." surname="Bormann">
              <organization/>
            </author>
            <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>
    <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="cddl"><![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+1b6XLbxpb+30/RgSfXpCNSIrXZdOQbaos1pciOJZfvHUk3
BMEmiRgEGCxaolKeJT/mSTIvNt85pxsEJMZZ7kzdmqpRlSWg19Nn+c7ScKvV
Ulc9va5UHuaR6Wnv/Xzk5ybTeaLzqdF7+/vHepL6s5mf6mSs3x3u6edbnTVP
+cNhajDXqw0pZLqn1CgJYn+GJUepP85bwySd+XHcCvDQklEtWqhlZ7Yimper
LE+NP+vpo4OzQ2VX6/GW6ommt54K/Lyns3ykgiTOTJwVGJCnhVE+pvZ0/92Z
uk7Sj5M0KeY9vbf75p36aG7RNOop3dJ7SRyEmdH7fu7rfTMO4zAPk1gf+/Gk
8CdGXZm4wDZaV1fQeuaHUU8T/V+FJh+3k3RCY8J8WgzBBj7Y9WR1ydk8jJPj
9fQ0z+dZb3XVDm/L/HaYLJu4qpRf5NMkJWpa+Ke18HTPT7PcxHpXuMo9oKen
38fhlUmzMP+v/8z1bmpmGHT2H0c8gFhrQMLbJMvHfjDV6+trGxtr3BeE+W3P
TpCGZIR99lvd5+ubL2xLEecpRn1taNNbbpxPkxjjvth40drodlrdzvPW1vqL
boc7jWWZP0y+yn8MmWNKxURzDjLpUNAnOjAGjUaRvL/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