Revision cefc3744
Added by Pierre-Loïc Garoche almost 11 years ago
src/backends/C/c_backend_header.ml | ||
---|---|---|
7 | 7 |
(********************************************************************************************) |
8 | 8 |
(* Header Printing functions *) |
9 | 9 |
(********************************************************************************************) |
10 |
let print_machine_decl_prefix = ref (fun fmt x -> ()) |
|
11 | 10 |
|
12 | 11 |
|
12 |
module type MODIFIERS_HDR = |
|
13 |
sig |
|
14 |
val print_machine_decl_prefix: Format.formatter -> Machine_code.machine_t -> unit |
|
15 |
end |
|
16 |
|
|
17 |
module EmptyMod = |
|
18 |
struct |
|
19 |
let print_machine_decl_prefix = fun fmt x -> () |
|
20 |
end |
|
21 |
|
|
22 |
module Main = functor (Mod: MODIFIERS_HDR) -> |
|
23 |
struct |
|
24 |
|
|
13 | 25 |
let print_import_standard fmt = |
14 | 26 |
fprintf fmt "#include \"%s/include/lustrec/arrow.h\"@.@." Version.prefix |
15 | 27 |
|
... | ... | |
107 | 119 |
|
108 | 120 |
|
109 | 121 |
let print_machine_decl fmt m = |
110 |
!print_machine_decl_prefix fmt m;
|
|
122 |
Mod.print_machine_decl_prefix fmt m;
|
|
111 | 123 |
if fst (get_stateless_status m) then |
112 | 124 |
begin |
113 | 125 |
fprintf fmt "extern %a;@.@." |
... | ... | |
182 | 194 |
(********************************************************************************************) |
183 | 195 |
(* MAIN Header Printing functions *) |
184 | 196 |
(********************************************************************************************) |
185 |
|
|
186 | 197 |
let print_header header_fmt basename prog machines = |
187 | 198 |
(* Include once: start *) |
188 | 199 |
let baseNAME = String.uppercase basename in |
... | ... | |
214 | 225 |
(* Include once: end *) |
215 | 226 |
fprintf header_fmt "#endif@."; |
216 | 227 |
pp_print_newline header_fmt () |
228 |
end |
|
217 | 229 |
|
218 | 230 |
(* Local Variables: *) |
219 | 231 |
(* compile-command:"make -C ../../.." *) |
Also available in: Unified diff
Specialized the prefix/postfix modifiers through functors arguments
git-svn-id: https://cavale.enseeiht.fr/svn/lustrec/lustre_compiler/branches/cleaner_backend@281 041b043f-8d7c-46b2-b46e-ef0dd855326e