1 |
9c4cc944
|
Corentin Lauverjat
|
open Lustrec.Lustre_types
|
2 |
|
|
open Lustrec.Utils
|
3 |
5fccce23
|
ploc
|
|
4 |
|
|
(* This module is used to load lusic files when open(ing) modules in
|
5 |
|
|
lustre/lusi sources *)
|
6 |
|
|
|
7 |
|
|
(* Load the provided program, either an actual program or a header lusi files:
|
8 |
|
|
- reject program that define imported node
|
9 |
|
|
- reject header that define lustre node
|
10 |
|
|
- inject #include lus file into the program
|
11 |
|
|
- loads #open lusic files
|
12 |
|
|
- record the node name and check that they are uniquely defined
|
13 |
|
|
- build the type/clock env from the imported nodes
|
14 |
|
|
|
15 |
|
|
Returns an extended prog along with dependencies of #open and a type/clock base env.
|
16 |
|
|
*)
|
17 |
9c4cc944
|
Corentin Lauverjat
|
val load: is_header:bool -> program_t -> program_t * dep_t list * ( Lustrec.Typing.type_expr Lustrec.Env.t * Lustrec.Clocks.clock_expr Lustrec.Env.t)
|
18 |
5fccce23
|
ploc
|
|
19 |
|
|
(* Returns an updated env with the type/clock declaration of the program *)
|
20 |
9c4cc944
|
Corentin Lauverjat
|
val get_envs_from_top_decls: program_t -> Lustrec.Typing.type_expr Lustrec.Env.t * Lustrec.Clocks.clock_expr Lustrec.Env.t
|
21 |
5fccce23
|
ploc
|
|