Basic Units of Substructure
Overview
A semi-structured field begins with a varying-length descriptor. The descriptor is followed by a varying-length data subfield, which is surrounded by delimeter characters.
Highly-structured fields have fixed-length descriptors, followed by a data byte-count, followed by the data
BNF for individual fields
<field> ::= <machine> / <human>
<machine> ::= <stru-field> / <stru-field> <machine>
<stru-field> ::= <stru-key> <count> <data>
<stru-key> ::= 4-character field definition keyword; see
below.
<count> ::= one-byte binary count of number of bytes of
<data>.
<human> ::= <h-field> / <h-field> <human>
<h-field> ::= <h-key> <h-rest>
<h-key> ::= Variable-length field definition keyword; see
below.
<h-rest> ::= <l-delim> <data> <r-delim>
/ <l-delim> <data> <r-delim> <h-rest>
<l-delim> ::= any non-alphabetic printable character that is
not in the succeeding <data> subfield and that
is acceptable to the object site. For visual
aesthetics and to facilitate human parsing,
anything <l-delim> is a left-bracket character
(<, [, (, -), <r-delim> must be the
complementary right-bracket
character (>, ], ), |).
<r-delim> ::= either 1) the same character as <l-delim> or 2)
if the <l-delim> character is a left-bracket
character (<, [, (, -) then its complementary
right-bracket (>, ], ), |).
<data> ::= any sequence of characters acceptable to the
object site. This is the actual data subfield
with the file, directory, device (or whatever)
attribute value.
Elaboration
Case is irrelevant to the syntax, though some sites will care about case in <data> subfields.
They key (<stru-key> or <h-key>) indicates what part of the NSDS the next <data> subfield refers to.
<R-delim> amd <l-delim> are used to delimit the beginning and end of the <data> subfield.
<Fields> for pathnames ARE order dependent, but defaulted ones may be omitted. The order is as indicated for <key>s, below. That is, Network, Host, ... Siteparm.
Keywords are used, even though pathname attributes are ordered, to facilitate the addition of new fields and to be consistent with the syntax for <otherstuff> fields which are expected to be unordered.
<Field>s or <h-rest> subfields may be repeated, as permitted by the object site. A series of <h-rest> subfields, without any <h-key> subfields is interpreted as a series of <h-field>s with identical <key>s.
Also, note that since the syntax does not constrain the contents of <data> subfields, compound names within a single <data> subfield are allowed. The delimeter used to separate names within a <data> subfield must be different from <l-delim>/<r-delim> and the same as that used at the object site, since that is the only site which will be able to interpret the <data> subfield.
The validity of any combinations of <field>s is entirely site-dependent. For example, if a site will accept it, an NSDS with a Host field, and nothing more, may be permissible.
The validity of <data> subfields' contents is generally site-dependent. Some exceptions are noted below.