| < draft-ietf-drums-abnf-03.txt | draft-ietf-drums-abnf-04.txt > | |||
|---|---|---|---|---|
| Network Working Group D. Crocker (editor) | Network Working Group D. Crocker (editor) | |||
| Internet-Draft: DRAFT-DRUMS-ABNF- Internet Mail | Internet-Draft: DRAFT-DRUMS-ABNF-04.txt Internet Mail | |||
| 06.{txt,ps} Consortium | Expiration <4/98> Consortium | |||
| Expiration <1/98> Paul Overell | Paul Overell | |||
| Demon Internet Ltd | Demon Internet Ltd | |||
| Augmented BNF for Syntax Specifications: ABNF | Augmented BNF for Syntax Specifications: ABNF | |||
| STATUS OF THIS MEMO | STATUS OF THIS MEMO | |||
| This document is an Internet-Draft. Internet-Drafts are working | This document is an Internet-Draft. Internet-Drafts are working | |||
| documents of the Internet Engineering Task Force (IETF), its | documents of the Internet Engineering Task Force (IETF), its | |||
| areas, and its working groups. Note that other groups may also | areas, and its working groups. Note that other groups may also | |||
| distribute working documents as Internet-Drafts. | distribute working documents as Internet-Drafts. | |||
| skipping to change at line 33 ¶ | skipping to change at line 33 ¶ | |||
| the ``1id-abstracts.txt'' listing contained in the Internet- | the ``1id-abstracts.txt'' listing contained in the Internet- | |||
| Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net | Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net | |||
| (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East | (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East | |||
| Coast), or ftp.isi.edu (US West Coast). | Coast), or ftp.isi.edu (US West Coast). | |||
| TABLE OF CONTENTS | TABLE OF CONTENTS | |||
| 1. INTRODUCTION | 1. INTRODUCTION | |||
| 2. RULE DEFINITION | 2. RULE DEFINITION | |||
| 2.1 Rule Naming | 2.1 RULE NAMING | |||
| 2.2 Rule Form | 2.2 RULE FORM | |||
| 2.3 End-of-Rule | 2.3 END-OF-RULE | |||
| 2.4 Terminal Values | 2.4 TERMINAL VALUES | |||
| 2.5 External Encodings | 2.5 EXTERNAL ENCODINGS | |||
| 3. OPERATORS | 3. OPERATORS | |||
| 3.1 Concatenation Rule1 | 3.1 CONCATENATION RULE1 RULE2 | |||
| Rule2 | 3.2 ALTERNATIVES RULE1 / RULE2 | |||
| 3.2 Alternatives Rule1 / Rule2 | 3.3 INCREMENTAL ALTERNATIVES RULE1 =/ RULE2 | |||
| 3.3 Incremental Alternatives | 3.4 VALUE RANGE ALTERNATIVES %C##-## | |||
| Rule1 =/ Rule2 | 3.5 SEQUENCE GROUP (RULE1 RULE2) | |||
| 3.4 Value Range Alternatives | 3.6 VARIABLE REPETITION *RULE | |||
| %c##-## | 3.6 SPECIFIC REPETITION NRULE | |||
| 3.5 Sequence Group (Rule1 | 3.7 OPTIONAL SEQUENCE [RULE] | |||
| Rule2) | 3.8 ; COMMENT | |||
| 3.6 Variable Repetition *Rule | 3.8 OPERATOR PRECEDENCE | |||
| 3.7 Specific Repetition nRule | ||||
| 3.8 Optional Sequence [RULE] | ||||
| 3.9 ; Comment | ||||
| 3.10 Operator Precedence | ||||
| 4. ABNF DEFINITION OF ABNF | 4. ABNF DEFINITION OF ABNF | |||
| 5. APPENDIX A - CORE | 5. APPENDIX A - CORE | |||
| 6. ACKNOWLEDGEMENTS | 6. ACKNOWLEDGMENTS | |||
| 7. REFERENCES | 7. REFERENCES | |||
| 8. CONTACT | 8. CONTACT | |||
| 1. INTRODUCTION | 1. INTRODUCTION | |||
| Internet technical specifications often need to define a format | Internet technical specifications often need to define a format | |||
| syntax and are free to employ whatever notation their authors | syntax and are free to employ whatever notation their authors | |||
| deem useful. Over the years, a modified version of Backus-Naur | deem useful. Over the years, a modified version of Backus-Naur | |||
| Form (BNF), called Augmented BNF (ABNF), has been popular among | Form (BNF), called Augmented BNF (ABNF), has been popular among | |||
| many Internet specifications. It balances compactness and | many Internet specifications. It balances compactness and | |||
| simplicity, with reasonable representational power. In the early | simplicity, with reasonable representational power. In the early | |||
| days of the Arpanet, each specification contained its own | days of the Arpanet, each specification contained its own | |||
| definition of ABNF. This included the email specifications, | definition of ABNF. This included the email specifications, | |||
| RFC733 and then RFC822 which have come to be the common citations | RFC733 and then RFC822 which have come to be the common citations | |||
| for defining ABNF. The current document separates out that | for defining ABNF. The current document separates out that | |||
| definition, to permit selective reference. Predictably, it also | definition, to permit selective reference. Predictably, it also | |||
| provides some enhancements. | provides some modifications and enhancements. | |||
| The differences between standard BNF and ABNF involve naming | The differences between standard BNF and ABNF involve naming | |||
| rules, repetition, alternatives, order-independence, lists, and | rules, repetition, alternatives, order-independence, lists, and | |||
| value ranges. Appendix A (Core) supplies rule definitions for a | value ranges. Appendix A (Core) supplies rule definitions for a | |||
| core lexical analyzer of the type common to several Internet | core lexical analyzer of the type common to several Internet | |||
| specifications. It is provided as a convenience and is otherwise | specifications. It is provided as a convenience and is otherwise | |||
| separate from the meta language defined in the body of this | separate from the meta language defined in the body of this | |||
| document, and separate from its formal status. | document, and separate from its formal status. | |||
| 2. RULE DEFINITION | 2. RULE DEFINITION | |||
| 2.1 Rule Naming | 2.1 Rule Naming | |||
| The name of a rule is simply the name itself; that is, a | The name of a rule is simply the name itself; that is, a | |||
| sequence of characters, beginning with an alphabetic character, | sequence of characters, beginning with an alphabetic character, | |||
| and followed by a combination of alphabetics, digits and hyphens | and followed by a combination of alphabetics, digits and hyphens | |||
| (dashes). | (dashes). | |||
| RULE NAMES ARE CASE-INSENSITIVE. | RULE NAMES ARE CASE-INSENSITIVE. | |||
| The names <rulename>, <Rulename>, <RULENAME> and <rUlENamE> all | The names <rulename>, <Rulename>, <RULENAME> and <rUlENamE> all | |||
| refer to the same rule. | refer to the same rule. | |||
| Unlike original BNF, angle brackets ("<", ">") are not required. | Unlike original BNF, angle brackets ("<", ">") are not required. | |||
| skipping to change at line 138 ¶ | skipping to change at line 134 ¶ | |||
| When a rule requires multiple lines, the continuation lines are | When a rule requires multiple lines, the continuation lines are | |||
| indented. | indented. | |||
| 2.4 Terminal Values | 2.4 Terminal Values | |||
| Rules resolve into a string of terminal values, sometimes called | Rules resolve into a string of terminal values, sometimes called | |||
| characters. Values within ABNF are represented as decimal | characters. Values within ABNF are represented as decimal | |||
| numbers. Hence, an ABNF parser processes a sequence of | numbers. Hence, an ABNF parser processes a sequence of | |||
| characters. Each character is represented as a decimal number. | characters. Each character is represented as a decimal number. | |||
| A string of values is in "network byte order" with the higher- | A string of values is in "network byte order" with the higher- | |||
| valued bytes represented on the left-hand side and begin sent | valued bytes represented on the left-hand side and being sent | |||
| over the network first.. | over the network first. | |||
| Terminals are specified by one or more numeric characters with | Terminals are specified by one or more numeric characters with | |||
| the base interpretation of those characters indicated explicitly. | the base interpretation of those characters indicated explicitly. | |||
| The following bases are currently defined: | The following bases are currently defined: | |||
| b = binary | b = binary | |||
| d = decimal | d = decimal | |||
| x = hexadecimal | x = hexadecimal | |||
| Hence: | Hence: | |||
| CR = %d13 | CR = %d13 | |||
| CR = %x0D | CR = %x0D | |||
| respectively specify the decimal and hexadecimal representation | respectively specify the decimal and hexadecimal representation | |||
| of [US-ASCII] for carriage return. | of [US-ASCII] for carriage return. | |||
| A concatenated string of such values is specified compactly, | A concatenated string of such values is specified compactly, | |||
| using a period (".") to indicate separation of characters within | using a period (".") to indicate separation of characters within | |||
| that value. Hence: | that value. Hence: | |||
| CRLF = %d13.10 | CRLF = %d13.10 | |||
| ABNF permits specifying literal text string directly, enclosed in | ABNF permits specifying literal text string directly, enclosed in | |||
| quotation-marks. Hence: | quotation-marks. Hence: | |||
| command = "command string" | command = "command string" | |||
| Literal text strings are interpreted as a concatenated set of | Literal text strings are interpreted as a concatenated set of | |||
| printable characters. | printable characters. | |||
| ABNF STRINGS ARE CASE-INSENSITIVE AND THE | ABNF STRINGS ARE CASE-INSENSITIVE AND THE | |||
| CHARACTER SET FOR THESE STRINGS IS US-ASCII. | CHARACTER SET FOR THESE STRINGS IS US-ASCII. | |||
| Hence: | Hence: | |||
| rulename = "abc" | rulename = "abc" | |||
| and: | ||||
| rulename = "aBc" | ||||
| will match "abc", "Abc", "aBc", "abC", "ABc", "aBC", "AbC" and | will match "abc", "Abc", "aBc", "abC", "ABc", "aBC", "AbC" and | |||
| "ABC". | "ABC". | |||
| TO SPECIFY A RULE WHICH IS CASE SENSITIVE, | TO SPECIFY A RULE WHICH IS CASE SENSITIVE, | |||
| SPECIFY THE CHARACTERS INDIVIDUALLY. | SPECIFY THE CHARACTERS INDIVIDUALLY. | |||
| For example: | For example: | |||
| rulename = %d97 %d9 %d99 | rulename = %d97 %d9 %d99 | |||
| or | or | |||
| rulename = %d97.98.99 | rulename = %d97.98.99 | |||
| will match only the string which comprises only lowercased | will match only the string which comprises only lowercased | |||
| characters, abc. | characters, abc. | |||
| 2.5 External Encodings | 2.5 External Encodings | |||
| External representations of these characters will vary according | External representations of these characters will vary according | |||
| to constraints in the storage or transmission environment. | to constraints in the storage or transmission environment. | |||
| Hence, the same ABNF-based grammar may have multiple external | Hence, the same ABNF-based grammar may have multiple external | |||
| encodings, such as one for a 7-bit US-ASCII environment, another | encodings, such as one for a 7-bit US-ASCII environment, another | |||
| skipping to change at line 221 ¶ | skipping to change at line 221 ¶ | |||
| syntax. | syntax. | |||
| 3. OPERATORS | 3. OPERATORS | |||
| 3.1 Concatenation Rule1 Rule2 | 3.1 Concatenation Rule1 Rule2 | |||
| A rule can define a simple, ordered string of values -- i.e., a | A rule can define a simple, ordered string of values -- i.e., a | |||
| concatenation of contiguous characters -- by listing a sequence | concatenation of contiguous characters -- by listing a sequence | |||
| of rule names. For example: | 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 lower-case string "aba". | So that the rule <mumble> matches the lower-case string "aba". | |||
| LINEAR WHITE SPACE: Concatenation is at the core of the ABNF | LINEAR WHITE SPACE: Concatenation is at the core of the ABNF | |||
| parsing model. A string of contiguous characters (values) is | parsing model. A string of contiguous characters (values) is | |||
| parsed according to the rules defined in ABNF. For Internet | parsed according to the rules defined in ABNF. For Internet | |||
| specifications, there is some history of permitting linear white | specifications, there is some history of permitting linear white | |||
| space (space and horizontal tab) to be freelyÐand | space (space and horizontal tab) to be freely - and | |||
| implicitlyÐinterspered around major constructs, such as | implicitly - interspered around major constructs, such as | |||
| delimiting special characters or atomic strings. | delimiting special characters or atomic strings. | |||
| THIS SPECIFICATION FOR ABNF DOES NOT PROVIDE | THIS SPECIFICATION FOR ABNF DOES NOT PROVIDE | |||
| FOR IMPLICIT SPECIFICATION OF LINEAR WHITE | FOR IMPLICIT SPECIFICATION OF LINEAR WHITE SPACE | |||
| SPACE. | ||||
| Any grammar which wishes to permit linear white space around | Any grammar which wishes to permit linear white space around | |||
| delimiters or string segments must specify it explicitly. It is | delimiters or string segments must specify it explicitly. It is | |||
| often useful to provide for such white space in "core" rules that | often useful to provide for such white space in "core" rules that | |||
| are then used variously among higher-level rules. The "core" | are then used variously among higher-level rules. The "core" | |||
| rules might be formed into a lexical analyzer or simply be part | rules might be formed into a lexical analyzer or simply be part | |||
| of the main ruleset. | of the main ruleset. | |||
| 3.2 Alternatives Rule1 / Rule2 | 3.2 Alternatives Rule1 / Rule2 | |||
| Elements separated by forward slash ("/") are alternatives. | Elements separated by forward slash ("/") are alternatives. | |||
| Therefore, | Therefore, | |||
| foo / bar | foo / bar | |||
| will accept <foo> or <bar>. | will accept <foo> or <bar>. | |||
| REMINDER: A string containing alphabetic | REMINDER: A string containing alphabetic | |||
| characters is a non-terminal representing the set | characters is a non-terminal representing the set | |||
| skipping to change at line 272 ¶ | skipping to change at line 271 ¶ | |||
| 3.3 Incremental Alternatives Rule1 =/ Rule2 | 3.3 Incremental Alternatives Rule1 =/ Rule2 | |||
| It is sometimes convenient to specify a list of alternatives in | It is sometimes convenient to specify a list of alternatives in | |||
| fragments. That is, an initial rule may match one or more | fragments. That is, an initial rule may match one or more | |||
| alternatives, with later rule definitions adding to the set of | alternatives, with later rule definitions adding to the set of | |||
| alternatives. This is particularly useful for otherwise- | alternatives. This is particularly useful for otherwise- | |||
| independent specifications which derive from the same parent rule | independent specifications which derive from the same parent rule | |||
| set, such as often occurs with parameter lists. ABNF permits | set, such as often occurs with parameter lists. ABNF permits | |||
| this incremental definition through the construct: | this incremental definition through the construct: | |||
| oldrule =/ additional-alternatives | oldrule =/ additional-alternatives | |||
| So that the rule set | So that the rule set | |||
| ruleset = alt1 / alt2 | ruleset = alt1 / alt2 | |||
| ruleset =/ alt3 | ruleset =/ alt3 | |||
| ruleset =/ alt4 / alt5 | ruleset =/ alt4 / alt5 | |||
| is the same as specifying | 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 Value Range Alternatives %c##-## | |||
| A range of alternative numeric values can be specified compactly, | A range of alternative numeric values can be specified compactly, | |||
| using dash ("-") to indicate the range of alternative values. | using dash ("-") to indicate the range of alternative values. | |||
| Hence: | Hence: | |||
| DIGIT = %x30-3A | DIGIT = %x30-39 | |||
| is equivalent to: | is equivalent to: | |||
| DIGIT = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" | DIGIT = "0" / "1" / "2" / "3" / "4" / "5" / "6" / | |||
| / "9" | ||||
| 3.5 Sequence Group (Rule1 Rule2) | "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 a line containing one | ||||
| printable character, the specification could be: | ||||
| onechar-line = %x0D.OA %x20-7E %xOD.OA | ||||
| 3.5 Sequence Group (Rule1 Rule2) | ||||
| Elements enclosed in parentheses are treated as a single element, | Elements enclosed in parentheses are treated as a single element, | |||
| whose contents are STRICTLY ORDERED. Thus, | whose contents are STRICTLY ORDERED. Thus, | |||
| elem (foo / bar) blat | elem (foo / bar) blat | |||
| which matches (elem foo blat) or (elem bar blat). | which matches (elem foo blat) or (elem bar blat). | |||
| elem foo / bar blat | elem foo / bar blat | |||
| matches (elem foo) or (bar blat). | matches (elem foo) or (bar blat). | |||
| IT IS STRONGLY ADVISED TO USE GROUPING | IT IS STRONGLY ADVISED TO USE GROUPING | |||
| NOTATION, RATHER THAN TO RELY ON PROPER | NOTATION, RATHER THAN TO RELY ON PROPER | |||
| READING OF "BARE" ALTERNATIONS, WHEN | READING OF "BARE" ALTERNATIONS, WHEN | |||
| ALTERNATIVES CONSIST OF MULTIPLE RULE NAMES | ALTERNATIVES CONSIST OF MULTIPLE RULE NAMES | |||
| OR LITERALS.. | OR LITERALS. | |||
| Hence it is strongly recommended that instead of the above form, | Hence it is strongly recommended that instead of the above form, | |||
| the form: | the form: | |||
| (elem foo) / (bar blat) | (elem foo) / (bar blat) | |||
| be used. It will avoid misinterpretation by casual readers. | be used. It will avoid misinterpretation by casual readers. | |||
| The local grouping notation is also used within free text to set | The local grouping notation is also used within free text to set | |||
| off an element sequence from the prose. | off an element sequence from the prose. | |||
| skipping to change at line 339 ¶ | skipping to change at line 347 ¶ | |||
| The operator "*" preceding an element indicates repetition. The | The operator "*" preceding an element indicates repetition. The | |||
| full form is: | full form is: | |||
| <a>*<b>element | <a>*<b>element | |||
| where <a> and <b> are optional decimal values, indicating at | where <a> and <b> are optional decimal values, indicating at | |||
| least <a> and at most <b> occurrences of element. | least <a> and at most <b> occurrences of element. | |||
| Default values are 0 and infinity so that <*element> allows any | Default values are 0 and infinity so that <*element> allows any | |||
| number, including zero; <1*element> requires at least one; | number, including zero; <1*element> requires at least one; | |||
| <3*3element> allows exactly 3 and <1*2element> allows one or two. | <3*3element> allows exactly 3 and <1*2element> allows one or two. | |||
| 3.7 Specific Repetition nRule | 3.7 Specific Repetition nRule | |||
| A rule of the form: | A rule of the form: | |||
| <n>element | <n>element | |||
| is equivalent to | is equivalent to | |||
| <n>*<n>element | <n>*<n>element | |||
| That is, exactly <N> occurrences of <element>. Thus 2DIGIT is | That is, exactly <N> occurrences of <element>. Thus 2DIGIT is | |||
| a 2-digit number, and 3ALPHA is a string of three alphabetic | a 2-digit number, and 3ALPHA is a string of three alphabetic | |||
| characters. | characters. | |||
| 3.8 Optional Sequence [RULE] | 3.8 Optional Sequence [RULE] | |||
| Square brackets enclose an optional element sequence: | Square brackets enclose an optional element sequence: | |||
| [foo bar] | [foo bar] | |||
| is equivalent to | is equivalent to | |||
| *1(foo bar). | *1(foo bar). | |||
| 3.9 ; Comment | 3.9 ; Comment | |||
| A semi-colon starts a comment that continues to the end of line. | 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 | This is a simple way of including useful notes in parallel with | |||
| the specifications. | the specifications. | |||
| 3.10 Operator Precedence | 3.10 Operator Precedence | |||
| The various mechanisms described above have the following | The various mechanisms described above have the following | |||
| precedence, from highest (binding tightest) at the top-left, to | precedence, from highest (binding tightest) at the top, to | |||
| lowest and loosest at the bottom-right: | lowest and loosest at the bottom: | |||
| Strings, Names formation Comment | Strings, Names formation | |||
| Value range Repetition, List | Comment | |||
| Grouping, Optional Concatenation | Value range | |||
| Alternative | Repetition, List | |||
| Grouping, Optional | ||||
| Concatenation | ||||
| Alternative | ||||
| Use of the alternative operator, freely mixed with concatenations | Use of the alternative operator, freely mixed with concatenations | |||
| can be confusing. | can be confusing. | |||
| IT IS STRONGLY RECOMMENDED THAT THE GROUPING | IT IS STRONGLY RECOMMENDED THAT THE GROUPING | |||
| OPERATOR BE USED TO MAKE EXPLICIT | OPERATOR BE USED TO MAKE EXPLICIT | |||
| CONCATENATION GROUPS. | CONCATENATION GROUPS. | |||
| 4. ABNF DEFINITION OF ABNF | 4. ABNF DEFINITION OF ABNF | |||
| skipping to change at line 406 ¶ | skipping to change at line 417 ¶ | |||
| rule = rulename defined-as elements c-nl | rule = rulename defined-as elements c-nl | |||
| ; continues if next line starts | ; continues if next line starts | |||
| ; with white space | ; with white space | |||
| rulename = ALPHA *(ALPHA / DIGIT / "-") | rulename = ALPHA *(ALPHA / DIGIT / "-") | |||
| defined-as = *c-wsp ("=" / "=/") *c-wsp | defined-as = *c-wsp ("=" / "=/") *c-wsp | |||
| ; basic rules definition and | ; basic rules definition and | |||
| ; incremental alternatives | ; incremental alternatives | |||
| elements = alternation *c-wsp | elements = alternation *c-wsp | |||
| c-wsp = WSP / (c-nl WSP) | c-wsp = WSP / (c-nl WSP) | |||
| c-nl = comment / CRLF | c-nl = comment / CRLF | |||
| ; comment or newline | ; comment or newline | |||
| comment = ";" *(WSP / PCHAR) CRLF | comment = ";" *(WSP / VCHAR) CRLF | |||
| alternation = concatenation | alternation = concatenation | |||
| *(*c-wsp "/" *c-wsp 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 / | element = rulename / group / option / | |||
| char-val / num-val / prose-val | 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 *PCHAR-NDQ DQUOTE | char-val = DQUOTE *(%x20-21 / %x23-7E) DQUOTE | |||
| ; quoted string of SP and VCHAR | ||||
| without DQUOTE | ||||
| num-val = "%" (bin-val / dec-val / hex-val) | num-val = "%" (bin-val / dec-val / hex-val) | |||
| bin-val = "b" 1*BIT | bin-val = "b" 1*BIT | |||
| *( ("." 1*BIT) / (":" 1*BIT) ) | *("." 1*BIT) / ["-" 1*BIT] | |||
| ; series of concatenated bit values | ; series of concatenated bit values | |||
| ; and/or series of ONEOF ranges | ; or single ONEOF range | |||
| dec-val = "d" 1*DIGIT | dec-val = "d" 1*DIGIT | |||
| *( ("." 1*DIGIT) / (":" 1*DIGIT) ) | *("." 1*DIGIT) / ["-" 1*DIGIT] | |||
| hex-val = "x" 1*HEXDIG | hex-val = "x" 1*HEXDIG | |||
| *( ("." 1*HEXDIG) / (":" 1*HEXDIG) ) | *("." 1*HEXDIG) / ["-" 1*HEXDIG] | |||
| prose-val = "<" *PCHAR-NRB ">" | prose-val = "<" *(%x20-3D / %x3F-7E) ">" | |||
| ; bracketed string of SP and VCHAR | ||||
| without angles | ||||
| 5. APPENDIX A - CORE | 5. SECURITY CONSIDERATIONS | |||
| Security is truly believed to be irrelevant to this document. | ||||
| 6. APPENDIX A - CORE | ||||
| This Appendix is provided as a convenient core for specific | This Appendix is provided as a convenient core for specific | |||
| grammars. The definitions may be used as a core set of rules. | grammars. The definitions may be used as a core set of rules. | |||
| Certain basic rules are in uppercase, such as SP, HT, CRLF, | Certain basic rules are in uppercase, such as SP, HTAB, CRLF, | |||
| DIGIT, ALPHA, etc. | DIGIT, ALPHA, etc. | |||
| 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 = %x00-7F | CHAR = %x01-7F | |||
| ; any US-ASCII character | ; any 7-bit US-ASCII character, | |||
| excluding NUL | ||||
| CR = %x0D | CR = %x0D | |||
| ; carriage return | ; carriage return | |||
| CRLF = CR LF | CRLF = CR LF | |||
| ; Internet standard newline | ; Internet standard newline | |||
| CTL = %x00-1F / %x7F | CTL = %x00-1F / %x7F | |||
| ; controls | ; controls | |||
| DIGIT = %x30-39 | DIGIT = %x30-39 | |||
| ; 0-9 | ; 0-9 | |||
| DQUOTE = %x22 | DQUOTE = %x22 | |||
| ; " (Double Quote) | ; " (Double Quote) | |||
| HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" | HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" | |||
| HT = %x09 | HTAB = %x09 | |||
| ; horizontal tab | ; horizontal tab | |||
| LF = %x0A | LF = %x0A | |||
| ; linefeed | ; linefeed | |||
| LWSP = *(WSP / CRLF WSP) | LWSP = *(WSP / CRLF WSP) | |||
| ; linear white space (past newline) | ; linear white space (past newline) | |||
| PCHAR = %x20-7E | OCTET = %x00-FF | |||
| ; printable characters | ; 8 bits of data | |||
| PCHAR-NRB = %x20-3D / %x3F-7E | ||||
| ; PCHAR less > (No Right Bracket) | ||||
| PCHAR-NDQ = %x20-21 / %x23-7E | ||||
| ; PCHAR less " (No Double Quote) | ||||
| SP = %x20 | SP = %x20 | |||
| ; space | ; space | |||
| WSP = SP / HT | VCHAR = %x21-7E | |||
| ; visible (printing) characters | ||||
| WSP = SP / HTAB | ||||
| ; white space | ; white space | |||
| Externally, data are represented as "network virtual ASCII", | Externally, data are represented as "network virtual ASCII", | |||
| namely 7-bit US-ASCII in an 8th bit field, with the high (8th) | namely 7-bit US-ASCII in an 8th bit field, with the high (8th) | |||
| bit set to zero. | bit set to zero. | |||
| 6. ACKNOWLEDGEMENTS | 7. ACKNOWLEDGMENTS | |||
| The syntax for ABNF was originally specified in RFC #733. Ken L. | The syntax for ABNF was originally specified in RFC #733. Ken L. | |||
| Harrenstien, of SRI International, was responsible for re-coding | Harrenstien, of SRI International, was responsible for re-coding | |||
| the BNF into an augmented BNF that makes the representation | the BNF into an augmented BNF that makes the representation | |||
| smaller and easier to understand. | smaller and easier to understand. | |||
| 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. | ||||
| The current round of specification was part of the DRUMS working | The current round of specification was part of the DRUMS working | |||
| group, with significant contributions from Roger Fajman, Bill | group, with significant contributions from Roger Fajman, Bill | |||
| McQuillan, Keith Moore, Pete Resnick, Jerome Abela and Chris | McQuillan, Keith Moore, Pete Resnick, Jerome Abela and Chris | |||
| Newman. | Newman. | |||
| 7. REFERENCES | 8. REFERENCES | |||
| [US-ASCII] Coded Character Set--7-Bit American Standard Code | [US-ASCII] Coded Character Set--7-Bit American Standard Code | |||
| for Information Interchange, ANSI X3.4-1986. | for Information Interchange, ANSI X3.4-1986. | |||
| 8. CONTACT | [RFC733] Crocker, D.H., Vittal, J.J., Pogran, K.T., | |||
| Henderson, D.A. "Standard for the Format of ARPA Network | ||||
| Text Message," RFC 733, November 1977. | ||||
| [RFC822] Crocker, D., "Standard for the Format of ARPA | ||||
| Internet Text Messages", RFC 822, August, 1982. | ||||
| 9. CONTACT | ||||
| David H. Crocker Paul Overell | David H. Crocker Paul Overell | |||
| Internet Mail Consortium Demon Internet Ltd | Internet Mail Consortium Demon Internet Ltd | |||
| 675 Spruce Dr. Dorking Business Park | 675 Spruce Dr. Dorking Business Park | |||
| Sunnyvale, CA 94086 USA Dorking | Sunnyvale, CA 94086 USA Dorking | |||
| Surrey, RH4 1HN | Surrey, RH4 1HN | |||
| <dcrocker@imc.org> UK | <dcrocker@imc.org> UK | |||
| Phone: +1 408 246 8253 <paulo@turnpike.com> | Phone: +1 408 246 8253 <paulo@turnpike.com> | |||
| End of changes. 55 change blocks. | ||||
| 89 lines changed or deleted | 126 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||