1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
(* ****** ****** *)
//
// CATS-parsemit
//
(* ****** ****** *)
//
// HX-2014-07-02: start
//
(* ****** ****** *)
//
#include
"share/atspre_staload.hats"
//
(* ****** ****** *)
//
#staload
"./../SATS/catsparse.sats"
#staload
"./../SATS/catsparse_fundecl.sats"
//
(* ****** ****** *)
staload F0HEAD =
{
//
#staload
"./../SATS/catsparse.sats"
//
typedef
key = symbol
and
itm = f0head
//
implement
gequal_val_val<key>
(k1, k2) = (k1 = k2)
//
#staload
"libats/SATS/hashtbl_chain.sats"
//
implement
hash_key<key>(sym) =
//
// HX:
// [gidentity]
// is called to circumvent a bug
// involving tail-call optimization
//
(
gidentity
(
hash_key<string>
(
symbol_get_name(sym)
)
)
)
//
implement
hashtbl$recapacitize<>
((*void*)) = 1(*resizable*)
//
#define CAPACITY 1024
//
#define
HX_GLOBALS_targetloc
"\
$PATSHOME/contrib\
/atscntrb/atscntrb-hx-globals"
#include
"{$HX_GLOBALS}/HATS/ghashtbl_chain.hats"
//
} (* end of [staload] *)
(* ****** ****** *)
implement
f0head_insert
(fhd) = let
(*
//
val () =
println! ("f0head_insert")
//
*)
//
val+
F0HEAD(fid, _, _) = fhd.f0head_node
//
val
opt =
$F0HEAD.insert_opt(fid.i0dex_sym, fhd)
//
in
//
case+ opt of
| ~None_vt _ => () | ~Some_vt _ => ()
//
end // end of [typedef_insert]
(* ****** ****** *)
//
implement
f0head_search_opt
(name) = $F0HEAD.search_opt (name)
//
(* ****** ****** *)
(* end of [catsparse_fundecl.dats] *)
|