ocarina-backends.ads 5.44 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-2009 Telecom ParisTech, 2010-2020 ESA & ISAE.      --
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--                                                                          --
-- Ocarina  is free software; you can redistribute it and/or modify under   --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
-- sion. 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.                     --
--                                                                          --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception,   --
-- version 3.1, as published by the Free Software Foundation.               --
--                                                                          --
-- You should have received a copy of the GNU General Public License and    --
-- a copy of the GCC Runtime Library Exception along with this program;     --
-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
-- <http://www.gnu.org/licenses/>.                                          --
26
--                                                                          --
jhugues's avatar
jhugues committed
27
28
--                 Ocarina is maintained by the TASTE project               --
--                      (taste-users@lists.tuxfamily.org)                   --
29
30
31
32
33
34
35
36
37
38
--                                                                          --
------------------------------------------------------------------------------

--  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.

39
with Ocarina.Types; use Ocarina.Types;
40
41
42
43
44
45
46
47
48
49
50
51
52

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,
yoogx's avatar
yoogx committed
53
      SpaceStudio,
54
      AADLXML,
55
      ASN1_Deployment,
56
      Behavior_PP,
57
      Bound_T,
58
      Cheddar_XML,
59
      Deos_XML,
60
      Vxworks653_XML,
61
      Connection_Matrix_Analysis,
62
      Functions_Matrix_Analysis,
63
      Lnt_S,
64
      MAST_Scheduling,
65
66
67
      Petri_Nets,
      PolyORB_HI_Ada,
      PolyORB_HI_C,
68
      PolyORB_Kernel_C,
69
70
      Statistics,
      Subprograms_Generator,
71
      Xtratum_Configuration,
72
      REAL_PP,
yoogx's avatar
yoogx committed
73
      REAL_Theorem,
74
      FT_Replication,
75
76
77
      Alloy_Backend,
      AIR_Configuration_Backend
     );
78
79
80
81
82
83
84
85
86
87
88
89
90
   --  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;

91
   procedure Generate_Code (Root : Node_Id; Backend_Name : Name_Id := No_Name);
92
93
94
95
   --  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.

96
97
98
99
   function Get_Backend (Backend_Name : Name_Id := No_Name) return Natural;
   --  Return the index of the backend corresponding to the given
   --  name. 0 means no backend was found.

100
101
102
103
104
105
106
107
   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.

108
109
110
111
112
113
114
   procedure Write_Backends (Indent : Natural);
   --  Displays the list of registered generators each one on a new
   --  line indented by 'Indent'.

   Generated_Sources_Directory : Name_Id := No_Name;
   --  Generated code will be in this directory

115
116
117
   Scenario_Dir : String_Ptr;
   --  Path to scenario directory, required to get source path to user code

118
119
   SCM_Version : String_Ptr;

120
121
122
123
124
125
   Compile_Generated_Sources : aliased Boolean := False;
   Remove_Generated_Sources  : aliased Boolean := False;
   Do_Coverage_Test          : aliased Boolean := False;
   Do_Regression_Test        : aliased Boolean := False;
   Generate_ASN1_Deployment  : aliased Boolean := False;
   Add_Performance_Analysis  : aliased Boolean := False;
126
127

end Ocarina.Backends;