lustrec / src / backends / Ada / ada_backend_ads.ml @ 3d85297f
History | View | Annotate | Download (1.66 KB)
1 |
(********************************************************************) |
---|---|
2 |
(* *) |
3 |
(* The LustreC compiler toolset / The LustreC Development Team *) |
4 |
(* Copyright 2012 - -- ONERA - CNRS - INPT - ISAE-SUPAERO *) |
5 |
(* *) |
6 |
(* LustreC is free software, distributed WITHOUT ANY WARRANTY *) |
7 |
(* under the terms of the GNU Lesser General Public License *) |
8 |
(* version 2.1. *) |
9 |
(* *) |
10 |
(********************************************************************) |
11 |
|
12 |
open Format |
13 |
|
14 |
open Machine_code_types |
15 |
open Lustre_types |
16 |
open Corelang |
17 |
open Machine_code_common |
18 |
|
19 |
open Ada_backend_common |
20 |
|
21 |
(** Functions printing the .ads file **) |
22 |
module Main = |
23 |
struct |
24 |
|
25 |
(** Print the package declaration(ads) of a machine. |
26 |
@param fmt the formater to print on |
27 |
@param machine the machine |
28 |
*) |
29 |
let print fmt machine = |
30 |
let pp_record fmt = pp_record_definition fmt machine.mmemory in |
31 |
fprintf fmt "%a@, @[<v>@,%a;@,@,%a;@,@,%a;@,@,%a;@,@,%a;@,@,private@,@,%a;@,@]@,%a;@." |
32 |
(pp_begin_package false) machine (*Begin the package*) |
33 |
pp_private_type_decl pp_state_type (*Declare the state type*) |
34 |
pp_init_prototype machine (*Declare the init procedure*) |
35 |
pp_step_prototype machine (*Declare the step procedure*) |
36 |
pp_reset_prototype machine (*Declare the reset procedure*) |
37 |
pp_clear_prototype machine (*Declare the clear procedure*) |
38 |
pp_type_decl (pp_state_type, pp_record) (*Define the state type*) |
39 |
pp_end_package machine (*End the package*) |
40 |
|
41 |
end |