Revision 86ae18b7 src/compiler_common.ml
src/compiler_common.ml | ||
---|---|---|
10 | 10 |
(********************************************************************) |
11 | 11 |
|
12 | 12 |
open Utils |
13 |
open Format
|
|
13 |
open Format |
|
14 | 14 |
open LustreSpec |
15 | 15 |
open Corelang |
16 | 16 |
|
... | ... | |
50 | 50 |
close_in h_in; |
51 | 51 |
header |
52 | 52 |
with |
53 |
| (Parse.Error err) as exc ->
|
|
53 |
| (Parse.Error err) as exc -> |
|
54 | 54 |
Parse.report_error err; |
55 | 55 |
raise exc |
56 | 56 |
| Corelang.Error (loc, err) as exc -> ( |
... | ... | |
68 | 68 |
Location.init lexbuf source_name; |
69 | 69 |
|
70 | 70 |
(* Parsing *) |
71 |
Log.report ~level:1
|
|
71 |
Log.report ~level:1 |
|
72 | 72 |
(fun fmt -> fprintf fmt ".. parsing source file %s@," source_name); |
73 | 73 |
try |
74 | 74 |
let prog = Parse.prog Parser_lustre.prog Lexer_lustre.token lexbuf in |
... | ... | |
76 | 76 |
close_in s_in; |
77 | 77 |
prog |
78 | 78 |
with |
79 |
| (Parse.Error err) as exc ->
|
|
79 |
| (Parse.Error err) as exc -> |
|
80 | 80 |
Parse.report_error err; |
81 | 81 |
raise exc |
82 | 82 |
| Corelang.Error (loc, err) as exc -> |
... | ... | |
115 | 115 |
Location.pp_loc loc; |
116 | 116 |
raise exc |
117 | 117 |
|
118 |
let type_decls env decls =
|
|
118 |
let type_decls env decls = |
|
119 | 119 |
Log.report ~level:1 (fun fmt -> fprintf fmt ".. typing@ "); |
120 |
let new_env =
|
|
120 |
let new_env = |
|
121 | 121 |
begin |
122 | 122 |
try |
123 | 123 |
Typing.type_prog env decls |
... | ... | |
126 | 126 |
Types.pp_error err |
127 | 127 |
Location.pp_loc loc; |
128 | 128 |
raise exc |
129 |
end
|
|
129 |
end |
|
130 | 130 |
in |
131 | 131 |
if !Options.print_types then |
132 | 132 |
Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 2> %a@]@ " Corelang.pp_prog_type decls); |
133 | 133 |
new_env |
134 |
|
|
135 |
let clock_decls env decls =
|
|
134 |
|
|
135 |
let clock_decls env decls = |
|
136 | 136 |
Log.report ~level:1 (fun fmt -> fprintf fmt ".. clock calculus@ "); |
137 | 137 |
let new_env = |
138 | 138 |
begin |
... | ... | |
221 | 221 |
let is_stateful topdecl = |
222 | 222 |
match topdecl.top_decl_desc with |
223 | 223 |
| Node nd -> (match nd.node_stateless with Some b -> not b | None -> not nd.node_dec_stateless) |
224 |
| ImportedNode nd -> not nd.nodei_stateless
|
|
224 |
| ImportedNode nd -> not nd.nodei_stateless |
|
225 | 225 |
| _ -> false |
226 | 226 |
|
227 | 227 |
|
... | ... | |
248 | 248 |
Log.report ~level:1 (fun fmt -> fprintf fmt "@]@ "); |
249 | 249 |
deps |
250 | 250 |
end |
251 |
|
Also available in: Unified diff