Network Working Group                                     D. Crocker, Ed.
Request for Comments: 2234                       Internet Mail Consortium
Category: Standards Track                                      P. Overell
                                                      Demon Internet Ltd.
                                                            November 1997
        
Network Working Group                                     D. Crocker, Ed.
Request for Comments: 2234                       Internet Mail Consortium
Category: Standards Track                                      P. Overell
                                                      Demon Internet Ltd.
                                                            November 1997
        

Augmented BNF for Syntax Specifications: ABNF

语法规范的扩充BNF:ABNF

Status of this Memo

本备忘录的状况

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (1997). All Rights Reserved.

版权所有(C)互联网协会(1997年)。版权所有。

TABLE OF CONTENTS

目录

   1. INTRODUCTION ..................................................  2
        
   1. INTRODUCTION ..................................................  2
        
   2. RULE DEFINITION ...............................................  2
   2.1 RULE NAMING ..................................................  2
   2.2 RULE FORM ....................................................  3
   2.3 TERMINAL VALUES ..............................................  3
   2.4 EXTERNAL ENCODINGS ...........................................  5
        
   2. RULE DEFINITION ...............................................  2
   2.1 RULE NAMING ..................................................  2
   2.2 RULE FORM ....................................................  3
   2.3 TERMINAL VALUES ..............................................  3
   2.4 EXTERNAL ENCODINGS ...........................................  5
        
   3. OPERATORS .....................................................  5
   3.1 CONCATENATION    RULE1     RULE2 .............................  5
   3.2 ALTERNATIVES RULE1 / RULE2 ...................................  6
   3.3 INCREMENTAL ALTERNATIVES   RULE1 =/ RULE2 ....................  6
   3.4 VALUE RANGE ALTERNATIVES   %C##-## ...........................  7
   3.5 SEQUENCE GROUP (RULE1 RULE2) .................................  7
   3.6 VARIABLE REPETITION *RULE ....................................  8
   3.7 SPECIFIC REPETITION NRULE ....................................  8
   3.8 OPTIONAL SEQUENCE [RULE] .....................................  8
   3.9 ; COMMENT ....................................................  8
   3.10 OPERATOR PRECEDENCE .........................................  9
        
   3. OPERATORS .....................................................  5
   3.1 CONCATENATION    RULE1     RULE2 .............................  5
   3.2 ALTERNATIVES RULE1 / RULE2 ...................................  6
   3.3 INCREMENTAL ALTERNATIVES   RULE1 =/ RULE2 ....................  6
   3.4 VALUE RANGE ALTERNATIVES   %C##-## ...........................  7
   3.5 SEQUENCE GROUP (RULE1 RULE2) .................................  7
   3.6 VARIABLE REPETITION *RULE ....................................  8
   3.7 SPECIFIC REPETITION NRULE ....................................  8
   3.8 OPTIONAL SEQUENCE [RULE] .....................................  8
   3.9 ; COMMENT ....................................................  8
   3.10 OPERATOR PRECEDENCE .........................................  9
        
   4. ABNF DEFINITION OF ABNF .......................................  9
        
   4. ABNF DEFINITION OF ABNF .......................................  9
        
   5. SECURITY CONSIDERATIONS ....................................... 10
        
   5. SECURITY CONSIDERATIONS ....................................... 10
        
   6. APPENDIX A - CORE ............................................. 11
   6.1 CORE RULES ................................................... 11
   6.2 COMMON ENCODING .............................................. 12
        
   6. APPENDIX A - CORE ............................................. 11
   6.1 CORE RULES ................................................... 11
   6.2 COMMON ENCODING .............................................. 12
        
   7. ACKNOWLEDGMENTS ............................................... 12
        
   7. ACKNOWLEDGMENTS ............................................... 12
        
   8. REFERENCES .................................................... 13
        
   8. REFERENCES .................................................... 13
        
   9. CONTACT ....................................................... 13
        
   9. CONTACT ....................................................... 13
        
   10. FULL COPYRIGHT STATEMENT ..................................... 14
        
   10. FULL COPYRIGHT STATEMENT ..................................... 14
        
