1(* Database *) 2signature Database = sig 3datatype 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 | Term of string * string option (* term and optional kind *) 10 11(* An entry consist of a component and the name of its structure: *) 12 13type entry = { comp : component, file : string, line : int } 14 15(* Table represented by ordered binary tree: *) 16 17datatype 'contents table = 18 Empty 19 | Node of string * 'contents * 'contents table * 'contents table 20 21(* The database is a table of sorted lists of entries: *) 22 23type database = entry list table 24 25val writebase : string * database -> unit 26val readbase : string -> database 27 28val keycompare : string * string -> order 29val lookup : database * string -> entry list 30 31(* Extract the name from an entry: *) 32 33val getname : entry -> string 34end 35