W3 address syntax: BNF

This is a BNF-like description of the W3 addressing syntax . We use a vertical line "|" to indicate alternatives, and [brackets] to indicate optional parts. Spaces are representational only: no spaces are actually allowed within a W3 address. Single letters stand for single letters. All words of more than one letter below are entites described elsewhere in the syntax description. (Entity names are here linked to their definitions, probably making this difficult to read with the line mode browser.)

An absolute address specified in a link is an anchoraddress . The address which is passed to a server is a docaddress .

anchoraddress
docaddress [ # anchor ]
docaddress
httpaddress | fileaddress | newsaddress | telnetaddress | prosperoaddress | gopheraddress | waisaddress
httpaddress
h t t p : / / hostport [ / path ] [ ? search ]
prosperoaddress
p r o s p e r o : / / hostport / path
fileaddress
f i l e : / / host / path
newsaddress
n e w s : groupart
waisaddress
waisindex | waisdoc
waisindex
w a i s : / / hostport / database [ ? search ]
waisdoc
w a i s : / / hostport / database / wtype / digits / path
groupart
* | group | article
group
ialpha [ . group ]
article
xalphas @ host
database
xalphas
wtype
xalphas
telnetaddress
t e l n e t : / / [ user @ ] hostport
gopheraddress
g o p h e r : / / hostport [/ gtype [ / selector ] ] [ ? search ]
hostport
host [ : port ]
host
hostname | hostnumber
hostname
ialpha [ . hostname ]
hostnumber
digits . digits . digits . digits
port
digits
selector
path
path
void | xalphas [ / path ]
search
xalphas [ + search ]
user
xalphas
anchor
xalphas
gtype
xalpha
xalpha
alpha | $ | _ | @ | ! | % | ^ | & | * | ( | ) | . | digit
xalphas
xalpha [ xalphas ]
ialpha
alpha [ xalphas ]
alpha
a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
digit
0 |1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
digits
digit [ digits ]
alphanum
alpha | digit
alphanums
alphanum [ alphanums ]
void
See also: General description of this syntax, Escaping conventions. _________________________________________________________________
Tim BL