1. INTRODUCTION
1. 介绍

Internet technical specifications often need to define a format syntax and are free to employ whatever notation their authors deem useful. Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications. It balances compactness and simplicity, with reasonable representational power. In the early days of the Arpanet, each specification contained its own definition of ABNF. This included the email specifications, RFC733 and then RFC822 which have come to be the common citations for defining ABNF. The current document separates out that definition, to permit selective reference. Predictably, it also provides some modifications and enhancements.

互联网技术规范通常需要定义格式语法,并且可以自由使用其作者认为有用的任何符号。多年来,一种被称为增强型BNF(ABNF)的巴科斯诺尔形式(BNF)的修改版本在许多互联网规范中广受欢迎。它平衡了紧凑性和简单性,具有合理的表现力。在Arpanet的早期,每个规范都包含其自身对ABNF的定义。这包括电子邮件规范、RFC733和RFC822,它们已成为定义ABNF的常用引用。目前的文件将该定义分离出来,以允许选择性引用。可以预见,它还提供了一些修改和增强。

The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges. Appendix A (Core) supplies rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications. It is provided as a convenience and is otherwise separate from the meta language defined in the body of this document, and separate from its formal status.

标准BNF和ABNF之间的差异涉及命名规则、重复、备选方案、顺序独立性和值范围。附录A(Core)提供了一些Internet规范共有的核心词法分析器的规则定义和编码。它是为了方便起见而提供的,并且与本文档正文中定义的元语言分离,并与其正式状态分离。

2. RULE DEFINITION
2. 规则定义
2.1 Rule Naming
2.1 规则命名

The name of a rule is simply the name itself; that is, a sequence of characters, beginning with an alphabetic character, and followed by a combination of alphabetics, digits and hyphens (dashes).

规则的名称只是名称本身;也就是说,一系列字符,以字母字符开头,后跟字母、数字和连字符(破折号)的组合。

NOTE: Rule names are case-insensitive

注意:规则名称不区分大小写

The names <rulename>, <Rulename>, <RULENAME> and <rUlENamE> all refer to the same rule.

名称<rulename>、<rulename>、<rulename>和<rulename>都引用相同的规则。

Unlike original BNF, angle brackets ("<", ">") are not required. However, angle brackets may be used around a rule name whenever their presence will facilitate discerning the use of a rule name. This is typically restricted to rule name references in free-form prose, or to distinguish partial rules that combine into a string not separated by white space, such as shown in the discussion about repetition, below.

与原始BNF不同,不需要尖括号(“<”、“>”)。但是,只要尖括号的存在有助于识别规则名称的使用,则可以在规则名称周围使用尖括号。这通常仅限于自由格式散文中的规则名称引用,或用于区分组合成不以空格分隔的字符串的部分规则,如下面关于重复的讨论所示。

2.2 Rule Form
2.2 规则形式

A rule is defined by the following sequence:

规则由以下顺序定义:

        name =  elements crlf
        
        name =  elements crlf
        

where <name> is the name of the rule, <elements> is one or more rule names or terminal specifications and <crlf> is the end-of- line indicator, carriage return followed by line feed. The equal sign separates the name from the definition of the rule. The elements form a sequence of one or more rule names and/or value definitions, combined according to the various operators, defined in this document, such as alternative and repetition.

其中,<name>是规则的名称,<elements>是一个或多个规则名称或终端规范,<crlf>是行尾指示器,回车符后跟换行符。等号将名称与规则的定义分开。这些元素构成了一个或多个规则名称和/或值定义的序列,并根据本文档中定义的各种运算符(如替代和重复)进行组合。

For visual ease, rule definitions are left aligned. When a rule requires multiple lines, the continuation lines are indented. The left alignment and indentation are relative to the first lines of the ABNF rules and need not match the left margin of the document.

为便于查看,规则定义是左对齐的。当规则需要多行时,将缩进连续行。左对齐和缩进相对于ABNF规则的第一行,不需要与文档的左边距匹配。

