rfc2045.treetop

Path: lib/mail/parsers/rfc2045.treetop
Last Update: 2010-03-02 23:35:02 +0100

module Mail

  grammar RFC2045

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

    rule ietf_token
      token+
    end

    rule x_token
      [xX] "-" token+
    end

    rule iana_token
      token+

#

    end

    rule token
      [\x21-\x27] /       # any (US-ASCII) CHAR
      [\x2a-\x2b] /       # except SPACE,
      [\x2c-\x2e] /       # CTLs,
      [\x30-\x39] /       # or tspecials
      [\x41-\x5a] /
      [\x5e-\x7e]
    end

  end

end

[Validate]