deployment_view.ads 1.74 KB
Newer Older
1
2
3
4
5
6
7
8
9
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
--  *************************** taste aadl parser ***********************  --
--  (c) 2017 European Space Agency - maxime.perrotin@esa.int
--  LGPL license, see LICENSE file

--  Deployment View parser

with Ocarina,
     Ocarina.Types,
     --  Ocarina.Backends.Properties,
     Ada.Containers.Indefinite_Ordered_Maps,
     Ada.Containers.Indefinite_Vectors,
     Ada.Strings.Unbounded,
     --  Option_Type,
     Parser_Utils;

use Ocarina,
    Ocarina.Types,
    --  Ocarina.Backends.Properties,
    Ada.Containers,
    Ada.Strings.Unbounded,
    Parser_Utils;

package Deployment_View is

   use Option_UString;
   use Option_ULL;

   --  Exceptions specific to the deployment view
   Deployment_View_Error       : exception;
   Empty_Deployment_View_Error : exception;

   --  Initialize Ocarina and instantiate the deployment view, return root.
   function Initialize (Root : Node_Id) return Node_Id
   with Pre => Root /= No_Node;

   type Taste_Node is
      record
         Name : Unbounded_String;
      end record;

   package Node_Maps is new Indefinite_Ordered_Maps (String, Taste_Node);

   type Taste_Bus is
      record
Maxime Perrotin's avatar
Maxime Perrotin committed
45
46
47
48
         Name         : Unbounded_String;
         AADL_Package : Unbounded_String;
         Classifier   : Unbounded_String;
         Properties   : Property_Maps.Map;
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
      end record;

   package Taste_Busses is new Indefinite_Vectors (Natural, Taste_Bus);

   type Complete_Deployment_View is tagged
      record
         Nodes  : Node_Maps.Map;
         Busses : Taste_Busses.Vector;
      end record;

   --  Function to build up the Ada AST by transforming the one from Ocarina
   function AADL_To_Ada_DV (System : Node_Id) return Complete_Deployment_View;

   procedure Debug_Dump_DV (DV : Complete_Deployment_View);

end Deployment_View;