2.3 Terminal Values
2.3 终值

Rules resolve into a string of terminal values, sometimes called characters. In ABNF a character is merely a non-negative integer. In certain contexts a specific mapping (encoding) of values into a character set (such as ASCII) will be specified.

规则解析为一个终端值字符串,有时称为字符。在ABNF中,字符仅仅是一个非负整数。在某些上下文中,将指定值到字符集(如ASCII)的特定映射(编码)。

Terminals are specified by one or more numeric characters with the base interpretation of those characters indicated explicitly. The following bases are currently defined:

终端由一个或多个数字字符指定,并明确指示这些字符的基本解释。目前定义了以下基础:

        b           =  binary
        
        b           =  binary
        
        d           =  decimal
        
        d           =  decimal
        
        x           =  hexadecimal
        
        x           =  hexadecimal
        

Hence:

因此:

        CR          =  %d13
        
        CR          =  %d13
        
        CR          =  %x0D
        
        CR          =  %x0D
        

respectively specify the decimal and hexadecimal representation of [US-ASCII] for carriage return.

分别为回车指定[US-ASCII]的十进制和十六进制表示形式。

A concatenated string of such values is specified compactly, using a period (".") to indicate separation of characters within that value. Hence:

此类值的串联字符串是紧凑指定的,使用句点(“.”)表示该值中的字符分隔。因此:

        CRLF        =  %d13.10
        
        CRLF        =  %d13.10
        

ABNF permits specifying literal text string directly, enclosed in quotation-marks. Hence:

ABNF允许直接指定文本字符串,并用引号括起来。因此:

        command     =  "command string"
        
        command     =  "command string"
        

Literal text strings are interpreted as a concatenated set of printable characters.

文字文本字符串被解释为一组串联的可打印字符。

NOTE: ABNF strings are case-insensitive and the character set for these strings is us-ascii.

注意:ABNF字符串不区分大小写,这些字符串的字符集为us ascii。

Hence:

因此:

        rulename = "abc"
        
        rulename = "abc"
        

and:

以及:

        rulename = "aBc"
        
        rulename = "aBc"
        

will match "abc", "Abc", "aBc", "abC", "ABc", "aBC", "AbC" and "ABC".

将匹配“abc”、“abc”、“abc”、“abc”、“abc”、“abc”、“abc”、“abc”、“abc”和“abc”。

To specify a rule which IS case SENSITIVE, specify the characters individually.

要指定区分大小写的规则,请分别指定字符。

For example:

例如:

        rulename    =  %d97 %d98 %d99
        
        rulename    =  %d97 %d98 %d99
        

or

        rulename    =  %d97.98.99
        
        rulename    =  %d97.98.99
        

will match only the string which comprises only lowercased characters, abc.

将仅匹配仅包含小写字符的字符串abc。

2.4 External Encodings
2.4 外部编码

External representations of terminal value characters will vary according to constraints in the storage or transmission environment. Hence, the same ABNF-based grammar may have multiple external encodings, such as one for a 7-bit US-ASCII environment, another for a binary octet environment and still a different one when 16-bit Unicode is used. Encoding details are beyond the scope of ABNF, although Appendix A (Core) provides definitions for a 7-bit US-ASCII environment as has been common to much of the Internet.

终端值字符的外部表示形式将根据存储或传输环境中的约束而变化。因此,相同的基于ABNF的语法可能具有多个外部编码,例如一个用于7位US-ASCII环境,另一个用于二进制八位字节环境,并且在使用16位Unicode时仍然是不同的。编码细节超出了ABNF的范围,尽管附录A(核心)提供了7位US-ASCII环境的定义,这在大部分互联网上都很常见。

By separating external encoding from the syntax, it is intended that alternate encoding environments can be used for the same syntax.

通过将外部编码与语法分离,可以为相同的语法使用备用编码环境。

3. OPERATORS
3. 操作员
3.1 Concatenation Rule1 Rule2
3.1 连接规则1规则2

