[8] [DFN[[CODE(ABNF)@en[atom]]]] は、 [[RFC 822メッセージ]]構文における基本的な[[字句]]です。

* [CODE(ABNF)@en[atext]]

[11] [DFN[[CODE(ABNF)@en[[[atext]]]]]] は [CODE(ABNF)@en[[[atom]]]] で使える[[文字]]の[[集合]]を表す[[生成規則]]です。

[REFS[
- [13] [CITE@en[Character set "$rfc5322:atext"]] ([TIME[2013-11-24 09:26:07 +09:00]] 版) <http://chars.suikawiki.org/set?expr=%24rfc5322%3Aatext>
]REFS]

[12] [[HTML Standard]] における[[妥当な電子メールアドレス]]の規定では、 [CODE(ABNF)@en[[[local-part]]]]
において [CODE(ABNF)@en[[[atext]]]] の他に [CODE(char)[[[.]]]] が使えることとなっており、事実上
[CODE(ABNF)@en[[[atext]]]] が拡張されています。

[REFS[
- [14] [CITE@en-US-x-hixie[HTML Standard]] ([TIME[2013-11-22 20:38:38 +09:00]] 版) <http://www.whatwg.org/specs/web-apps/current-work/#valid-e-mail-address>
]REFS]

* 仕様書から

[FIG[
[FIGCAPTION[
RFC 2822 3.2.4. Atom
]FIGCAPTION]

> Several productions in structured header field bodies are simply
strings of certain basic characters.  Such productions are called atoms.

[1] 構造化__&&header&&____&&field&&____&&body&&__中の幾つかの要素は基本文字の単純な文字列です。
この要素は atom と呼びます。

> Some of the structured header field bodies also allow the period
character (".", ASCII value 46) within runs of atext.  An additional
"dot-atom" token is defined for those purposes.

[2] 構造化__&&header&&____&&field&&____&&body&&__の幾つかは [CODE(ABNF)[atext]]
の連続中に句点文字 ([CODE(ABNF)["."]], [[ASCII]] 値 46)
も認めています。追加の [CODE(ABNF)["dot-atom"]] 字句はこの目的で定義します。

[3]
[PRE[
 atext          =       ALPHA / DIGIT / ; Any character except controls,
                        "!" / "#" /     ;  SP, and specials.
                        "$" / "%" /     ;  Used for atoms
                        "&" / "'" /     [INS[; controls, SP, specials を除く文字]]
                        "*" / "+" /     [INS[; atom に使われる]]
                        "-" / "/" /
                        "=" / "?" /
                        "^" / "_" /
                        "`" / "{" /
                        "|" / "}" /
                        "~"
]PRE]

- [4] atom            =       [CFWS] 1*atext [CFWS]
- [5] dot-atom        =       [CFWS] dot-atom-text [CFWS]
- [6] dot-atom-text   =       1*atext *("." 1*atext)

> Both atom and dot-atom are interpreted as a single unit, comprised of
the string of characters that make it up.  Semantically, the optional
comments and FWS surrounding the rest of the characters are not part
of the atom; the atom is only the run of atext characters in an atom,
or the atext and "." characters in a dot-atom.

[7] [CODE(ABNF)[atom]] 及び [CODE(ABNF)[dot-atom]] 
共に、これを構成する文字の列で構成される単一の単位として解釈されます。
意味的には、他の文字を囲んでいる省略可能な [CODE(ABNF)[comment]] 及び
[CODE(ABNF)[FWS]] は [CODE(ABNF)[atom]] の一部ではありません。
atom は [CODE(ABNF)[atom]] においては [CODE(ABMF)[atext]],
[CODE(ABNF)[dot-atom]] においては [CODE(ABNF)[atext]] 及び
[CODE(ABNF)["."]] 文字の部分のみです。
]FIG]

* メモ

[10]
[[RFC 5335]] により、 [CODE(MIME)@en[[[message/global]]]]
においては
[CODE(ABNF)@en[[[utf8-atom]]]] として
[[UTF-8]] の使用が認められるようになりました ([[RFC 5335]] 4.3)。

;; [CODE(ABNF)@en[[[atext]]]] ではなく
[CODE(ABNF)@en[[[atom]]]] が拡張されているのは、
[CODE(ABNF)@en[[[addr-spec]]]] は拡張しつつ
[CODE(ABNF)@en[[[message-id]]]] をそのままにするためのようです
[SRC@en[[[RFC 5335]] 4.3]]。