home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / examples / helpsigs / Database.sig next >
Encoding:
Text File  |  1997-08-18  |  891 b   |  32 lines  |  [TEXT/R*ch]

  1. (* Database *)
  2.  
  3. datatype component = 
  4.     Str                    (* structure                       *)
  5.   | Exc of string            (* exception constructor with name *)
  6.   | Typ of string            (* type constructor with name      *)
  7.   | Val of string            (* value with name                 *)
  8.   | Con of string            (* value constructor with name       *)
  9.  
  10. (* An entry consist of a component and the name of its structure: *)
  11.  
  12. type entry = { comp : component, str : string, line : int }
  13.  
  14. (* Table represented by ordered binary tree: *)
  15.  
  16. datatype 'contents table =
  17.     Empty
  18.   | Node of string * 'contents * 'contents table * 'contents table
  19.  
  20. (* The database is a table of sorted lists of entries: *)
  21.  
  22. type database = entry list table
  23.  
  24. val writebase : string * database -> unit
  25. val readbase  : string -> database
  26.  
  27. val lookup : database * string -> entry list
  28.  
  29. (* Extract the name from an entry: *)
  30.  
  31. val getname : entry -> string
  32.