lustrec / src / backends / Ada / ada_backend_common.ml @ bdc471f3
History | View | Annotate | Download (904 Bytes)
1 |
open Format |
---|---|
2 |
|
3 |
open Machine_code_types |
4 |
open Lustre_types |
5 |
open Corelang |
6 |
open Machine_code_common |
7 |
|
8 |
(** Print the name of a package associated to a machine. |
9 |
@param fmt the formater to print on |
10 |
@param machine the machine |
11 |
*) |
12 |
let pp_package_name fmt machine = |
13 |
fprintf fmt "%s" machine.mname.node_id |
14 |
|
15 |
|
16 |
(** Print the ada package introduction sentence it can be used for body and |
17 |
declaration. Boolean parameter body should be true if it is a body delcaration. |
18 |
@param fmt the formater to print on |
19 |
@param fmt the formater to print on |
20 |
@param machine the machine |
21 |
*) |
22 |
let pp_begin_package body fmt machine = |
23 |
fprintf fmt "package %s %a is" |
24 |
(if body then "body" else "") |
25 |
pp_package_name machine |
26 |
|
27 |
(** Print the ada package conclusion sentence. |
28 |
@param fmt the formater to print on |
29 |
@param machine the machine |
30 |
*) |
31 |
let pp_end_package fmt machine = |
32 |
fprintf fmt "end %a;" pp_package_name machine |