Project

General

Profile

Revision 3d85297f src/backends/Ada/ada_backend_common.ml

View differences:

src/backends/Ada/ada_backend_common.ml
32 32
   @param machine the machine
33 33
*)
34 34
let pp_end_package fmt machine =
35
  fprintf fmt "end %a;" pp_package_name machine
35
  fprintf fmt "end %a" pp_package_name machine
36 36

  
37 37

  
38 38
(* Type pretty print functions *)
......
145 145

  
146 146
(* Prototype pretty print functions *)
147 147

  
148
(** Print the name of the init procedure **)
149
let pp_init_procedure_name fmt = fprintf fmt "init"
150

  
151
(** Print the step of the init procedure **)
152
let pp_step_procedure_name fmt = fprintf fmt "step"
153

  
154
(** Print the reset of the init procedure **)
155
let pp_reset_procedure_name fmt = fprintf fmt "reset"
156

  
157
(** Print the clear of the init procedure **)
158
let pp_clear_procedure_name fmt = fprintf fmt "clear"
159

  
148 160
(** Print the prototype of a machine procedure. The first parameter is always
149 161
the state, state_modifier specify the modifier applying to it. The next
150 162
parameters are inputs and the last parameters are the outputs.
......
154 166
   @param input list of the input parameter of the procedure
155 167
   @param output list of the output parameter of the procedure
156 168
*)
157
let pp_simple_prototype fmt (name, state_mode, input, output) =
158
  fprintf fmt "procedure %s(@[<v>%a%t@[%a@]%t@[%a@])@]"
159
    name
169
let pp_simple_prototype fmt (pp_name, state_mode, input, output) =
170
  fprintf fmt "procedure %t(@[<v>%a%t@[%a@]%t@[%a@])@]"
171
    pp_name
160 172
    pp_state_var_decl state_mode
161 173
    (Utils.pp_final_char_if_non_empty ",@," input)
162 174
    (Utils.fprintf_list ~sep:",@ " (pp_machine_var_decl In)) input
......
168 180
   @param m the machine
169 181
*)
170 182
let pp_init_prototype fmt m =
171
  pp_simple_prototype fmt ("init", Out, m.mstatic, [])
183
  pp_simple_prototype fmt (pp_init_procedure_name, Out, m.mstatic, [])
172 184

  
173 185
(** Print the prototype of the step procedure of a machine.
174 186
   @param fmt the formater to print on
175 187
   @param m the machine
176 188
*)
177 189
let pp_step_prototype fmt m =
178
  pp_simple_prototype fmt ("step", InOut, m.mstep.step_inputs, m.mstep.step_outputs)
190
  pp_simple_prototype fmt (pp_step_procedure_name, InOut, m.mstep.step_inputs, m.mstep.step_outputs)
179 191

  
180 192
(** Print the prototype of the reset procedure of a machine.
181 193
   @param fmt the formater to print on
182 194
   @param m the machine
183 195
*)
184 196
let pp_reset_prototype fmt m =
185
  pp_simple_prototype fmt ("reset", InOut, m.mstatic, [])
197
  pp_simple_prototype fmt (pp_reset_procedure_name, InOut, m.mstatic, [])
186 198

  
187 199
(** Print the prototype of the clear procedure of a machine.
188 200
   @param fmt the formater to print on
189 201
   @param m the machine
190 202
*)
191 203
let pp_clear_prototype fmt m =
192
  pp_simple_prototype fmt ("clear", InOut, m.mstatic, [])
204
  pp_simple_prototype fmt (pp_clear_procedure_name, InOut, m.mstatic, [])

Also available in: Unified diff