A rule can define a simple, ordered string of values -- i.e., a concatenation of contiguous characters -- by listing a sequence of rule names. For example:

规则可以通过列出一系列规则名称来定义一个简单、有序的值字符串,即连续字符的串联。例如:

        foo         =  %x61           ; a
        
        foo         =  %x61           ; a
        
        bar         =  %x62           ; b
        
        bar         =  %x62           ; b
        
        mumble      =  foo bar foo
        
        mumble      =  foo bar foo
        

So that the rule <mumble> matches the lowercase string "aba".

因此规则<mumble>匹配小写字符串“aba”。

LINEAR WHITE SPACE: Concatenation is at the core of the ABNF parsing model. A string of contiguous characters (values) is parsed according to the rules defined in ABNF. For Internet specifications, there is some history of permitting linear white space (space and horizontal tab) to be freelyPand implicitlyPinterspersed around major constructs, such as delimiting special characters or atomic strings.

线性空白:串联是ABNF解析模型的核心。根据ABNF中定义的规则解析连续字符(值)字符串。对于Internet规范,有一些历史允许线性空白(空格和水平制表符)在主要结构(如分隔特殊字符或原子字符串)周围自由隐式插入。

NOTE: This specification for ABNF does not provide for implicit specification of linear white space.

注:本ABNF规范不提供线性空白的隐式规范。

Any grammar which wishes to permit linear white space around delimiters or string segments must specify it explicitly. It is often useful to provide for such white space in "core" rules that are

任何希望在分隔符或字符串段周围允许线性空白的语法都必须明确指定它。在“核心”规则中提供这样的空白通常是有用的

then used variously among higher-level rules. The "core" rules might be formed into a lexical analyzer or simply be part of the main ruleset.

然后在更高级别的规则中使用不同的方法。“核心”规则可以形成词法分析器,也可以只是主规则集的一部分。

3.2 Alternatives Rule1 / Rule2
3.2 备选规则1/2

Elements separated by forward slash ("/") are alternatives. Therefore,

用正斜杠(“/”)分隔的元素是可选元素。因此

foo / bar

foo/bar

will accept <foo> or <bar>.

将接受<foo>或<bar>。

NOTE: A quoted string containing alphabetic characters is special form for specifying alternative characters and is interpreted as a non-terminal representing the set of combinatorial strings with the contained characters, in the specified order but with any mixture of upper and lower case..

注:包含字母字符的带引号的字符串是用于指定可选字符的特殊形式,并被解释为以指定顺序表示包含字符的组合字符串集的非终结符,但不包括大写和小写。。

3.3 Incremental Alternatives Rule1 =/ Rule2
3.3 增量替代方案规则1=/Rule2

It is sometimes convenient to specify a list of alternatives in fragments. That is, an initial rule may match one or more alternatives, with later rule definitions adding to the set of alternatives. This is particularly useful for otherwise- independent specifications which derive from the same parent rule set, such as often occurs with parameter lists. ABNF permits this incremental definition through the construct:

有时,在片段中指定备选方案列表是很方便的。也就是说,初始规则可以匹配一个或多个备选方案,随后的规则定义将添加到备选方案集。这对于派生自同一父规则集的其他独立规范特别有用,例如参数列表中经常出现的规范。ABNF允许通过构造进行这种增量定义:

oldrule =/ additional-alternatives

oldrule=/其他备选方案

So that the rule set

因此,规则集

        ruleset     =  alt1 / alt2
        
        ruleset     =  alt1 / alt2
        

ruleset =/ alt3

规则集=/alt3

        ruleset     =/ alt4 / alt5
        
        ruleset     =/ alt4 / alt5
        

is the same as specifying

与指定相同

        ruleset     =  alt1 / alt2 / alt3 / alt4 / alt5
        
        ruleset     =  alt1 / alt2 / alt3 / alt4 / alt5
        
3.4 Value Range Alternatives %c##-##
3.4 值范围%c##-##

A range of alternative numeric values can be specified compactly, using dash ("-") to indicate the range of alternative values. Hence:

