Augmented Backus–Naur Form

related topics
{math, number, function}
{language, word, form}
{system, computer, user}
{style, bgcolor, rowspan}
{rate, high, increase}
{household, population, family}

In computer science, Augmented Backus–Naur Form (ABNF) is a metalanguage based on Backus–Naur Form (BNF), but consisting of its own syntax and derivation rules. The motive principle for ABNF is to describe a formal system of a language to be used as a bidirectional communications protocol. It is defined by Internet Standard 68 ("STD 68", type case sic), which as of December 2010 is RFC 5234, and it often serves as the definition language for IETF communication protocols.[1][2]

RFC 5234 supersedes RFC 4234 (which superseded RFC 2234).[3]

Contents

Introduction

An ABNF specification is a set of derivation rules, written as

rule = definition ; comment CR LF

where rule is a case-insensitive nonterminal, the definition consists of sequences of symbols that define the rule, a comment for documentation, and ending with a carriage return and line feed.

Rule names are case insensitive: <rulename>, <Rulename>, <RULENAME>, and <rUlENamE> all refer to the same rule. Rule names consist of a letter followed by letters, numbers, and hyphens.

Angle brackets (“<”, “>”) are not required around rule names (as they are in BNF). However they may be used to delimit a rule name when used in prose to discern a rule name.

[edit] Terminal values

Terminals are specified by one or more numeric characters.

Numeric characters may be specified as the percent sign “%”, followed by the base (b = binary, d = decimal, and x = hexadecimal), followed by the value, or concatenation of values (indicated by “.”). For example a carriage return is specified by %d13 in decimal or %x0D in hexadecimal. A carriage return followed by a line feed may be specified with concatenation as %d13.10.

Literal text is specified through the use of a string enclosed in quotation marks ("). These strings are case-insensitive and the character set used is (US-)ASCII. Therefore the string “abc” will match “abc”, “Abc”, “aBc”, “abC”, “ABc”, “AbC”, “aBC”, and “ABC”. For a case-sensitive match the explicit characters must be defined: to match “aBc” the definition will be %d97 %d66 %d99.

[edit] Operators

[edit] White space

White space is used to separate elements of a definition; for space to be recognized as a delimiter it must be explicitly included.

[edit] Concatenation

Rule1 Rule2

A rule may be defined by listing a sequence of rule names.

To match the string “aba” the following rules could be used:

  1. foo = %x61 ; a
  2. bar = %x62 ; b
  3. mumble = foo bar foo

[edit] Alternation

Rule1 / Rule2

Full article ▸

related documents
Compactification (mathematics)
Recursive descent parser
Open set
Depth-first search
Gram–Schmidt process
Fixed point combinator
Multiplicative function
Paracompact space
Commutator subgroup
Octal
Prim's algorithm
Riesz representation theorem
Jules Richard
Existential quantification
Riemann mapping theorem
Closure (topology)
Procedural programming
Linear search
Outer product
Rank (linear algebra)
Legendre polynomials
Arity
Hyperbolic function
Constructible number
Decimal
Poisson process
Union (set theory)
Base (topology)
Pigeonhole principle
Generalized mean