1(*
2 * Copyright 2014, NICTA
3 *
4 * This software may be distributed and modified according to the terms of
5 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
6 * See "LICENSE_BSD2.txt" for details.
7 *
8 * @TAG(NICTA_BSD)
9 *)
10
11structure MString :> sig
12  eqtype t
13  val mk : string -> t
14  val dest : t -> string
15  val destPP : t -> string
16  val compare : t * t -> order
17end = struct
18  type t = string
19  fun mk s = s
20  fun dest s = s
21  fun destPP s = "MV(" ^ s ^ ")"
22  val compare = String.compare
23end
24structure MSymTab = Table(struct
25  type key = MString.t
26  val ord = inv_img_cmp MString.dest String.compare
27end)
28
29structure CNameTab = Table
30  (struct type key = {varname : MString.t,
31                      fnname : string option}
32          fun ord ({varname = vn1, fnname = fn1},
33                   {varname = vn2, fnname = fn2}) =
34              pair_compare (option_compare String.compare,
35                            MString.compare)
36                           ((fn1, vn1), (fn2, vn2))
37   end)
38
39datatype more_info = MungedVar of {munge : MString.t, owned_by : string option}
40                   | EnumC
41                   | FunctionName
42