Aller au contenu principal

Annexe A. Grammaire Collectée (Collected Grammar)

Cette annexe contient la grammaire BNF complète de toutes les règles de syntaxe MIME définies dans la RFC 2045.

Champs d'En-tête MIME

MIME-message-headers := entity-headers
fields
version CRLF

entity-headers := [ content CRLF ]
[ encoding CRLF ]
[ id CRLF ]
[ description CRLF ]
*( MIME-extension-field CRLF )

version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT

Content-Type

content := "Content-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

ietf-token := <An extension token defined by a
standards-track RFC and registered
with IANA.>

x-token := <The two characters "X-" or "x-" followed, with
no intervening white space, by any token>

subtype := extension-token / iana-token

iana-token := <A publicly-defined extension token.>

parameter := attribute "=" value

attribute := token

value := token / quoted-string

token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
or tspecials>

tspecials := "(" / ")" / "<" / ">" / "@" /
"," / ";" / ":" / "\" / <">
"/" / "[" / "]" / "?" / "="

Content-Transfer-Encoding

encoding := "Content-Transfer-Encoding" ":" mechanism

mechanism := "7bit" / "8bit" / "binary" /
"quoted-printable" / "base64" /
ietf-token / x-token

Content-ID

id := "Content-ID" ":" msg-id

Content-Description

description := "Content-Description" ":" *text

Note :

  • Cette grammaire est utilisée en conjonction avec le BNF de RFC 822
  • Certaines règles référencent des termes définis dans RFC 822
  • La grammaire complète nécessite une référence à RFC 822 et RFC 1123