INTERNET-DRAFT M. Yevstifeyev Intended Status: BCP December 16, 2010 Updates: 5234 (if approved) Expires: June 19, 2011 Augmented Backus-Naur Form (ABNF) Notation for Separated Lists Abstract This document defines Augmented Backus-Naur Form (ABNF) notation for representing lists separated by any specified character. It updates RFC 5234. Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/1id-abstracts.html The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html Copyright and License Notice Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must Yevstifeyev Expires June 19, 2011 [Page 1] INTERNET DRAFT ABNF Notation for Separated Lists December 16, 2010 include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Conventions . . . . . . . . . . . . . . . . . . . . . . . 3 2. Notation Description . . . . . . . . . . . . . . . . . . . . . 4 2.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 5. Normative References . . . . . . . . . . . . . . . . . . . . . 6 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Author's Addresses . . . . . . . . . . . . . . . . . . . . . . . . 6 Yevstifeyev Expires June 19, 2011 [Page 2] INTERNET DRAFT ABNF Notation for Separated Lists December 16, 2010 1. Introduction ABNF does not provide the possibility to express the separated lists of elements via specific construction. If it is needed (generally for defining HTTP headers or human-readable forms), the following ABNF construction is used: (*LWS element n*m(*LWS separator *LWS element)) It is obvious that this construction is too simplified and bulky. This document specifies universal ABNF notation for lists, separated by arbitrary specified characters. 1.1. Conventions This document uses ABNF notation and core rules defined in RFC 5234 [RFC5234]. The construction in {} is used for expressing arithmetic expressions. For instance, if a=2, b=3 and c={b-a}, c is 1. If the result after using the {} construction is less then zero, it MUST be treated as zero, if not mentioned another. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. Yevstifeyev Expires June 19, 2011 [Page 3] INTERNET DRAFT ABNF Notation for Separated Lists December 16, 2010 2. Notation Description This document augment the ABNF notation *element with OPTIONAL separator part, so that the construction for separated lists is: *[#()]element where is a separator. This construction indicates at least and at most elements separated by . The corresponding construction element is also updated so that for separated lists it stands as: [#()]element indicating exactly elements separated by . The ABNF for this construction is: n*m#(a)(element) = (n_1*m_1(element 1*SP a) f(element)) n#(a)(element) = (n_1(element 1*SP a) element) n = *DIGIT ;the minimum amount of elements m = *DIGIT ;the maximum amount of elements n_1 = {n-1} n_1 =/ *DIGIT m_1 = {m-1} m_1 =/ *DIGIT u = f = {u-(u-1)} f =/ 1*DIGIT ;will be 0 if no elements are used ;and 1 if at least one is used MAY be omitted indicating that any amount of elements not more than is allowed (including zero). In this case is to be omitted too. MAY be omitted indicating that any amount of elements not less than is allowed (including ). In this case is to be omitted too. and MAY be omitted indicating that any amount of elements is allowed (including zero). In this case and are to be omitted too. 2.1. Examples The section contains a few examples of using the defined construction. Yevstifeyev Expires June 19, 2011 [Page 4] INTERNET DRAFT ABNF Notation for Separated Lists December 16, 2010 1*3#(";")element indicates the list of elements separated by semicolons (";") and OPTIONAL spaces which consists of at least 1 and at most 3 elements. 1*#(SP)element indicates the list of elements separated by spaces and OPTIONAL spaces which consists of any amount of elements but not less than 1. *3#(",")element indicates the list of elements separated by commas (",") and OPTIONAL spaces which consists of any amount of elements but not more than 3 (including zero). *#("-")element indicates the list of elements separated by hyphens ("-") and OPTIONAL spaces which consists of any amount of elements (including zero). *#(SP "." SP)element indicates the list of elements separated be the following sequence of characters: space-point-space and OPTIONAL spaces which consists of any amount of elements (including zero). 1*#(";" / ":")element indicates the list of elements separated by colons or semicolons which consists of at least 1 element. 2#(SP)element indicates the list of two elements separated by spaces. Yevstifeyev Expires June 19, 2011 [Page 5] INTERNET DRAFT ABNF Notation for Separated Lists December 16, 2010 3. Security Considerations Security issues are not discussed by this document. 4. IANA Considerations IANA has no actions for this document. 5. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC5234] Crocker, D., Ed., and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008. Acknowledgments Many thanks to Tony Hansen, Thomson Martin and Barry Leiba for their weighty input to this document. Author's Addresses Mykyta Yevstifeyev 8 Kuzovkov St., flat 25, Kotovsk, Ukraine EMail: evnikita2@gmail.com Yevstifeyev Expires June 19, 2011 [Page 6]