From 7c0c2e0415bd517b73508a61ce2cf2f80776966e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Tue, 29 Jun 2010 19:02:52 +0200 Subject: [PATCH] v_name -> v_ident for idents.... --- compiler/heptagon/analysis/causality.ml | 2 +- compiler/heptagon/analysis/initialization.ml | 4 ++-- compiler/heptagon/analysis/typing.ml | 4 ++-- compiler/heptagon/hept_printer.ml | 2 +- compiler/heptagon/heptagon.ml | 4 ++-- compiler/heptagon/parsing/scoping.ml | 2 +- compiler/heptagon/transformations/last.ml | 2 +- compiler/main/hept2mls.ml | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler/heptagon/analysis/causality.ml b/compiler/heptagon/analysis/causality.ml index 853cb93..78df620 100644 --- a/compiler/heptagon/analysis/causality.ml +++ b/compiler/heptagon/analysis/causality.ml @@ -90,7 +90,7 @@ let clear env c = clearec c let build dec = - let add acc { v_name = n; } = IdentSet.add n acc in + let add acc { v_ident = n; } = IdentSet.add n acc in List.fold_left add IdentSet.empty dec (** Main typing function *) diff --git a/compiler/heptagon/analysis/initialization.ml b/compiler/heptagon/analysis/initialization.ml index 2228eab..f750eab 100644 --- a/compiler/heptagon/analysis/initialization.ml +++ b/compiler/heptagon/analysis/initialization.ml @@ -327,11 +327,11 @@ and build h dec = | Heptagon.Last(Some _) -> { i_kind = Last(izero); i_typ = izero } | Heptagon.Last(None) -> { i_kind = Last(ione); i_typ = new_var () } in List.fold_left - (fun h { v_name = n; v_last = last } -> Env.add n (kind last) h) h dec + (fun h { v_ident = n; v_last = last } -> Env.add n (kind last) h) h dec let sbuild h dec = List.fold_left - (fun h { v_name = n } -> Env.add n { i_kind = Var; i_typ = izero } h) h dec + (fun h { v_ident = n } -> Env.add n { i_kind = Var; i_typ = izero } h) h dec let typing_contract h contract = match contract with diff --git a/compiler/heptagon/analysis/typing.ml b/compiler/heptagon/analysis/typing.ml index ad3f586..fb0725f 100644 --- a/compiler/heptagon/analysis/typing.ml +++ b/compiler/heptagon/analysis/typing.ml @@ -842,7 +842,7 @@ and typing_block statefull h and build h h0 dec = List.fold_left (fun (acc_dec, acc_defined, h) - ({ v_name = n; v_type = btype; v_last = l; v_loc = loc } as v) -> + ({ v_ident = n; v_type = btype; v_last = l; v_loc = loc } as v) -> try let ty = check_type btype in (* update type longname with module name from check_type *) @@ -897,7 +897,7 @@ let typing_contract statefull h contract = let signature const_env inputs returns params constraints = let arg_dec_of_var_dec vd = - mk_arg (Some (name vd.v_name)) (check_type vd.v_type) + mk_arg (Some (name vd.v_ident)) (check_type vd.v_type) in { node_inputs = List.map arg_dec_of_var_dec inputs; node_outputs = List.map arg_dec_of_var_dec returns; diff --git a/compiler/heptagon/hept_printer.ml b/compiler/heptagon/hept_printer.ml index 9b22b42..a1f5f11 100644 --- a/compiler/heptagon/hept_printer.ml +++ b/compiler/heptagon/hept_printer.ml @@ -43,7 +43,7 @@ and print_c ff = function fprintf ff "^"; print_size_exp ff n -and print_vd ff { v_name = n; v_type = ty; v_last = last } = +and print_vd ff { v_ident = n; v_type = ty; v_last = last } = fprintf ff "@["; begin match last with Last _ -> fprintf ff "last " | _ -> () end; print_ident ff n; diff --git a/compiler/heptagon/heptagon.ml b/compiler/heptagon/heptagon.ml index df24edf..4ce5bd5 100644 --- a/compiler/heptagon/heptagon.ml +++ b/compiler/heptagon/heptagon.ml @@ -102,7 +102,7 @@ and present_handler = { } and var_dec = { - v_name : ident; mutable v_type : ty; v_last : last; v_loc : location + v_ident : ident; mutable v_type : ty; v_last : last; v_loc : location } and last = @@ -168,7 +168,7 @@ let mk_equation ?(statefull = true) desc = { eq_desc = desc; eq_statefull = statefull; eq_loc = no_location; } let mk_var_dec ?(last = Var) name ty = - { v_name = name; v_type = ty; + { v_ident = name; v_type = ty; v_last = last; v_loc = no_location } let mk_block ?(statefull = true) defnames eqs = diff --git a/compiler/heptagon/parsing/scoping.ml b/compiler/heptagon/parsing/scoping.ml index c756f09..0ad88f4 100644 --- a/compiler/heptagon/parsing/scoping.ml +++ b/compiler/heptagon/parsing/scoping.ml @@ -256,7 +256,7 @@ and translate_switch_handler loc const_env env sh = Heptagon.w_block = fst (translate_block const_env env sh.w_block) } and translate_var_dec const_env env vd = - { Heptagon.v_name = Rename.name vd.v_loc env vd.v_name; + { Heptagon.v_ident = Rename.name vd.v_loc env vd.v_name; Heptagon.v_type = translate_type const_env vd.v_type; Heptagon.v_last = translate_last env vd.v_last; Heptagon.v_loc = vd.v_loc } diff --git a/compiler/heptagon/transformations/last.ml b/compiler/heptagon/transformations/last.ml index 3e9f1a9..337b4ee 100644 --- a/compiler/heptagon/transformations/last.ml +++ b/compiler/heptagon/transformations/last.ml @@ -14,7 +14,7 @@ open Ident (* introduce a fresh equation [last_x = pre(x)] for every *) (* variable declared with a last *) -let last (eq_list, env, v) { v_name = n; v_type = t; v_last = last } = +let last (eq_list, env, v) { v_ident = n; v_type = t; v_last = last } = match last with | Var -> (eq_list, env, v) | Last(default) -> diff --git a/compiler/main/hept2mls.ml b/compiler/main/hept2mls.ml index 9db44bb..5c2ea59 100644 --- a/compiler/main/hept2mls.ml +++ b/compiler/main/hept2mls.ml @@ -57,7 +57,7 @@ struct let add l env = Ecomp(env, List.fold_left - (fun acc { Heptagon.v_name = n } -> + (fun acc { Heptagon.v_ident = n } -> IdentSet.add n acc) IdentSet.empty l) (* sample e according to the clock [base on C1(x1) on ... on Cn(xn)] *) @@ -113,7 +113,7 @@ let add_locals ni l_eqs s_eqs s_handlers = s_eqs s_handlers in addrec l_eqs s_eqs s_handlers -let translate_var { Heptagon.v_name = n; Heptagon.v_type = ty; } = +let translate_var { Heptagon.v_ident = n; Heptagon.v_type = ty; } = mk_var_dec n ty let translate_locals locals l =