可以使用短划线(“-”)紧凑地指定可选数值的范围,以指示可选值的范围。因此:

        DIGIT       =  %x30-39
        
        DIGIT       =  %x30-39
        

is equivalent to:

相当于:

        DIGIT       =  "0" / "1" / "2" / "3" / "4" / "5" / "6" /
        
        DIGIT       =  "0" / "1" / "2" / "3" / "4" / "5" / "6" /
        
                           "7" / "8" / "9"
        
                           "7" / "8" / "9"
        

Concatenated numeric values and numeric value ranges can not be specified in the same string. A numeric value may use the dotted notation for concatenation or it may use the dash notation to specify one value range. Hence, to specify one printable character, between end of line sequences, the specification could be:

不能在同一字符串中指定串联的数值和数值范围。数值可以使用虚线表示法进行串联,也可以使用虚线表示法指定一个值范围。因此,要在行尾序列之间指定一个可打印字符,规范可以是:

        char-line = %x0D.0A %x20-7E %x0D.0A
        
        char-line = %x0D.0A %x20-7E %x0D.0A
        
3.5 Sequence Group (Rule1 Rule2)
3.5 序列组(规则1规则2)

Elements enclosed in parentheses are treated as a single element, whose contents are STRICTLY ORDERED. Thus,

括号中的元素被视为单个元素,其内容是严格有序的。因此

elem (foo / bar) blat

元素(食物/酒吧)布拉特

which matches (elem foo blat) or (elem bar blat).

哪一个匹配(elem foo blat)或(elem bar blat)。

elem foo / bar blat

艾琳·福/巴·布拉特

matches (elem foo) or (bar blat).

匹配(elem-foo)或(bar-blat)。

NOTE: It is strongly advised to use grouping notation, rather than to rely on proper reading of "bare" alternations, when alternatives consist of multiple rule names or literals.

注意:当备选方案由多个规则名称或文字组成时,强烈建议使用分组符号,而不是依赖于正确阅读“裸”备选方案。

Hence it is recommended that instead of the above form, the form:

因此,建议使用以下表格代替上述表格:

(elem foo) / (bar blat)

(elem foo)/(bar blat)

be used. It will avoid misinterpretation by casual readers.

被使用。这将避免偶然读者的误解。

The sequence group notation is also used within free text to set off an element sequence from the prose.

在自由文本中,序列组表示法也用于从散文中设置元素序列。

3.6 Variable Repetition *Rule
3.6 可变重复*规则

The operator "*" preceding an element indicates repetition. The full form is:

元素前面的运算符“*”表示重复。表格全文如下:

        <a>*<b>element
        
        <a>*<b>element
        

where <a> and <b> are optional decimal values, indicating at least <a> and at most <b> occurrences of element.

其中<a>和<b>是可选的十进制值,表示元素至少出现<a>和最多出现<b>。

Default values are 0 and infinity so that *<element> allows any number, including zero; 1*<element> requires at least one; 3*3<element> allows exactly 3 and 1*2<element> allows one or two.

默认值为0和无穷大,因此*<element>允许任何数字,包括零;1*<element>至少需要一个;3*3<element>只允许3个,1*2<element>只允许一个或两个。

3.7 Specific Repetition nRule
3.7 特定重复规则

A rule of the form:

形式规则:

<n>element

<n> 元素

is equivalent to

相当于

        <n>*<n>element
        
        <n>*<n>element
        

That is, exactly <N> occurrences of <element>. Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three alphabetic characters.

也就是说,<element>的出现次数正好是<N>。因此,2DIGIT是一个2位数字,3ALPHA是一个由三个字母组成的字符串。

3.8 Optional Sequence [RULE]
3.8 可选序列[规则]

Square brackets enclose an optional element sequence:

方括号中包含一个可选的元素序列:

[foo bar]

[富吧]

is equivalent to

相当于

*1(foo bar).

*1(富吧)。

3.9 ; Comment
3.9 ; 议论

A semi-colon starts a comment that continues to the end of line. This is a simple way of including useful notes in parallel with the specifications.

