Ignore:
Timestamp:
Nov 6, 2008, 9:39:32 AM (11 years ago)
Author:
julian.reschke@…
Message:

reference RFC5234 instead of RFC822 for ABNF, but continue to extend it with implied LWS and #rule (related to #36)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p1-messaging.xml

    r334 r335  
    670670<t>
    671671   All of the mechanisms specified in this document are described in
    672    both prose and an augmented Backus-Naur Form (BNF) similar to that
    673    used by <xref target="RFC822ABNF"/>. Implementors will need to be familiar with the
    674    notation in order to understand this specification. The augmented BNF
    675    includes the following constructs:
    676 </t>
    677 <t>
    678    name = definition
    679   <list>
    680     <t>
    681       The name of a rule is simply the name itself (without any
    682       enclosing "&lt;" and "&gt;") and is separated from its definition by the
    683       equal "=" character. White space is only significant in that
    684       indentation of continuation lines is used to indicate a rule
    685       definition that spans more than one line. Certain basic rules are
    686       in uppercase, such as SP, LWS, HTAB, CRLF, DIGIT, ALPHA, etc. Angle
    687       brackets are used within definitions whenever their presence will
    688       facilitate discerning the use of rule names.
    689     </t>
    690   </list>
    691 </t>
    692 <t>
    693    "literal"
    694   <list>
    695     <t>
    696       Quotation marks surround literal text. Unless stated otherwise,
    697       the text is case-insensitive.
    698     </t>
    699   </list>
    700 </t>
    701 <t>
    702    rule1 / rule2
    703   <list>
    704     <t>
    705       Elements separated by a forward slash ("/") are alternatives, e.g., "yes /
    706       no" will accept yes or no.
    707     </t>
    708   </list>
    709 </t>
    710 <t>
    711    (rule1 rule2)
    712   <list>
    713     <t>
    714       Elements enclosed in parentheses are treated as a single element.
    715       Thus, "(elem (foo / bar) elem)" allows the token sequences "elem
    716       foo elem" and "elem bar elem".
    717     </t>
    718   </list>
    719 </t>
    720 <t>
    721    *rule
    722   <list>
    723     <t>
    724       The character "*" preceding an element indicates repetition. The
    725       full form is "&lt;n&gt;*&lt;m&gt;element" indicating at least &lt;n&gt; and at most
    726       &lt;m&gt; occurrences of element. Default values are 0 and infinity so
    727       that "*(element)" allows any number, including zero; "1*element"
    728       requires at least one; and "1*2element" allows one or two.
    729     </t>
    730   </list>
    731 </t>
    732 <t>
    733    [rule]
    734   <list>
    735     <t>
    736       Square brackets enclose optional elements; "[foo bar]" is
    737       equivalent to "*1(foo bar)".
    738     </t>
    739   </list>
    740 </t>
    741 <t>
    742    N rule
    743   <list>
    744     <t>
    745       Specific repetition: "&lt;n&gt;(element)" is equivalent to
    746       "&lt;n&gt;*&lt;n&gt;(element)"; that is, exactly &lt;n&gt; occurrences of (element).
    747       Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three
    748       alphabetic characters.
    749     </t>
    750   </list>
    751 </t>
    752 <t>
    753    #rule
    754   <list>
    755     <t>
    756       A construct "#" is defined, similar to "*", for defining lists of
    757       elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating at least
    758       &lt;n&gt; and at most &lt;m&gt; elements, each separated by one or more commas
    759       (",") and &OPTIONAL; linear white space (LWS). This makes the usual
    760       form of lists very easy; a rule such as
    761       <figure><artwork type="example">
    762    ( *<x:ref>LWS</x:ref> element *( *<x:ref>LWS</x:ref> "," *<x:ref>LWS</x:ref> element ))</artwork></figure>
    763     </t>
    764     <t>
    765       can be shown as
    766       <figure><artwork type="example">
    767    1#element</artwork></figure>
    768     </t>
    769     <t>
    770       Wherever this construct is used, null elements are allowed, but do
    771       not contribute to the count of elements present. That is,
    772       "(element), , (element) " is permitted, but counts as only two
    773       elements. Therefore, where at least one element is required, at
    774       least one non-null element &MUST; be present. Default values are 0
    775       and infinity so that "#element" allows any number, including zero;
    776       "1#element" requires at least one; and "1#2element" allows one or
    777       two.
    778     </t>
    779   </list>
    780 </t>
    781 <t>
    782    ; comment
    783   <list>
    784     <t>
    785       A semi-colon, set off some distance to the right of rule text,
    786       starts a comment that continues to the end of line. This is a
    787       simple way of including useful notes in parallel with the
    788       specifications.
    789     </t>
    790   </list>
    791 </t>
    792 <t anchor="implied.LWS">
     672   both prose and an augmented Backus-Naur Form (ABNF) based on that
     673   defined in <xref target="RFC5234"/>. Implementors will need to be
     674   familiar with the notation in order to understand this specification. The
     675   extensions to ABNF used in this specification are described below.
     676</t>
     677
     678<section title="#rule">
     679  <t>
     680    A construct "#" is defined, similar to "*", for defining lists of
     681    elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating at least
     682    &lt;n&gt; and at most &lt;m&gt; elements, each separated by one or more commas
     683    (",") and &OPTIONAL; linear white space (LWS). This makes the usual
     684    form of lists very easy; a rule such as
     685    <figure><artwork type="example">
     686 ( *<x:ref>LWS</x:ref> element *( *<x:ref>LWS</x:ref> "," *<x:ref>LWS</x:ref> element ))</artwork></figure>
     687  </t>
     688  <t>
     689    can be shown as
     690    <figure><artwork type="example">
     691 1#element</artwork></figure>
     692  </t>
     693  <t>
     694    Wherever this construct is used, null elements are allowed, but do
     695    not contribute to the count of elements present. That is,
     696    "(element), , (element) " is permitted, but counts as only two
     697    elements. Therefore, where at least one element is required, at
     698    least one non-null element &MUST; be present. Default values are 0
     699    and infinity so that "#element" allows any number, including zero;
     700    "1#element" requires at least one; and "1#2element" allows one or
     701    two.
     702  </t>
     703</section>
     704
     705<section title="implied *LWS" anchor="implied.LWS">
    793706  <iref item="implied *LWS" primary="true"/>
    794    implied *LWS
    795   <list>
    796707    <t>
    797708      The grammar described by this specification is word-based. Except
     
    804715      single token.
    805716    </t>
    806   </list>
    807 </t>
     717</section>
    808718</section>
    809719
     
    33203230<t>
    33213231   This specification makes heavy use of the augmented BNF and generic
    3322    constructs defined by David H. Crocker for <xref target="RFC822ABNF"/>. Similarly, it
     3232   constructs defined by David H. Crocker for <xref target="RFC5234"/>. Similarly, it
    33233233   reuses many of the definitions provided by Nathaniel Borenstein and
    33243234   Ned Freed for MIME <xref target="RFC2045"/>. We hope that their inclusion in this
     
    35753485</reference>
    35763486
    3577 <reference anchor="RFC822ABNF">
     3487<reference anchor="RFC5234">
    35783488  <front>
    3579     <title abbrev="Standard for ARPA Internet Text Messages">Standard for the format of ARPA Internet text messages</title>
    3580     <author initials="D.H." surname="Crocker" fullname="David H. Crocker">
    3581       <organization>University of Delaware, Dept. of Electrical Engineering</organization>
    3582       <address><email>DCrocker@UDel-Relay</email></address>
    3583     </author>
    3584     <date month="August" day="13" year="1982"/>
     3489    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
     3490    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
     3491      <organization>Brandenburg InternetWorking</organization>
     3492      <address>
     3493      <postal>
     3494      <street>675 Spruce Dr.</street>
     3495      <city>Sunnyvale</city>
     3496      <region>CA</region>
     3497      <code>94086</code>
     3498      <country>US</country></postal>
     3499      <phone>+1.408.246.8253</phone>
     3500      <email>dcrocker@bbiw.net</email></address> 
     3501    </author>
     3502    <author initials="P." surname="Overell" fullname="Paul Overell">
     3503      <organization>THUS plc.</organization>
     3504      <address>
     3505      <postal>
     3506      <street>1/2 Berkeley Square</street>
     3507      <street>99 Berkely Street</street>
     3508      <city>Glasgow</city>
     3509      <code>G3 7HR</code>
     3510      <country>UK</country></postal>
     3511      <email>paul.overell@thus.net</email></address>
     3512    </author>
     3513    <date month="January" year="2008"/>
    35853514  </front>
    3586   <seriesInfo name="STD" value="11"/>
    3587   <seriesInfo name="RFC" value="822"/>
     3515  <seriesInfo name="STD" value="68"/>
     3516  <seriesInfo name="RFC" value="5234"/>
    35883517</reference>
    35893518
     
    47144643      Use "/" instead of "|" for alternatives.
    47154644    </t>
     4645    <t>
     4646      Get rid of RFC822 dependency; use RFC5234 plus extensions instead.
     4647    </t>
    47164648  </list>
    47174649</t>
Note: See TracChangeset for help on using the changeset viewer.