[dcc2] Files Draft
codemstr at ptdprolog.net
codemstr at ptdprolog.net
Fri May 7 00:21:54 EDT 2004
Actually, I was just looking at it a bit more, and it makes almost no sense!
file-section = header-section [ 1*( CR CR header-section) ]
header-section = 1*(alpha|digit|'-') ':' SPACE header-value CR
a file-section consists of 1 or more header-sections seperated by CR CR. Each
header-section is a name: value pair terminated by a CR. So, you have to do:
size: 123
CR CR CR
id: 1
CR CR CR
name: test.txt
CR
??? That just seems crazy! Why are three CRs needed in between lines?
Additionally, it makes it impossible to tell where one file ends and one
begins. Using your ABNFs, to do two files you do:
id: 1
CR CR CR
size: 123
CR CR CR
name: test.txt
CR CR CR
id: 2
CR CR CR
size: 234
CR CR CR
name: test2.txt
CR
How do you tell where one file ends and the next begins?
I would say:
multi = file-section *(CR CR file-section)
file-section = header-section *(CR header-section)
header-section = 1*(alpha|digit|'-') ':' SPACE header-value
header-value = 1*(%x01-0C|%x0E-7F)
is more likely to be what you wanted. If I'm reading it correctly, that says
one CR between each header, and a CR CR between each file section.
Additionally, the last header specified does NOT have to be terminated with a
CR. But, I still personally say LF is better than CR. If you do want to stick
with CR, however, you should change each usage of "newline" to "carriage
return" since CR = \r (return) and LF = \n (newline), so the text says LF but
the ABNF says CR. The next change was changing [ 1*(foo) ] to *(foo). Your
way is just weird. "Zero or one of one or more of the following" ??? That's
what yours said. [] means "zero or one" and 1*() means "one or more" that's
just plain confusing. Using *() says "zero or more" which seems to be what
you wanted anyway. And also I made consistent use of spaces. You did "( CR"
but "(alpha" either put a space for both, or for neither; they are
equivilent, but a technical document should always be consistent with
formatting, it avoids ambiguity.
-- codemastr
More information about the dcc2
mailing list