Appendix A. Collected Grammar (文法集)
本付録は、RFC 2046で定義されたメディアタイプ構文規則の完全なBNF文法を含みます。
メディアタイプ構文
media-type = type "/" subtype *( ";" parameter )
type = discrete-type / composite-type
discrete-type = "text" / "image" / "audio" / "video" /
"application" / extension-token
composite-type = "message" / "multipart" / extension-token
extension-token = ietf-token / x-token
x-token = <The two characters "X-" or "x-" followed, with
no intervening white space, by any token>
ietf-token = <An extension token defined by a
standards-track RFC and registered
with IANA.>
subtype = extension-token / iana-token
iana-token = <A publicly-defined extension token>
parameter = attribute "=" value
attribute = token
value = token / quoted-string
Multipart構文
boundary := 0*69<bchars> bcharsnospace
bchars := bcharsnospace / " "
bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" /
"+" / "_" / "," / "-" / "." /
"/" / ":" / "=" / "?"
dash-boundary := "--" boundary
close-delimiter := delimiter "--"
delimiter := CRLF dash-boundary
discard-text := *(*text CRLF)
preamble := discard-text
epilogue := discard-text
body-part := MIME-part-headers [CRLF *OCTET]
encapsulation := delimiter
body-part
multipart-body := [preamble]
dash-boundary CRLF
body-part
*encapsulation
close-delimiter
[epilogue]
注記:
- この文法は、RFC 2045とRFC 822と組み合わせて使用されます
- 完全な構文には、すべての関連RFCを参照する必要があります
- IANAは登録されたメディアタイプのリストを管理しています