ietf-nntp Detailed syntax
Clive D.W. Feather
clive at demon.net
Fri Jan 4 02:24:31 PST 2002
Paul Overell said:
>> Alternatively, since this sequence is only used for command ends and all
>> commands end that way, make the root productions:
>> command-line = command *WSP CRLF
> Or use
> command-line = command [WSP] CRLF
>
> Which I think is clearer and also gives an unambiguous parse (not that
> that is important here)
Yes, that's better. My silly.
>> Finally, though I haven't done it here, I think that alphabetical order
>> isn't the best choice.
> Having spend many frustrating hours over the years searching for
> particular productions in non-alphabetical syntaxes - I strongly
> disagree.
Well, I'll agree to disagree then. This isn't an issue people need to spend
their time on, so I'll leave it in Stan's hands.
> Syntax is not read as prose from top to bottom but by production, so
> being able to quickly find a particular production is important.
I think Algol 68 did it best. Every syntax rule had a letter (and no clause
had more than 26 syntax rules). Tokens on the right side had a
cross-reference to where they were defined while those on the left had
cross-references to all the places they were used (unless they were too
common). So you'd see something like:
a) command-line {22dg,412k} = command {b} [WSP] CRLF
b) command {a} = word {46c} WSP word
etc, where command-line is used in 2.2 rules d and g and 4.1.2 rule k,
while word is defined in 4.6 rule c.
--
Clive D.W. Feather | Work: <clive at demon.net> | Tel: +44 20 8371 1138
Internet Expert | Home: <clive at davros.org> | Fax: +44 20 8371 4037
Demon Internet | WWW: http://www.davros.org | Mobile: +44 7973 377646
Thus plc | |
More information about the ietf-nntp
mailing list