<?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.35 (Ruby 3.2.1) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-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.17.1 -->
  <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-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="June" day="17"/>
    <area>ART</area>
    <workgroup>CBOR</workgroup>
    <keyword>Concise Data Definition Language</keyword>
    <abstract>
      <?line 68?>

<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 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-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 96?>

<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 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.ietf-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.ietf-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>
        <?line -18?>

</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.ietf-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="14" month="June" 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), operations on text, and deterministic encoding.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-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="11" month="March" year="2023"/>
            <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-11"/>
        </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="10" 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-02"/>
        </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>
    <?line 398?>

<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/RgSfXpCNQonbTlhNqizWlyI4lV+4dS/cS
BJskYhBgsGiJSnmW/JgnybzYfOecbhCQFGe5M3VrqkZVloBeT5/lO0vDvu+r
y55eU6qIitj0tPd+PgoKk+si1cXU6L39/WM9yYLZLMh0OtbvDvf09mZ3xVPB
cJgZzPUaQ0qZ7ik1SsMkmGHJURaMCz8yxdgPh2nmyxCfVvHtND+mSYXKi8wE
s54+Ojg7VHapHu+nnmh666kwKHo6L0YqTJPcJHmJAUVWGhVgak/3352pqzT7
OMnSct7Te7tv3qmP5gZNo57Svt5LkzDKjd4PikDvm3GUREWUJvo4SCZlMDHq
0iQlttG6voLWsyCKe5ro/4pO0kmzCY2Jimk5BA/4YFeT5UfO5mGcHK+np0Ux
z3vLy3Z4R+Z3ovSxictKBWUxTTOixsc/rYWhe0GWFybRu2k2C5KEe0BPT79P
okuT5VHxX/9Z6N3MzDDo7D+OeACx1oCEt2lejINwqtfWVtbXV7gvjIqbnp0g
DekI++z7q9trG89tS5kUGUZ9bWjTG26cT9ME475Yf+6vr3b91e62v7n2fLXL
ncayLBimXxU/RswxpRKiuQCZdCgoEx0Yg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