Keep params in Obc

Remember the parameters of the called node in the 
parametrized version of Obc.
This commit is contained in:
Cédric Pasteur 2010-07-22 09:44:57 +02:00
parent 1be9f1c789
commit c12f1add0c
3 changed files with 7 additions and 4 deletions

View file

@ -313,7 +313,8 @@ and mk_node_call map call_context app loc name_list args =
match app.Minils.a_op with
| Minils.Enode f | Minils.Efun f ->
let o = mk_obj_call_from_context call_context (gen_obj_name f) in
let j = [(o, f, size_from_call_context call_context, loc)] in
let j = [(o, f, app.Minils.a_params,
size_from_call_context call_context, loc)] in
let si =
(match app.Minils.a_op with
| Minils.Efun _ -> []
@ -395,8 +396,8 @@ let var_decl l =
List.map (fun (x, t) -> mk_var_dec x t) l
let obj_decl l =
List.map (fun (x, t, i, loc) ->
{ o_name = obj_call_name x; o_class = t;
List.map (fun (x, t, p, i, loc) ->
{ o_name = obj_call_name x; o_class = t; o_params = p;
o_size = i; o_loc = loc }) l
let translate_contract map mem_vars =

View file

@ -80,6 +80,7 @@ and var_dec =
type obj_dec =
{ o_name : obj_name;
o_class : instance_name;
o_params : static_exp list;
o_size : static_exp option;
o_loc : location }

View file

@ -15,8 +15,9 @@ let print_vd ff vd =
let print_obj ff o =
fprintf ff "@[<v>"; print_name ff o.o_name;
fprintf ff " : "; print_longname ff o.o_class;
fprintf ff "@[<2>%a@]" (print_list_r print_static_exp "<<"","">>") o.o_params;
(match o.o_size with
| Some se -> print_static_exp ff se;
| Some se -> fprintf ff "[%a]" print_static_exp se
| None -> ());
fprintf ff ";@]"