Project

General

Profile

Revision fd8aeeac src/backends/Ada/ada_backend_adb.ml

View differences:

src/backends/Ada/ada_backend_adb.ml
101 101
      @param var_name the name of the variable
102 102
      @param value the value to be assigned
103 103
   **)
104
  (* TODO remove pp_var *)
104 105
  let pp_basic_assign pp_var fmt var_name value =
105 106
    fprintf fmt "%a := %a;"
106 107
      pp_var var_name
......
116 117
   **)
117 118
  let pp_assign pp_var fmt var_name value = pp_basic_assign
118 119

  
120
  (* Printing function for reset function *)
121
  (* TODO: clean the call to extract_node *)
122
  (** Printing function for reset function name.
123

  
124
      @param fmt the formater to use
125
      @param encapsulated_node the node encapsulated in a pair
126
             [(instance, (node, static))]
127
   **)
128
  let pp_machine_reset_name fmt encapsulated_node =
129
    fprintf fmt "%a.reset" pp_package_name (extract_node encapsulated_node)
130

  
131
  (** Printing function for reset function.
132

  
133
      @param machine the considered machine
134
      @param fmt the formater to use
135
      @param instance the considered instance
136
   **)
137
  let pp_machine_reset (machine: machine_t) fmt instance =
138
    let (node, static) =
139
      try
140
        List.assoc instance machine.minstances
141
      with Not_found -> (Format.eprintf "internal error: pp_machine_reset %s %s:@." machine.mname.node_id instance; raise Not_found) in
142
    fprintf fmt "%a(state.%s);"
143
      pp_machine_reset_name (instance, (node, static))
144
      instance
145

  
119 146
  (** Printing function for instruction. See
120 147
      {!type:Machine_code_types.instr_t} for more details on
121 148
      machine types.
......
130 157
    | MNoReset _ -> ()
131 158
    (* reset  *)
132 159
    | MReset i ->
133
      (* pp_machine_reset m self fmt i *)
134
      fprintf fmt "MReset %s@ " i
160
      pp_machine_reset machine fmt i
135 161
    | MLocalAssign (i,v) ->
136
      fprintf fmt "MLocalAssign";
162
      fprintf fmt "MLocalAssign @"
163
      (* pp_basic_assign pp_var_name fmt i v *)
137 164
      (* pp_assign
138 165
       *   machine self (pp_c_var_read m) fmt
139 166
       *   i.var_type (mk_val (Var i) i.var_type) v *)

Also available in: Unified diff