Project

General

Profile

Revision fd8aeeac

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 *)
src/backends/Ada/ada_backend_common.ml
11 11
(* Misc pretty print functions *)
12 12

  
13 13
(** Print a cleaned an identifier for ada exportation : Ada names must not start by an
14
    underscore and must not contain a double underscore 
14
    underscore and must not contain a double underscore
15 15
   @param var name to be cleaned*)
16 16
let pp_clean_ada_identifier fmt name =
17 17
  let base_size = String.length name in
......
86 86
**)
87 87
let extract_node instance =
88 88
  let (_, (node, _)) = instance in
89
  match node.top_decl_desc with 
89
  match node.top_decl_desc with
90 90
    | Node nd         -> nd
91 91
    | _ -> assert false (*TODO*)
92 92

  
......
144 144
   @param fmt the formater to print on
145 145
   @param id the variable
146 146
**)
147
let pp_var_type fmt id = 
147
let pp_var_type fmt id =
148 148
  (match (Types.repr id.var_type).Types.tdesc with
149 149
    | Types.Tbasic Types.Basic.Tint -> pp_integer_type fmt
150 150
    | Types.Tbasic Types.Basic.Treal -> pp_float_type fmt
......
233 233
(** Print the name of the init procedure **)
234 234
let pp_init_procedure_name fmt = fprintf fmt "init"
235 235

  
236
(** Print the step of the init procedure **)
236
(** Print the name of the step procedure **)
237 237
let pp_step_procedure_name fmt = fprintf fmt "step"
238 238

  
239
(** Print the reset of the init procedure **)
239
(** Print the name of the reset procedure **)
240 240
let pp_reset_procedure_name fmt = fprintf fmt "reset"
241 241

  
242
(** Print the clear of the init procedure **)
242
(** Print the name of the clear procedure **)
243 243
let pp_clear_procedure_name fmt = fprintf fmt "clear"
244 244

  
245 245
(** Print the prototype of a procedure with non input/outputs
......
320 320
    (Utils.fprintf_list ~sep:";@," pp_instr) instrs
321 321
    (Utils.pp_final_char_if_non_empty ";" instrs)
322 322
    pp_name
323

  

Also available in: Unified diff