ietf-822
[Top] [All Lists]

Re: Revisiting RFC 2822 grammar (obs-utext and unstructured)

2004-02-07 07:11:53

Two more points related to the 2822 grammar:
1. mixing vs. separating obs- and non-obs constructs
2. clarification of "obs"

Bruce Lilly wrote:
comments         =   "Comments" ":" unstructured CRLF
obs-comments     =   "Comments" *WSP ":" [FWS] obs-unstructured CRLF
etc.
[...]
That is why separate unstructured and obs-unstructured productions
are required.
[...]
unstructured     =   [[FWS] *(utext FWS) utext]

obs-unstructured =   *(utext FWS) [utext]

These could be partially unified as in 2822 as follows:

comments           =  "Comments" ":" unstructured CRLF
obs-comments       =  "Comments" *WSP ';' unstructured CRLF
unstructured       =  [[FWS] *(utext FWS) utext] / obs-unstructured
obs-unstructured   =  [FWS] *(utext FWS) [utext]

However, I think it's clearer to keep the obs- constructs out of
the non-obs productions. Indeed, it becomes clearer still if that
is pursued to its logical extreme:

comments           =  "Comments" ":" unstructured CRLF
obs-comments       =  "Comments" *WSP ":" obs-unstructured CRLF
unstructured       =  [[FWS] *(utext FWS) utext]
obs-unstructured   =  [obs-FWS] *(utext obs-FWS) [utext]
FWS                =  *WSP CRLF 1*WSP
obs-FWS            =  1*WSP *(CRLF 1*WSP)

i.e. the obs- constructs appear only in the obs-productions, rather than
as an alternative in non-obs productions.  The general structure would
change from:

foo = bar / obs-foo
obs-foo = baz

to:

foo = bar
obs-foo = baz / foo

(recognizing that in some cases, as with obs-FWS, "/ foo" is redundant)


The intent becomes further clarified with some name changes, especially
for non-native English readers and/or casual readers:

gen-comments       =  "Comments" ":" gen-unstructured CRLF
parse-comments     =  "Comments" *WSP ":" parse-unstructured CRLF
etc.

to avoid a misunderstanding ("it's obsolete, therefore I don't have
to deal with it at all").