Project

General

Profile

Revision 903317e7 src/backends/Ada/ada_backend_wrapper.ml

View differences:

src/backends/Ada/ada_backend_wrapper.ml
24 24
   @param instrs list of instructions printer
25 25
**)
26 26
let pp_main_procedure_definition machine fmt (locals, instrs) =
27
    let pp_name = pp_main_procedure_name machine in
27 28
    pp_procedure_definition
28
      (pp_main_procedure_name machine)
29
      pp_simple_prototype
29
      pp_name
30
      (pp_simple_prototype pp_name)
30 31
      (fun fmt local -> fprintf fmt "%t" local)
31 32
      (fun fmt instr -> fprintf fmt "%t" instr)
32 33
      fmt
......
37 38
   @param fmt the formater to print on
38 39
   @param instance node
39 40
**)
40
let pp_node_init_call name fmt node =
41
let pp_node_reset_call name fmt node =
41 42
  let pp_package fmt = pp_package_name fmt node in
42 43
  let pp_type fmt = pp_package_access fmt (pp_package, pp_state_type) in
43 44
  let pp_name fmt = pp_clean_ada_identifier fmt name in
......
54 55
  let apply_pp_var_decl var fmt = pp_machine_var_decl NoMode fmt var in
55 56
  let locals = List.map apply_pp_var_decl step_parameters in
56 57
  let locals = pp_local_state_var_decl::locals in
57
  let pp_init fmt =
58
    fprintf fmt "%a.init(%s)"
58
  let pp_reset fmt =
59
    fprintf fmt "%a.reset(%s)"
59 60
      pp_package_name machine.mname
60 61
      stateVar in
61 62
  let pp_loop fmt =
......
64 65
      stateVar
65 66
      (Utils.fprintf_list ~sep:",@ " pp_var_name) step_parameters
66 67
      in
67
  let instrs = [pp_init; pp_loop] in
68
  let instrs = [pp_reset; pp_loop] in
68 69
  fprintf fmt "@[<v>%a;@,@,%a;@]"
69 70
    pp_with_node machine.mname
70 71
    (pp_main_procedure_definition machine) (locals, instrs)

Also available in: Unified diff