Project

General

Profile

Revision 52cfee34 src/main_lustre_compiler.ml

View differences:

src/main_lustre_compiler.ml
30 30

  
31 31
let extensions = [".ec"; ".lus"; ".lusi"]
32 32

  
33
let check_stateless_decls decls =
34
  report ~level:1 (fun fmt -> fprintf fmt ".. checking stateless/stateful status@,@?");
35
  try
36
    List.iter (fun td -> ignore (Corelang.check_stateless_node td)) decls
37
  with (Corelang.Error (loc, err)) as exc ->
38
    Format.eprintf "Stateless status error at loc %a: %a@]@."
39
      Location.pp_loc loc
40
      Corelang.pp_error err;
41
    raise exc
42

  
33 43
let type_decls env decls =  
34 44
  report ~level:1 (fun fmt -> fprintf fmt ".. typing@,@?");
35 45
  let new_env = 
......
77 87
  | (Lexer_lustre.Error err) | (Parse.Syntax_err err) as exc -> 
78 88
    Parse.report_error err;
79 89
    raise exc
80
  | Corelang.Error (err, loc) as exc ->
90
  | Corelang.Error (loc, err) as exc ->
81 91
     Format.eprintf "Parsing error at loc %a: %a@]@."
82 92
       Location.pp_loc loc
83 93
       Corelang.pp_error err;
......
104 114
    | (Lexer_lustre.Error err) | (Parse.Syntax_err err) as exc -> 
105 115
      Parse.report_error err;
106 116
      raise exc
107
    | Corelang.Error (err, loc) as exc ->
117
    | Corelang.Error (loc, err) as exc ->
108 118
      Format.eprintf "Parsing error at loc %a: %a@]@."
109 119
	Location.pp_loc loc
110 120
	Corelang.pp_error err;
......
141 151
  (* Sorting nodes *)
142 152
  let prog = SortProg.sort prog in
143 153
  
154
  (* Checking stateless/stateful status *)
155
  check_stateless_decls prog;
156

  
144 157
  (* Typing *)
145 158
  let computed_types_env = type_decls type_env prog in
146 159
  
......
192 205
      let _, declared_types_env, declared_clocks_env = check_lusi header in
193 206
      (* checking type compatibility with computed types*)
194 207
      Typing.check_env_compat header declared_types_env computed_types_env;
208
      Typing.uneval_prog_generics prog;
195 209
      (* checking clocks compatibility with computed clocks*)
196 210
      Clock_calculus.check_env_compat header declared_clocks_env computed_clocks_env;
197
      Typing.uneval_prog_generics prog;
198 211
      Clock_calculus.uneval_prog_generics prog
199 212
    with Sys_error _ -> ( 
200 213
      (* Printing lusi file is necessary *)

Also available in: Unified diff