Revision 6e7164b1
Added by Pierre-Loïc Garoche over 10 years ago
src/main_lustre_compiler.ml | ||
---|---|---|
35 | 35 |
try |
36 | 36 |
Stateless.check_prog decls |
37 | 37 |
with (Stateless.Error (loc, err)) as exc -> |
38 |
Format.eprintf "Stateless status error at loc %a: %a@."
|
|
39 |
Location.pp_loc loc
|
|
40 |
Stateless.pp_error err;
|
|
38 |
eprintf "Stateless status error %a%a@."
|
|
39 |
Stateless.pp_error err
|
|
40 |
Location.pp_loc loc;
|
|
41 | 41 |
raise exc |
42 | 42 |
|
43 | 43 |
let type_decls env decls = |
... | ... | |
47 | 47 |
try |
48 | 48 |
Typing.type_prog env decls |
49 | 49 |
with (Types.Error (loc,err)) as exc -> |
50 |
Format.eprintf "Typing error at loc %a: %a@."
|
|
51 |
Location.pp_loc loc
|
|
52 |
Types.pp_error err;
|
|
50 |
eprintf "Typing error %a%a@."
|
|
51 |
Types.pp_error err
|
|
52 |
Location.pp_loc loc;
|
|
53 | 53 |
raise exc |
54 | 54 |
end |
55 | 55 |
in |
... | ... | |
64 | 64 |
try |
65 | 65 |
Clock_calculus.clock_prog env decls |
66 | 66 |
with (Clocks.Error (loc,err)) as exc -> |
67 |
Location.print loc; |
|
68 |
eprintf "Clock calculus error at loc %a: %a@." Location.pp_loc loc Clocks.pp_error err; |
|
67 |
eprintf "Clock calculus error %a%a@." Clocks.pp_error err Location.pp_loc loc; |
|
69 | 68 |
raise exc |
70 | 69 |
end |
71 | 70 |
in |
... | ... | |
88 | 87 |
Parse.report_error err; |
89 | 88 |
raise exc |
90 | 89 |
| Corelang.Error (loc, err) as exc -> ( |
91 |
Format.eprintf "Parsing error at loc %a: %a@."
|
|
92 |
Location.pp_loc loc
|
|
93 |
Corelang.pp_error err;
|
|
90 |
eprintf "Parsing error %a%a@."
|
|
91 |
Corelang.pp_error err
|
|
92 |
Location.pp_loc loc;
|
|
94 | 93 |
raise exc |
95 | 94 |
) |
96 | 95 |
|
... | ... | |
118 | 117 |
Parse.report_error err; |
119 | 118 |
raise exc |
120 | 119 |
| Corelang.Error (loc, err) as exc -> |
121 |
Format.eprintf "Parsing error at loc %a: %a@."
|
|
122 |
Location.pp_loc loc
|
|
123 |
Corelang.pp_error err;
|
|
120 |
eprintf "Parsing error %a%a@."
|
|
121 |
Corelang.pp_error err
|
|
122 |
Location.pp_loc loc;
|
|
124 | 123 |
raise exc |
125 | 124 |
in |
126 | 125 |
(* Extracting dependencies *) |
... | ... | |
144 | 143 |
Env.overwrite type_env lusi_type_env, |
145 | 144 |
Env.overwrite clock_env lusi_clock_env |
146 | 145 |
with Sys_error msg -> ( |
147 |
Format.eprintf "Failure: impossible to load library %s.@.%s@." s msg;
|
|
146 |
eprintf "Failure: impossible to load library %s.@.%s@." s msg; |
|
148 | 147 |
exit 1 |
149 | 148 |
) |
150 | 149 |
) ([], Basic_library.type_env, Basic_library.clock_env) dependencies |
... | ... | |
233 | 232 |
Printers.pp_lusi_header lusi_fmt source_name prog |
234 | 233 |
) |
235 | 234 |
| (Types.Error (loc,err)) as exc -> |
236 |
Format.eprintf "Type mismatch between computed type and declared type in lustre interface file: %a@."
|
|
235 |
eprintf "Type mismatch between computed type and declared type in lustre interface file: %a@." |
|
237 | 236 |
Types.pp_error err; |
238 | 237 |
raise exc |
239 | 238 |
| Clocks.Error (loc, err) as exc -> |
240 |
Format.eprintf "Clock mismatch between computed clock and declared clock in lustre interface file: %a@."
|
|
239 |
eprintf "Clock mismatch between computed clock and declared clock in lustre interface file: %a@." |
|
241 | 240 |
Clocks.pp_error err; |
242 | 241 |
raise exc |
243 | 242 |
| Stateless.Error (loc, err) as exc -> |
244 |
Format.eprintf "Stateless status mismatch between defined status and declared status in lustre interface file: %a@."
|
|
243 |
eprintf "Stateless status mismatch between defined status and declared status in lustre interface file: %a@." |
|
245 | 244 |
Stateless.pp_error err; |
246 | 245 |
raise exc |
247 | 246 |
in |
... | ... | |
275 | 274 |
Unix.mkdir !Options.dest_dir (Unix.stat ".").Unix.st_perm |
276 | 275 |
); |
277 | 276 |
if (Unix.stat !Options.dest_dir).Unix.st_kind <> Unix.S_DIR then ( |
278 |
Format.eprintf "Failure: destination %s is not a directory.@.@." !Options.dest_dir;
|
|
277 |
eprintf "Failure: destination %s is not a directory.@.@." !Options.dest_dir; |
|
279 | 278 |
exit 1 |
280 | 279 |
); |
281 | 280 |
(* Printing code *) |
Also available in: Unified diff
Math lusi (trigo)
git-svn-id: https://cavale.enseeiht.fr/svn/lustrec/lustre_compiler/trunk@253 041b043f-8d7c-46b2-b46e-ef0dd855326e