home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-08-18 | 891 b | 32 lines | [TEXT/R*ch] |
- (* Database *)
-
- datatype component =
- Str (* structure *)
- | Exc of string (* exception constructor with name *)
- | Typ of string (* type constructor with name *)
- | Val of string (* value with name *)
- | Con of string (* value constructor with name *)
-
- (* An entry consist of a component and the name of its structure: *)
-
- type entry = { comp : component, str : string, line : int }
-
- (* Table represented by ordered binary tree: *)
-
- datatype 'contents table =
- Empty
- | Node of string * 'contents * 'contents table * 'contents table
-
- (* The database is a table of sorted lists of entries: *)
-
- type database = entry list table
-
- val writebase : string * database -> unit
- val readbase : string -> database
-
- val lookup : database * string -> entry list
-
- (* Extract the name from an entry: *)
-
- val getname : entry -> string
-