page-title: Notation -- /WWW
h1: Notation
referenceURL: https://info.cern.ch/hypertext/WWW/Notation.html
This section covers the notational conventions used in WWW specifications, specifically an augmented Backus-Naur Form (BNF). It is divided into three parts: standard RFC 822 conventions, specific changes for WWW, and general rules used across the project.\n
Notational Conventions (BNF)
1. Rule Naming: Rule names are written as the name itself (e.g., RuleName) rather than using angle brackets. Quotation marks enclose literal text.
2. Alternatives: Elements separated by a vertical bar "|" are alternatives (e.g., "foo | bar"). Note: The vertical bar is used instead of the slash "/" because slashes are used heavily in directory paths.
3. Repetition: The character "*" indicates repetition. The form <l>*<m>element indicates at least "l" and at most "m" occurrences. "1*element" requires at least one.
4. Specific Repetition: Exactly "n" occurrences are written as <n>(element). For example, 2DIGIT is a 2-digit number.
5. Lists: The "#" construct indicates a list where elements are separated by commas. "1#element" requires at least one non-null element.
6. Comments: A semi-colon ";" starts a comment that continues to the end of the line.\n
Changes and Additions for WWW
* Non-terminals are written in PascalCase (e.g., NonTerminalName).
* A rule is written as: NonTerminal ::= RuleDefinition.
* C-style escape sequences are used for layout characters: \n (newline), \r (carriage-return), \t (tab), \b (backspace), and \f (form feed).
* Angle brackets are strictly avoided to prevent conflict with SGML/HTML tags.\n
General Rules
HTTP data is written in line format, meaning line breaks (\r\n) are significant. Strings are sequences of ASCII characters surrounded by double-quotes. If a double-quote is needed inside a string, it must be escaped as \". \n
Robert Cailliau