分号开始一条注释,该注释一直延续到行尾。这是一种简单的方法,可以在规范中同时包含有用的注释。

3.10 Operator Precedence
3.10 运算符优先级

The various mechanisms described above have the following precedence, from highest (binding tightest) at the top, to lowest and loosest at the bottom:

上述各种机制具有以下优先顺序,从顶部的最高(最紧密的绑定)到底部的最低和最松散:

Strings, Names formation Comment Value range Repetition Grouping, Optional Concatenation Alternative

字符串、名称、注释值范围、重复分组、可选连接选项

Use of the alternative operator, freely mixed with concatenations can be confusing.

使用替代运算符(与串联自由混合)可能会令人困惑。

Again, it is recommended that the grouping operator be used to make explicit concatenation groups.

同样,建议使用分组运算符创建显式连接组。

4. ABNF DEFINITION OF ABNF
4. ABNF对ABNF的定义

This syntax uses the rules provided in Appendix A (Core).

此语法使用附录A(核心)中提供的规则。

        rulelist       =  1*( rule / (*c-wsp c-nl) )
        
        rulelist       =  1*( rule / (*c-wsp c-nl) )
        

rule = rulename defined-as elements c-nl ; continues if next line starts ; with white space

规则=定义为元素c-nl的规则名称;如果下一行开始,则继续;带空格

        rulename       =  ALPHA *(ALPHA / DIGIT / "-")
        
        rulename       =  ALPHA *(ALPHA / DIGIT / "-")
        
        defined-as     =  *c-wsp ("=" / "=/") *c-wsp
                               ; basic rules definition and
                               ;  incremental alternatives
        
        defined-as     =  *c-wsp ("=" / "=/") *c-wsp
                               ; basic rules definition and
                               ;  incremental alternatives
        

elements = alternation *c-wsp

元素=交替*c-wsp

c-wsp = WSP / (c-nl WSP)

c-wsp=wsp/(c-nl wsp)

c-nl = comment / CRLF ; comment or newline

c-nl=注释/CRLF;评论还是换行

        comment        =  ";" *(WSP / VCHAR) CRLF
        
        comment        =  ";" *(WSP / VCHAR) CRLF
        
        alternation    =  concatenation
                          *(*c-wsp "/" *c-wsp concatenation)
        
        alternation    =  concatenation
                          *(*c-wsp "/" *c-wsp concatenation)
        
        concatenation  =  repetition *(1*c-wsp repetition)
        
        concatenation  =  repetition *(1*c-wsp repetition)
        
        repetition     =  [repeat] element
        
        repetition     =  [repeat] element
        
        repeat         =  1*DIGIT / (*DIGIT "*" *DIGIT)
        
        repeat         =  1*DIGIT / (*DIGIT "*" *DIGIT)
        
        element        =  rulename / group / option /
                          char-val / num-val / prose-val
        
        element        =  rulename / group / option /
                          char-val / num-val / prose-val
        
        group          =  "(" *c-wsp alternation *c-wsp ")"
        
        group          =  "(" *c-wsp alternation *c-wsp ")"
        
        option         =  "[" *c-wsp alternation *c-wsp "]"
        
        option         =  "[" *c-wsp alternation *c-wsp "]"
        

char-val = DQUOTE *(%x20-21 / %x23-7E) DQUOTE ; quoted string of SP and VCHAR without DQUOTE

