procurement.txt

ABNF Grammar

This appendix provides an informative ABNF (Augmented Backus-Naur Form) grammar for the procurement.txt file format, following the notation defined in RFC 5234.


Grammar

procurement-file = *(line LF)
line             = comment / directive / blank
comment          = "#" *VCHAR
directive        = field-name ":" SP value
blank            = *WSP
field-name       = 1*(ALPHA / DIGIT / "-")
value            = 1*VCHAR

Field-specific value rules (informative):

; Service-Region
service-region-value = "global" / country-code *("," SP country-code)
country-code         = 2ALPHA
 
; Min-Order
min-order-value      = "none" / 1*DIGIT ["." 1*DIGIT] SP currency-code
currency-code        = 3ALPHA
 
; Payment-Terms
payment-terms-value  = payment-term *("," SP payment-term)
payment-term         = "prepaid" / "net-30" / "net-60" / "net-90"
                     / "purchase-order" / "credit-card" / "wire" / "on-account"
 
; Auth
auth-value           = auth-method *("," SP auth-method)
auth-method          = "none" / "api-key" / "oauth2" / "basic" / "custom"
 
; Canonical-Hash
canonical-hash-value = "sha256:" 64HEXDIG
HEXDIG               = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
                             / "a" / "b" / "c" / "d" / "e" / "f"
 
; Commerce-Protocol
commerce-protocol-value = protocol-name SP https-uri
protocol-name           = 1*(ALPHA / DIGIT / "-")
https-uri               = "https://" *VCHAR
 
; Interaction-Model
interaction-model-value = "automated" / "approval-required" / "human-led" / "hybrid"

Terminal rules (from RFC 5234):

ALPHA  = %x41-5A / %x61-7A   ; A-Z / a-z
DIGIT  = %x30-39              ; 0-9
SP     = %x20                 ; space
LF     = %x0A                 ; line feed
VCHAR  = %x21-7E              ; visible characters
WSP    = SP / HTAB            ; whitespace
HTAB   = %x09                 ; horizontal tab

Notes

Line endings

Implementations SHOULD accept both LF (Unix) and CRLF (Windows) line endings. The grammar above shows LF for clarity, but CRLF = %x0D %x0A is equally valid.

Field name case

The grammar permits upper and lowercase letters in field names. Field names are case-insensitive in practice — Contact, CONTACT, and contact are all equivalent.

Value characters

The value rule (1*VCHAR) permits any visible ASCII character. Values may contain URLs, email addresses, and free-form text. Values containing non-ASCII UTF-8 characters (e.g., in Preferred-Languages descriptions) are permitted in practice, though the grammar above is defined in terms of ASCII VCHAR for simplicity.

Colon-space separator

The separator is exactly ": " — one colon followed by one space. A colon without a following space does not form a valid directive. This allows colons to appear unescaped in values (e.g., in https: URIs).

Extension fields

Extension field names beginning with X- conform to the field-name rule above. The grammar does not restrict field names beyond the character set.


Example Parse

For the directive line:

Contact: mailto:sales@example.com
  • field-name = Contact
  • ":" separator
  • SP (one space)
  • value = mailto:sales@example.com

Note that the colon in mailto: is part of the value, not the separator.