ocarina-backends.ads 4.68 KB
Newer Older
1
2
3
4
5
6
7
8
------------------------------------------------------------------------------
--                                                                          --
--                           OCARINA COMPONENTS                             --
--                                                                          --
--                     O C A R I N A . B A C K E N D S                      --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
9
--          Copyright (C) 2008-2011, European Space Agency (ESA).           --
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--                                                                          --
-- Ocarina  is free software;  you  can  redistribute  it and/or  modify    --
-- it under terms of the GNU General Public License as published by the     --
-- Free Software Foundation; either version 2, or (at your option) any      --
-- later version. Ocarina is distributed  in  the  hope  that it will be    --
-- useful, but WITHOUT ANY WARRANTY;  without even the implied warranty of  --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received  a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING.   --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA.                                       --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable to be   --
-- covered  by the  GNU  General  Public  License. This exception does not  --
-- however invalidate  any other reasons why the executable file might be   --
-- covered by the GNU Public License.                                       --
--                                                                          --
--                 Ocarina is maintained by the Ocarina team                --
--                       (ocarina-users@listes.enst.fr)                     --
--                                                                          --
------------------------------------------------------------------------------

--  This package is the root of all the source code generators of
--  Ocarina. It provides routines to register and select a code
--  generators. All the code generators should be implemented as child
--  packages of Ocarina.Backends. All the calls to these generators
--  have to be done through the procedure Generate exported by this
--  package. After selecting the wanted code generator.

with Types; use Types;

package Ocarina.Backends is

   type Backend_Subprogram is access procedure (Instance : Node_Id);
   --  Each code generator has to define such a subprogram. Instance
   --  is the root of the AADL instance tree from which the user wants
   --  to generate the code.

   type Backend_Kind is
     (Invalid_Backend,
      AADL,
      AADL_Min,
      AADL_Annex,
55
      AADLXML,
56
      ASN1_Deployment,
57
      Behavior_PP,
58
      Bound_T,
59
60
61
      Carts_XML,
      Cheddar_XML,
      Connection_Matrix_Analysis,
62
      Functions_Matrix_Analysis,
63
      MAST_Scheduling,
64
65
66
67
      Petri_Nets,
      PolyORB_HI_Ada,
      PolyORB_HI_C,
      PolyORB_HI_RTSJ,
68
69
      PolyORB_Kernel_C,
      PolyORB_QoS_Ada,
70
71
      Statistics,
      Subprograms_Generator,
72
      Xtratum_Configuration,
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
      REAL_PP,
      REAL_Theorem);
   --  Supported code generators. For each kind, at most one generator
   --  must be implemented.

   procedure Register_Backend
     (Name    : String;
      Process : Backend_Subprogram;
      Kind    : Backend_Kind);
   --  Register a new backend.

   function Get_Current_Backend_Kind return Backend_Kind;
   procedure Set_Current_Backend_Name (Name : String);
   function Get_Current_Backend_Name return Name_Id;

   procedure Generate_Code
     (Root         : Node_Id;
      Backend_Name : Name_Id  := No_Name);
   --  Call the backend name if it is set or the current backend name
   --  set in the command line. If the backend name and the current
   --  backend name are set, backend name has the priority.

   procedure Init;
   --  Initialize the Backends module by registering the several
   --  implemented code generators.

   procedure Reset;
   --  Resets the Backends module by resetting the node entries of
   --  the several trees.

   procedure Usage;
   --  Print usage for all registered backends

end Ocarina.Backends;