char val=DQUOTE*(%x20-21/%x23-7E)DQUOTE;SP和VCHAR的带引号字符串,不带DQUOTE

        num-val        =  "%" (bin-val / dec-val / hex-val)
        
        num-val        =  "%" (bin-val / dec-val / hex-val)
        
        bin-val        =  "b" 1*BIT
                          [ 1*("." 1*BIT) / ("-" 1*BIT) ]
                               ; series of concatenated bit values
                               ; or single ONEOF range
        
        bin-val        =  "b" 1*BIT
                          [ 1*("." 1*BIT) / ("-" 1*BIT) ]
                               ; series of concatenated bit values
                               ; or single ONEOF range
        
        dec-val        =  "d" 1*DIGIT
                          [ 1*("." 1*DIGIT) / ("-" 1*DIGIT) ]
        
        dec-val        =  "d" 1*DIGIT
                          [ 1*("." 1*DIGIT) / ("-" 1*DIGIT) ]
        
        hex-val        =  "x" 1*HEXDIG
                          [ 1*("." 1*HEXDIG) / ("-" 1*HEXDIG) ]
        
        hex-val        =  "x" 1*HEXDIG
                          [ 1*("." 1*HEXDIG) / ("-" 1*HEXDIG) ]
        
        prose-val      =  "<" *(%x20-3D / %x3F-7E) ">"
                               ; bracketed string of SP and VCHAR
                                  without angles
                               ; prose description, to be used as
                                  last resort
        
        prose-val      =  "<" *(%x20-3D / %x3F-7E) ">"
                               ; bracketed string of SP and VCHAR
                                  without angles
                               ; prose description, to be used as
                                  last resort
        
5. SECURITY CONSIDERATIONS
5. 安全考虑

Security is truly believed to be irrelevant to this document.

安全性确实被认为与本文件无关。

6. APPENDIX A - CORE
6. 附录A-核心

This Appendix is provided as a convenient core for specific grammars. The definitions may be used as a core set of rules.

本附录作为特定语法的方便核心提供。这些定义可用作一组核心规则。

6.1 Core Rules
6.1 核心规则

Certain basic rules are in uppercase, such as SP, HTAB, CRLF, DIGIT, ALPHA, etc.

某些基本规则是大写的,例如SP、HTAB、CRLF、DIGIT、ALPHA等。

        ALPHA          =  %x41-5A / %x61-7A   ; A-Z / a-z
        
        ALPHA          =  %x41-5A / %x61-7A   ; A-Z / a-z
        
        BIT            =  "0" / "1"
        
        BIT            =  "0" / "1"
        
        CHAR           =  %x01-7F
                               ; any 7-bit US-ASCII character,
                                  excluding NUL
        
        CHAR           =  %x01-7F
                               ; any 7-bit US-ASCII character,
                                  excluding NUL
        
        CR             =  %x0D
                               ; carriage return
        
        CR             =  %x0D
                               ; carriage return
        

CRLF = CR LF ; Internet standard newline

CRLF=CRLF;互联网标准新线

        CTL            =  %x00-1F / %x7F
                               ; controls
        
        CTL            =  %x00-1F / %x7F
                               ; controls
        
        DIGIT          =  %x30-39
                               ; 0-9
        
        DIGIT          =  %x30-39
                               ; 0-9
        
        DQUOTE         =  %x22
                               ; " (Double Quote)
        
        DQUOTE         =  %x22
                               ; " (Double Quote)
        
        HEXDIG         =  DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
        
        HEXDIG         =  DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
        
        HTAB           =  %x09
                               ; horizontal tab
        
        HTAB           =  %x09
                               ; horizontal tab
        
        LF             =  %x0A
                               ; linefeed
        
        LF             =  %x0A
                               ; linefeed
        
        LWSP           =  *(WSP / CRLF WSP)
                               ; linear white space (past newline)
        
        LWSP           =  *(WSP / CRLF WSP)
                               ; linear white space (past newline)
        
        OCTET          =  %x00-FF
                               ; 8 bits of data
        
        OCTET          =  %x00-FF
                               ; 8 bits of data
        
        SP             =  %x20
        
        SP             =  %x20
        

; space

; 空间

        VCHAR          =  %x21-7E
                               ; visible (printing) characters
        
        VCHAR          =  %x21-7E
                               ; visible (printing) characters
        

WSP = SP / HTAB ; white space

WSP=SP/HTAB;空白

6.2 Common Encoding
6.2 通用编码

Externally, data are represented as "network virtual ASCII", namely 7-bit US-ASCII in an 8-bit field, with the high (8th) bit set to zero. A string of values is in "network byte order" with the higher-valued bytes represented on the left-hand side and being sent over the network first.

