~/ learn/ comp-348/ cards/ Writing the specification document
1 of 4

Write the message grammar in a notation instead of prose — one line per message, per direction.

Write the message grammar in a notation instead of prose — one line per message, per direction.

Answer

C: choice = 1*DIGIT CRLF S: greeting = "200 Poem of the Day," SP count SP "poems" CRLF S: listing = 1*( index "." SP title CRLF ) S: prompt = "Enter a number 1-" count CRLF S: error = "400" SP reason CRLF

ABNF-flavoured notation: C: is what the client may send, S: what the server may send, 1* means one or more, SP is a space, CRLF is the terminator. Five lines remove every ambiguity that a paragraph of English would leave in — including whether the index is zero- or one-based.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/37389107-0de0-422f-b4fb-fc81a884f35b/flashcard utf-8 LF