扩充的BNF(Backus-Naur Form)
name = definition
空格的价值:HTTP/1.1 的消息头域值可以折叠成多行,但紧接着的被折叠行由空格(SP)或水平制表(HT)折叠标记开始。所有的线性空白(LWS)包括被折叠行的折叠标记(空格SP或水平制表键HT),具有同SP一样的语义。
"literal" 大小写不明感
rule1 | rule2 匹配当中的任一个
(rule1 rule2) 将其看作一个整体
*rule 允许0到无限个规则
<n>*<m>(rule) 允许n到m次规则
[rule] *1rule
Nrule <n>(rule) <n>*<n>(rule)
#rule eg: 1#element等同为 ( *LWS element *( *LWS "," *LWS element ))
; 注释
OCTET = <any 8-bit sequence of data>
CHAR = <any US-ASCII character (octets 0 - 127)>
UPALPHA = <any US-ASCII uppercase letter "A".."Z">
LOALPHA = <any US-ASCII lowercase letter "a".."z">
ALPHA = UPALPHA | LOALPHA
DIGIT = <any US-ASCII digit "0".."9">
CTL = <any US-ASCII control character
(octets 0 - 31) and DEL (127)>
CR = <US-ASCII CR, carriage return (13)>
LF = <US-ASCII LF, linefeed (10)>
SP = <US-ASCII SP, space (32)>
HT = <US-ASCII HT, horizontal-tab (9)>
<"> = <US-ASCII double-quote mark (34)>
CRLF = CR LF 任何协议元素的行尾标志
LWS = [CRLF] 1*(SP | HT) 线性空白
TEXT = <除CTLs以外的任意OCTET,但包括LWS>
HEX = "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
separators(分割符) = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | """ | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
token(标记) = 1*<除CTLs与分割符以外的任意CHAR>
comment = "(" *( ctext | quoted-pair | comment ) ")" 注释
ctext = <除"(" 和 ")"以外的任意TEXT > 注释文本
quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
qdtext = <any TEXT except <">>
quoted-pair = "\" CHAR