在外部,数据表示为“网络虚拟ASCII”,即8位字段中的7位US-ASCII,高位(第8位)设置为零。一个值字符串按“网络字节顺序”排列,值较高的字节在左侧表示,首先通过网络发送。

7. ACKNOWLEDGMENTS
7. 致谢

The syntax for ABNF was originally specified in RFC 733. Ken L. Harrenstien, of SRI International, was responsible for re-coding the BNF into an augmented BNF that makes the representation smaller and easier to understand.

ABNF的语法最初在RFC 733中指定。SRI国际的Ken L.Harrenstien负责将BNF重新编码为一个增强的BNF,以使表示更小、更容易理解。

This recent project began as a simple effort to cull out the portion of RFC 822 which has been repeatedly cited by non-email specification writers, namely the description of augmented BNF. Rather than simply and blindly converting the existing text into a separate document, the working group chose to give careful consideration to the deficiencies, as well as benefits, of the existing specification and related specifications available over the last 15 years and therefore to pursue enhancement. This turned the project into something rather more ambitious than first intended. Interestingly the result is not massively different from that original, although decisions such as removing the list notation came as a surprise.

最近的这个项目一开始只是为了剔除RFC 822中被非电子邮件规范作者反复引用的部分,即增强BNF的描述。工作组没有简单和盲目地将现有案文转换成一份单独的文件,而是选择仔细考虑现有规范和过去15年来可用的相关规范的缺陷和好处,并因此寻求改进。这使得该项目比最初的预期更加雄心勃勃。有趣的是,结果与最初的结果并没有太大的不同,尽管删除列表符号等决定令人惊讶。

The current round of specification was part of the DRUMS working group, with significant contributions from Jerome Abela , Harald Alvestrand, Robert Elz, Roger Fajman, Aviva Garrett, Tom Harsch, Dan Kohn, Bill McQuillan, Keith Moore, Chris Newman , Pete Resnick and Henning Schulzrinne.

本轮规范是鼓工作组的一部分,Jerome Abela、Harald Alvestrand、Robert Elz、Roger Fajman、Aviva Garrett、Tom Harsch、Dan Kohn、Bill McQuillan、Keith Moore、Chris Newman、Pete Resnick和Henning Schulzrinne做出了重大贡献。

8. REFERENCES
8. 参考资料

[US-ASCII] Coded Character Set--7-Bit American Standard Code for Information Interchange, ANSI X3.4-1986.

[US-ASCII]编码字符集——信息交换用7位美国标准代码,ANSI X3.4-1986。

[RFC733] Crocker, D., Vittal, J., Pogran, K., and D. Henderson, "Standard for the Format of ARPA Network Text Message," RFC 733, November 1977.

[RFC733]Crocker,D.,Vittal,J.,Pogran,K.,和D.Henderson,“ARPA网络文本消息格式标准”,RFC 733,1977年11月。

[RFC822] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822, August 1982.

[RFC822]Crocker,D.,“ARPA互联网文本信息格式标准”,STD 11,RFC 822,1982年8月。

9. CONTACT
9. 联系

David H. Crocker Paul Overell

大卫·H·克罗克·保罗·奥威尔

Internet Mail Consortium Demon Internet Ltd 675 Spruce Dr. Dorking Business Park Sunnyvale, CA 94086 USA Dorking Surrey, RH4 1HN UK

互联网邮件联盟Demon互联网有限公司675 Spruce Dr.Dorking Business Park Sunnyvale,CA 94086美国多金萨里,RH4 1HN英国

   Phone:    +1 408 246 8253
   Fax:      +1 408 249 6205
   EMail:    dcrocker@imc.org       paulo@turnpike.com
        
   Phone:    +1 408 246 8253
   Fax:      +1 408 249 6205
   EMail:    dcrocker@imc.org       paulo@turnpike.com
        
10. Full Copyright Statement
10. 完整版权声明

Copyright (C) The Internet Society (1997). All Rights Reserved.

版权所有(C)互联网协会(1997年)。版权所有。

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。