[Skip Navigation] [CSUSB] / [CNS] / [Comp Sci Dept] / [R J Botting] / [Samples] / URL.syntax
[Index] [Contents] [Source Text] [About] [Notation] [Copyright] [Comment/Contact] [Search ]
Tue Sep 18 15:27:33 PDT 2007

Contents


    Uniform Resource Locators in XBNF

    This is an XBNF(eXtreme Bachus-Naur-Form) description of the Uniform Resource Locator syntax.

    Each definition has the traditional separator with two collons and an equal sign, but is terminated by a period (.). A vertical line | indicates alternatives, and O(brackets) indicate optional parts. N(brackets) indicate a number (one or more) occurences. #(brakets) is zero or more. Spaces are represented by the word "space", and the vertical line character by "vline". Single letters stand for single letters. All words of more than one letter below are entities described somewhere in this description. Characters are shown in double quotation marks. And quoation marks as "quotes".

    The current IETF URI working group preference is for the prefixedurl production. (Nov 1993. July 93: url). The "national" and "punctuation" characters do not appear in any productions and therefore may not appear in URLs. The "afsaddress" is left in as historical note, but is not "a" url production

  1. prefixedurl::= "url:" url.
  2. url::= httpaddress | ftpaddress | newsaddress | nntpaddress | prosperoaddress | telnetaddress | gopheraddress | waisaddress | mailtoaddress | midaddress | cidaddress.
  3. scheme::= ialpha.
  4. httpaddress::= "http:" "//" hostport O( "/" path ) O( "?" search ) ftpaddress ::= "ftp://" login "/" path O( ftptype ).
  5. afsaddress::= "afs://" cellname "/" path.
  6. newsaddress::= "news:" group_art.
  7. nntpaddress::= "nntp:" group "/" N(digit).
  8. midaddress::= "mid" ":" addr_spec.
  9. cidaddress::= "cid:" content_identifier.
  10. mailtoaddress::= "mailto:" N(xalpha) "@" hostname.
  11. waisaddress::= waisindex | waisdoc.
  12. waisindex::= "wais://" hostport "/" database O( "?" search ).
  13. waisdoc::= "wais://" hostport "/" database "/" wtype "/" wpath.
  14. wpath::= N(digit) "=" path ";" O( wpath ).
  15. group_art::= "*" | group | article.
  16. group::= ialpha O( "." group ).
  17. article::= N(xalpha) "@" host.
  18. database::= N(xalpha).
  19. wtype::= N(xalpha).
  20. prosperoaddress::= prosperolink.
  21. prosperolink::= "prospero://" hostport "/" hsoname O( "%" "00" version O( N(attribute) ) ).
  22. hsoname::= path.
  23. version::= N(digit).
  24. attribute::= N(alphanum).
  25. telnetaddress::= "telnet://" login.
  26. gopheraddress::= "gopher://" hostport O(/ gtype O( gcommand ) ).
  27. login::= O( user O( ":" password ")"@")" hostport.
  28. hostport::= host O( ":" port ).
  29. host::= hostname | hostnumber..
  30. ftptype::= "A" formcode | "E" formcode | "I" | "L" N(digit).
  31. formcode::= "N" | "T" | "C".
  32. cellname::= hostname.
  33. hostname::= ialpha O( "." hostname ).
  34. hostnumber::= N(digit) "." N(digit) "." N(digit) "." N(digit).
  35. port::= N(digit).
  36. gcommand::= path.
  37. path::= void | segment O( "/" path ).
  38. segment::= N(xpalpha).
  39. search::= N(xalpha) O( search ).
  40. user::= alphanum2 O( user ).
  41. password::= alphanum2 O( password ).
  42. fragmentid::= N(xalpha).
  43. gtype::= xalpha.
  44. alphanum2::=alpha | digit | "-" | "_" | "." | "+".
  45. xalpha::= alpha | digit | safe | extra | escape.
  46. xpalpha::= xalpha | void.
  47. ialpha::= alpha O( N(xalpha) ).
  48. safe::= "$" | "-" | | "@" | . | "&" | | "-".
  49. extra::="!" | "*" | quotes | "'" | "(" | ")" | ",".
  50. reserved::= "=" | ";" | "/" | "#" | ? | ":" | space.
  51. escape::= "%" hex hex.
  52. hex::= digit | "a".."f" | "A".."F".
  53. national::= "{" | "}" | vline | "[" | "]" | "\\" | "^" | "~".
  54. punctuation::= "<" | ">".
  55. alphanum::= alpha | digit
  56. void::=""

    (end of URL BNF)

End