staload Err = "ats_error.sats"
staload Fil = "ats_filename.sats"
staload HT = "ats_hashtbl.sats"
staload Lst = "ats_list.sats"
staload NS = "ats_namespace.sats"
staload Sym = "ats_symbol.sats"
staload SymEnv = "ats_symenv.sats"
staload "ats_reference.sats"
staload "ats_staexp1.sats"
staload "ats_staexp2.sats"
staload "ats_dynexp2.sats"
staload "ats_trans2_env.sats"
staload _ = "ats_hashtbl.dats"
staload _ = "ats_map_lin.dats"
staload _ = "ats_symenv.dats"
#define nil list_nil
#define cons list_cons
#define :: list_cons
overload = with $Sym.eq_symbol_symbol
fn prerr_loc_error2 (loc: loc_t): void =
($Loc.prerr_location loc; prerr ": error(2)")
fn prerr_interror () = prerr "INTERNAL ERROR (ats_trans2_env)"
viewtypedef s2rtextmap = $SymEnv.symmap_t (s2rtext)
typedef s2rtextmapref = ref s2rtextmap
typedef s2rtextmaptbl = $HT.hashtbl_t (sym_t, s2rtextmapref)
val the_s2rtextmaptbl: s2rtextmaptbl =
$HT.hashtbl_make_hint {sym_t, s2rtextmapref} (
lam s => $Sym.symbol_hash s, lam (s1, s2) => s1 = s2, 256
)
viewtypedef s2itemmap = $SymEnv.symmap_t (s2item)
typedef s2itemmapref = ref s2itemmap
typedef s2itemmaptbl = $HT.hashtbl_t (sym_t, s2itemmapref)
val the_s2itemmaptbl: s2itemmaptbl =
$HT.hashtbl_make_hint {sym_t, s2itemmapref} (
lam s => $Sym.symbol_hash s, lam (s1, s2) => s1 = s2, 256
)
viewtypedef d2itemmap = $SymEnv.symmap_t (d2item)
typedef d2itemmapref = ref d2itemmap
typedef d2itemmaptbl = $HT.hashtbl_t (sym_t, d2itemmapref)
val the_d2itemmaptbl: d2itemmaptbl =
$HT.hashtbl_make_hint {sym_t, d2itemmapref} (
lam s => $Sym.symbol_hash s, lam (s1, s2) => s1 = s2, 256
)
typedef d2eclsttbl = $HT.hashtbl_t (sym_t, d2eclst)
val the_d2eclsttbl: d2eclsttbl =
$HT.hashtbl_make_hint {sym_t, d2eclst} (
lam s => $Sym.symbol_hash s, lam (s1, s2) => s1 = s2, 256
)
implement d2eclst_namespace_add (id, d2cs) = let
val ans = $HT.hashtbl_insert (the_d2eclsttbl, id, d2cs)
in
case+ ans of
| ~Some_vt _ => begin
prerr_interror ();
prerr ": d2eclst_namespace_add: id = "; $Sym.prerr_symbol id;
prerr_newline ();
$Err.abort {void} ()
end | ~None_vt _ => ()
end
implement d2eclst_namespace_find (id) =
$HT.hashtbl_search (the_d2eclsttbl, id)
assume s2rtenv_token = unit_v
typedef s2rtenv = $SymEnv.symenv_t (s2rtext)
local
val the_s2rtenv: s2rtenv = $SymEnv.symenv_make ()
in
implement the_s2rtenv_add (id, s2te) = let
val ans = $SymEnv.symenv_remove_fst (the_s2rtenv, id)
val () = begin
case+ ans of ~Some_vt _ => () | ~None_vt () => ()
end in
$SymEnv.symenv_insert_fst (the_s2rtenv, id, s2te)
end
fn the_s2rtenv_namespace_find
(id: sym_t): s2rtextopt_vt = let
fn f (name: sym_t):<cloptr1> s2rtextopt_vt = let
val r_m: s2rtextmapref =
case+ $HT.hashtbl_search (the_s2rtextmaptbl, name) of
| ~Some_vt m => m | ~None_vt _ => begin
prerr_interror ();
prerr ": s2rtenv_namespace_find: name = "; $Sym.prerr_symbol name;
prerr_newline ();
$Err.abort {s2rtextmapref} ()
end in
$SymEnv.symmap_ref_search (r_m, id)
end in
$NS.the_namespace_search (f)
end
implement the_s2rtenv_find (id) = let
val ans =
$SymEnv.symenv_search_all (the_s2rtenv, id)
in
case+ ans of
| Some_vt _ => (fold@ ans; ans)
| ~None_vt () => let
val ans = the_s2rtenv_namespace_find id
in
case+ ans of
| Some_vt _ => begin fold@ ans; ans end
| ~None_vt () => begin
$SymEnv.symenv_pervasive_search (the_s2rtenv, id)
end end end
implement the_s2rtenv_find_qua (q, id) = begin
case+ q.s0rtq_node of
| $Syn.S0RTQnone () => the_s2rtenv_find id
| $Syn.S0RTQsym q_id => let
val fil = case+ the_s2expenv_find q_id of
| ~Some_vt (S2ITEMfil fil) => fil
| ~Some_vt _ => begin
prerr_loc_error2 q.s0rtq_loc;
prerr ": the qualifier [";
$Sym.prerr_symbol q_id;
prerr "] should refer to a filename but it does not.";
prerr_newline ();
$Err.abort {fil_t} ()
end | ~None_vt _ => begin
prerr_loc_error2 q.s0rtq_loc;
prerr ": the qualifier [";
$Sym.prerr_symbol q_id;
prerr "] is unrecognized.";
prerr_newline ();
$Err.abort {fil_t} ()
end val fil_sym = $Fil.filename_full_sym fil
in
case+ $HT.hashtbl_search (the_s2rtextmaptbl, fil_sym) of
| ~Some_vt r_m => $SymEnv.symmap_ref_search (r_m, id)
| ~None_vt () => begin
prerr_interror ();
prerr ": the loaded file [";
$Sym.prerr_symbol fil_sym;
prerr "] cannot be located.";
prerr_newline ();
$Err.abort {s2rtextopt_vt} ()
end end
| $Syn.S0RTQstr name => let
in
None_vt ()
end end
implement the_s2rtenv_pop (pf | ) = begin
let prval unit_v () = pf in $SymEnv.symenv_pop (the_s2rtenv) end
end
implement the_s2rtenv_push () = let
val () = $SymEnv.symenv_push (the_s2rtenv) in (unit_v | ())
end
implement the_s2rtenv_localjoin (pf1, pf2 | ) = let
prval unit_v () = pf1 and unit_v () = pf2
in
$SymEnv.symenv_localjoin (the_s2rtenv)
end
fn the_s2rtenv_pervasive_add_topenv (): void = let
val m = $SymEnv.symenv_top_get (the_s2rtenv)
in
$SymEnv.symenv_pervasive_add (the_s2rtenv, m)
end
fn the_s2rtenv_namespace_add_topenv (id: sym_t): void = let
val m = $SymEnv.symenv_top_get the_s2rtenv
val r_m = ref_make_elt<s2rtextmap> (m)
val ans = $HT.hashtbl_insert (the_s2rtextmaptbl, id, r_m)
in
case+ ans of
| ~Some_vt _ => begin
prerr_interror ();
prerr ": s2rtenv_namespace_add_topenv: id = "; $Sym.prerr_symbol id;
prerr_newline ();
$Err.abort {void} ()
end | ~None_vt _ => ()
end
fn the_s2rtenv_save () = $SymEnv.symenv_save (the_s2rtenv)
fn the_s2rtenv_restore () = $SymEnv.symenv_restore (the_s2rtenv)
end
assume s2expenv_token = unit_v
typedef s2expenv = $SymEnv.symenv_t (s2item)
local
val the_s2expenv: s2expenv = $SymEnv.symenv_make ()
in
implement the_s2expenv_add (id, s2i) = let
val ans = $SymEnv.symenv_remove_fst (the_s2expenv, id)
val () = begin
case+ ans of ~Some_vt _ => () | ~None_vt () => ()
end in
$SymEnv.symenv_insert_fst (the_s2expenv, id, s2i)
end
implement the_s2expenv_add_scst (s2c) = let
val id = s2cst_sym_get s2c
val s2cs = (
case+ the_s2expenv_find (id) of
| ~Some_vt s2i => begin case+ s2i of
| S2ITEMcst s2cs => s2cs | _ => S2CSTLSTnil ()
end | ~None_vt () => S2CSTLSTnil ()
) : s2cstlst
val ans = $SymEnv.symenv_remove_fst (the_s2expenv, id)
val () = begin
case+ ans of ~Some_vt s2i => () | ~None_vt () => ()
end in
$SymEnv.symenv_insert_fst (
the_s2expenv, id, S2ITEMcst (S2CSTLSTcons (s2c, s2cs))
) end
implement the_s2expenv_add_svar (s2v) = let
val id = s2var_sym_get s2v in the_s2expenv_add (id, S2ITEMvar s2v)
end
implement the_s2expenv_add_svarlst (s2vs) = begin
case+ s2vs of
| cons (s2v, s2vs) => begin
the_s2expenv_add_svar s2v; the_s2expenv_add_svarlst s2vs
end | nil () => ()
end
implement the_s2expenv_add_datconptr (d2c) = let
val sym = d2con_sym_get d2c
val name = $Sym.symbol_name sym
val id = $Sym.symbol_make_string (name + "_unfold")
val () = the_s2expenv_add (id, S2ITEMdatconptr d2c)
in
end
implement the_s2expenv_add_datcontyp (d2c) = let
val sym = d2con_sym_get d2c
val name = $Sym.symbol_name sym
val id = $Sym.symbol_make_string (name + "_pstruct")
val () = the_s2expenv_add (id, S2ITEMdatcontyp d2c)
in
end
fn the_s2expenv_namespace_find
(id: sym_t): s2itemopt_vt = let
fn f (name: sym_t):<cloptr1> s2itemopt_vt = let
val r_m: s2itemmapref = begin
case+ $HT.hashtbl_search (the_s2itemmaptbl, name) of
| ~Some_vt m => m | ~None_vt _ => begin
prerr_interror ();
prerr ": the_s2expenv_namespace_find: name = "; $Sym.prerr_symbol name;
prerr_newline ();
$Err.abort {s2itemmapref} ()
end end in
$SymEnv.symmap_ref_search (r_m, id)
end in
$NS.the_namespace_search (f)
end
implement the_s2expenv_find (id) = let
val ans =
$SymEnv.symenv_search_all (the_s2expenv, id)
in
case+ ans of
| Some_vt _ => begin
let val () = fold@ ans in ans end
end | ~None_vt () => let
val ans = the_s2expenv_namespace_find id in
case+ ans of
| Some_vt _ => begin
let val () = fold@ ans in ans end
end | ~None_vt () => begin
$SymEnv.symenv_pervasive_search (the_s2expenv, id)
end end end
implement the_s2expenv_pervasive_find (id) = begin
$SymEnv.symenv_pervasive_search (the_s2expenv, id)
end
implement the_s2expenv_find_qua (q, id) = begin
case+ q.s0taq_node of
| $Syn.S0TAQnone () => the_s2expenv_find id
| $Syn.S0TAQsymdot (q_id) => let
val ans = the_s2expenv_find q_id
val fil = case+ ans of
| ~Some_vt (S2ITEMfil fil) => fil
| ~Some_vt _ => begin
prerr_loc_error2 q.s0taq_loc;
prerr ": the qualifier [";
$Sym.prerr_symbol q_id;
prerr "] should refer to a filename but it does not.";
prerr_newline ();
$Err.abort {fil_t} ()
end | ~None_vt _ => begin
prerr_loc_error2 q.s0taq_loc;
prerr ": the qualifier [";
$Sym.prerr_symbol q_id;
prerr "] is unrecognized.";
prerr_newline ();
$Err.abort {fil_t} ()
end val fil_sym = $Fil.filename_full_sym fil
val ans = $HT.hashtbl_search (the_s2itemmaptbl, fil_sym)
in
case+ ans of
| ~Some_vt r_m => $SymEnv.symmap_ref_search (r_m, id)
| ~None_vt () => None_vt ()
end | _ => None_vt ()
end
implement the_s2expenv_pop (pf | ) = begin
let prval unit_v () = pf in $SymEnv.symenv_pop (the_s2expenv) end
end
implement the_s2expenv_push () = let
val () = $SymEnv.symenv_push (the_s2expenv) in (unit_v | ())
end
implement the_s2expenv_localjoin (pf1, pf2 | ) = let
prval unit_v () = pf1 and unit_v () = pf2
in
$SymEnv.symenv_localjoin (the_s2expenv)
end
fn the_s2expenv_pervasive_add_topenv (): void = let
val m = $SymEnv.symenv_top_get (the_s2expenv)
in
$SymEnv.symenv_pervasive_add (the_s2expenv, m)
end
fn the_s2expenv_namespace_add_topenv (id: sym_t): void = let
val m = $SymEnv.symenv_top_get the_s2expenv
val r_m = ref_make_elt<s2itemmap> (m)
val ans = $HT.hashtbl_insert (the_s2itemmaptbl, id, r_m)
in
case+ ans of
| ~Some_vt _ => begin
prerr_interror ();
prerr ": the_s2expenv_namespace_add_topenv: id = "; $Sym.prerr_symbol id;
prerr_newline ();
$Err.abort {void} ()
end | ~None_vt _ => ()
end
fn the_s2expenv_save () = $SymEnv.symenv_save (the_s2expenv)
fn the_s2expenv_restore () = $SymEnv.symenv_restore (the_s2expenv)
end
local
val the_macdef: ref int = ref_make_elt<int> (0)
in
implement macdef_get () = !the_macdef
implement macdef_inc () = let
val x = !the_macdef in !the_macdef := x + 1
end implement macdef_dec () = let
val x = !the_macdef in !the_macdef := x - 1
end
end
local
val the_macro_level: ref int = ref_make_elt<int> (1)
in
implement macro_level_get () = !the_macro_level
implement macro_level_inc (loc) = let
val level = !the_macro_level
in
!the_macro_level := level + 1
end
implement macro_level_dec (loc) = let
val level = !the_macro_level
val () = if level = 0 then begin
prerr_loc_error2 loc;
prerr ": the syntax ,(...) or %(...) is used incorrectly at this location.";
prerr_newline ();
$Err.abort {void} ()
end in
!the_macro_level := level - 1
end
end
local
val the_template_level = ref_make_elt<int> (0)
in
implement template_level_get () =
!the_template_level
implement template_level_inc () =
!the_template_level := !the_template_level + 1
implement template_level_dec () =
!the_template_level := !the_template_level - 1
end
implement
s2var_tmplev_check (loc, s2v) = let
val s2v_tmplev = s2var_tmplev_get (s2v)
in
case+ 0 of
| _ when s2v_tmplev > 0 => let
val tmplev = template_level_get ()
in
if s2v_tmplev < tmplev then begin
prerr_loc_error2 loc;
prerr ": the static variable ["; prerr s2v; prerr "] is out of scope.";
prerr_newline ();
$Err.abort {void} ()
end end | _ => () end
implement s2qualst_tmplev_set (s2vpss, tmplev) = let
fun aux_s2vs
(s2vs: s2varlst, tmplev: int): void = case+ s2vs of
| cons (s2v, s2vs) => begin
s2var_tmplev_set (s2v, tmplev); aux_s2vs (s2vs, tmplev)
end | nil () => ()
fun aux_s2qualst (s2vpss: s2qualst, tmplev: int): void =
case+ s2vpss of
| cons (s2vps, s2vpss) => begin
aux_s2vs (s2vps.0, tmplev); aux_s2qualst (s2vpss, tmplev)
end | nil () => ()
in
aux_s2qualst (s2vpss, tmplev)
end
local
assume d2var_current_level_v = unit_v
val the_d2var_current_level = ref_make_elt<int> (0)
in
implement d2var_current_level_get () =
!the_d2var_current_level
implement d2var_current_level_set (n) =
!the_d2var_current_level := n
implement d2var_current_level_inc () =
let val n = !the_d2var_current_level in
!the_d2var_current_level := n + 1; (unit_v () | ())
end
implement d2var_current_level_inc_and_get () =
let val n = !the_d2var_current_level; val n1 = n + 1 in
!the_d2var_current_level := n1; (unit_v () | n1)
end
implement d2var_current_level_dec (pf | ) = let
prval unit_v () = pf; val n = !the_d2var_current_level
in
!the_d2var_current_level := n - 1
end
implement d2var_current_level_dec_and_get (pf | ) = let
prval unit_v () = pf; val n = !the_d2var_current_level; val n1 = n - 1
in
!the_d2var_current_level := n1; n1
end
end
assume d2expenv_token = unit_v
typedef d2expenv = $SymEnv.symenv_t (d2item)
local
val the_d2expenv: d2expenv = $SymEnv.symenv_make ()
in
implement the_d2expenv_add (id, d2i) = let
val ans = $SymEnv.symenv_remove_fst (the_d2expenv, id)
val () = begin
case+ ans of ~Some_vt _ => () | ~None_vt () => ()
end in
$SymEnv.symenv_insert_fst (the_d2expenv, id, d2i)
end
implement the_d2expenv_add_dcon (d2c) = let
val id = d2con_sym_get d2c
val d2cs = (
case+ the_d2expenv_find (id) of
| ~Some_vt d2i => begin case+ d2i of
| D2ITEMcon d2cs => d2cs | _ => D2CONLSTnil ()
end | ~None_vt () => D2CONLSTnil ()
) : d2conlst
val ans = $SymEnv.symenv_remove_fst (the_d2expenv, id)
val () = begin
case+ ans of ~Some_vt _ => () | ~None_vt () => ()
end in
$SymEnv.symenv_insert_fst (
the_d2expenv, id, D2ITEMcon (D2CONLSTcons (d2c, d2cs))
) end
implement the_d2expenv_add_dcst (d2c) = begin
let val id = d2cst_sym_get d2c in the_d2expenv_add (id, D2ITEMcst d2c) end
end
implement the_d2expenv_add_dmac_def (d2m) = let
val id = d2mac_sym_get d2m in the_d2expenv_add (id, D2ITEMmacdef d2m)
end
implement the_d2expenv_add_dmac_var (d2v) = let
val id = d2var_sym_get d2v in the_d2expenv_add (id, D2ITEMmacvar d2v)
end
implement the_d2expenv_add_dmac_varlst (d2vs) = begin
$Lst.list_foreach_fun (d2vs, the_d2expenv_add_dmac_var)
end
implement the_d2expenv_add_dvar (d2v) = let
val id = d2var_sym_get d2v in the_d2expenv_add (id, D2ITEMvar d2v)
end
implement the_d2expenv_add_dvarlst (d2vs) = begin
$Lst.list_foreach_fun (d2vs, the_d2expenv_add_dvar)
end
fn the_d2expenv_namespace_find
(id: sym_t): d2itemopt_vt = let
fn f (name: sym_t):<cloptr1> d2itemopt_vt = let
val ans = $HT.hashtbl_search (the_d2itemmaptbl, name)
val r_m = (case+ ans of
| ~Some_vt m => m | ~None_vt _ => begin
prerr_interror ();
prerr ": d2expenv_namespace_find: name = "; $Sym.prerr_symbol name;
prerr_newline ();
$Err.abort {d2itemmapref} ()
end ) : d2itemmapref
in
$SymEnv.symmap_ref_search (r_m, id)
end in
$NS.the_namespace_search (f)
end
implement the_d2expenv_find (id) = let
val ans =
$SymEnv.symenv_search_all (the_d2expenv, id)
in
case+ ans of
| Some_vt _ => let
prval () = fold@ ans in ans
end | ~None_vt _ => let
val ans = the_d2expenv_namespace_find id
in
case+ ans of
| Some_vt _ => let
prval () = fold@ ans in ans
end | ~None_vt _ => begin
$SymEnv.symenv_pervasive_search (the_d2expenv, id)
end end end
implement the_d2expenv_current_find (id) =
$SymEnv.symenv_search_all (the_d2expenv, id)
implement the_d2expenv_pervasive_find (id) = begin
$SymEnv.symenv_pervasive_search (the_d2expenv, id)
end
implement the_d2expenv_find_qua (q, id) = begin
case+ q.d0ynq_node of
| $Syn.D0YNQnone () => the_d2expenv_find id
| $Syn.D0YNQsymdot (q_id) => let
val fil = case+ the_s2expenv_find q_id of
| ~Some_vt (S2ITEMfil fil) => fil
| ~Some_vt _ => begin
prerr_loc_error2 q.d0ynq_loc;
prerr ": the qualifier [";
$Sym.prerr_symbol q_id;
prerr "] should refer to a filename but it does not.";
prerr_newline ();
$Err.abort {fil_t} ()
end | ~None_vt _ => begin
prerr_loc_error2 q.d0ynq_loc;
prerr ": the qualifier [";
$Sym.prerr_symbol q_id;
prerr "] is unrecognized.";
prerr_newline ();
$Err.abort {fil_t} ()
end val fil_sym = $Fil.filename_full_sym fil
in
case+ $HT.hashtbl_search (the_d2itemmaptbl, fil_sym) of
| ~Some_vt r_m => $SymEnv.symmap_ref_search (r_m, id)
| ~None_vt () => None_vt ()
end | _ => None_vt ()
end
implement the_d2expenv_pop (pf | ) = begin
let prval unit_v () = pf in $SymEnv.symenv_pop (the_d2expenv) end
end
implement the_d2expenv_push () = let
val () = $SymEnv.symenv_push (the_d2expenv) in (unit_v | ())
end
implement the_d2expenv_swap (r_map) =
$SymEnv.symenv_swap (the_d2expenv, r_map)
implement the_d2expenv_localjoin (pf1, pf2 | ) = let
prval unit_v () = pf1 and unit_v () = pf2 in
$SymEnv.symenv_localjoin (the_d2expenv)
end
fn the_d2expenv_pervasive_add_topenv (): void = let
val m = $SymEnv.symenv_top_get (the_d2expenv) in
$SymEnv.symenv_pervasive_add (the_d2expenv, m)
end
fn the_d2expenv_namespace_add_topenv (id: sym_t): void = let
val m = $SymEnv.symenv_top_get the_d2expenv
val r_m = ref_make_elt<d2itemmap> (m)
val ans = $HT.hashtbl_insert (the_d2itemmaptbl, id, r_m)
in
case+ ans of
| ~Some_vt _ => begin
prerr_interror ();
prerr ": d2expenv_namespace_add_topenv: id = "; $Sym.prerr_symbol id;
prerr_newline ();
$Err.abort {void} ()
end | ~None_vt _ => ()
end
fn the_d2expenv_save () = $SymEnv.symenv_save (the_d2expenv)
fn the_d2expenv_restore () = $SymEnv.symenv_restore (the_d2expenv)
end
assume staload_level_token = unit_v
local
val the_staload_level = ref_make_elt<int> (0)
in
implement staload_level_get_level () = !the_staload_level
implement staload_level_push () = let
val (vbox pf | p) = ref_get_view_ptr (the_staload_level)
val () = !p := !p + 1
in
(unit_v () | ())
end
implement staload_level_pop (pf | ) = let
prval unit_v () = pf
val (vbox pf | p) = ref_get_view_ptr (the_staload_level)
in
!p := !p - 1
end
end
assume trans2_env_token = @(unit_v, unit_v, unit_v)
implement
trans2_env_pop (pf | ) = let
val () = $NS.the_namespace_pop ()
val () = the_s2rtenv_pop (pf.0 | )
val () = the_s2expenv_pop (pf.1 | )
val () = the_d2expenv_pop (pf.2 | )
in
end
implement
trans2_env_push () = let
val () = $NS.the_namespace_push ()
val (pf0 | ()) = the_s2rtenv_push ()
val (pf1 | ()) = the_s2expenv_push ()
val (pf2 | ()) = the_d2expenv_push ()
in
(@(pf0, pf1, pf2) | ())
end
implement
trans2_env_localjoin (pf1, pf2 | ) = let
val () = $NS.the_namespace_localjoin ()
val () = the_s2rtenv_localjoin (pf1.0, pf2.0 | )
val () = the_s2expenv_localjoin (pf1.1, pf2.1 | )
val () = the_d2expenv_localjoin (pf1.2, pf2.2 | )
in
end
implement
trans2_env_save () = () where {
val () = $NS.the_namespace_save ()
val () = the_s2rtenv_save ()
val () = the_s2expenv_save ()
val () = the_d2expenv_save ()
}
implement
trans2_env_restore () = () where {
val () = $NS.the_namespace_restore ()
val () = the_s2rtenv_restore ()
val () = the_s2expenv_restore ()
val () = the_d2expenv_restore ()
}
implement
trans2_env_pervasive_add_topenv () = () where {
val () = the_s2rtenv_pervasive_add_topenv ()
val () = the_s2expenv_pervasive_add_topenv ()
val () = the_d2expenv_pervasive_add_topenv ()
}
implement
trans2_env_namespace_add_topenv (id) = () where {
val () = the_s2rtenv_namespace_add_topenv (id)
val () = the_s2expenv_namespace_add_topenv (id)
val () = the_d2expenv_namespace_add_topenv (id)
}
implement
trans2_env_initialize () = begin
the_s2rtenv_add ($Sym.symbol_ADDR, S2TEsrt s2rt_addr);
the_s2rtenv_add ($Sym.symbol_BOOL, S2TEsrt s2rt_bool);
the_s2rtenv_add ($Sym.symbol_CHAR, S2TEsrt s2rt_char);
the_s2rtenv_add ($Sym.symbol_CLS, S2TEsrt s2rt_cls);
the_s2rtenv_add ($Sym.symbol_EFF, S2TEsrt s2rt_eff);
the_s2rtenv_add ($Sym.symbol_INT, S2TEsrt s2rt_int);
the_s2rtenv_add ($Sym.symbol_PROP, S2TEsrt s2rt_prop);
the_s2rtenv_add ($Sym.symbol_TYPE, S2TEsrt s2rt_type);
the_s2rtenv_add ($Sym.symbol_T0YPE, S2TEsrt s2rt_t0ype);
the_s2rtenv_add ($Sym.symbol_VIEW, S2TEsrt s2rt_view);
the_s2rtenv_add ($Sym.symbol_VIEWTYPE, S2TEsrt s2rt_viewtype);
the_s2rtenv_add ($Sym.symbol_VIEWT0YPE, S2TEsrt s2rt_viewt0ype);
the_s2rtenv_add ($Sym.symbol_TYPES, S2TEsrt s2rt_types);
the_s2rtenv_pervasive_add_topenv ();
the_d2expenv_add ($Sym.symbol_LRBRACKETS, D2ITEMsymdef nil);
the_d2expenv_pervasive_add_topenv ()
end