OpenAADL / ocarina

@@ -6,7 +6,8 @@
Loading
6 6
--                                                                          --
7 7
--                                 B o d y                                  --
8 8
--                                                                          --
9 +
--                   Copyright (C) 2010-2019 ESA & ISAE,                    --
10 +
--                     2019-2021 OpenAADL, 2021 NVIDIA                      --
9 11
--                                                                          --
10 12
-- Ocarina  is free software; you can redistribute it and/or modify under   --
11 13
-- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -29,6 +30,8 @@
Loading
29 30
--                                                                          --
30 31
------------------------------------------------------------------------------
31 32
33 +
with GNAT.OS_Lib;
34 +
32 35
with Ocarina.Instances;
33 36
with Ocarina.Backends.Expander;
34 37
with Ocarina.Backends.Messages;
@@ -37,6 +40,9 @@
Loading
37 40
with Ocarina.Backends.XML_Tree.Nodes;
38 41
with Ocarina.Backends.XML_Tree.Nutils;
39 42
with Ocarina.Backends.XML_Tree.Generator;
43 +
with Ocarina.Namet;
44 +
with Ocarina.Output;
45 +
with Ocarina.Options;
40 46
41 47
package body Ocarina.Backends.Cheddar is
42 48
@@ -58,8 +64,12 @@
Loading
58 64
   --------------
59 65
60 66
   procedure Generate (AADL_Root : Node_Id) is
61 -
      Instance_Root : Node_Id;
67 +
      use GNAT.OS_Lib;
68 +
      use Ocarina.Namet;
69 +
      use Ocarina.Output;
70 +
      use Ocarina.Options;
62 71
72 +
      Instance_Root : Node_Id;
63 73
   begin
64 74
      Instance_Root := Instantiate_Model (AADL_Root);
65 75
@@ -79,15 +89,26 @@
Loading
79 89
         Display_Error ("XML generation failed", Fatal => True);
80 90
      end if;
81 91
82 -
      Create_Directory (Generated_Sources_Directory);
92 +
      if Output_Filename /= No_Name and then
93 +
         not Is_Directory (Get_Name_String (Output_Filename))
94 +
      then
95 +
         --  Create the output file based on the given file name
83 96
84 -
      Enter_Directory (Generated_Sources_Directory);
97 +
         Set_Output
98 +
            (Create_File
99 +
               (Get_Name_String (Output_Filename),
100 +
               Binary));
101 +
         XML_Tree.Generator.Generate (XML_Root);
102 +
      else
103 +
         --  Enter to the given directory and let the XML generator
104 +
         --  determine the output file name
85 105
86 -
      --  Create the XML file
106 +
         Enter_Directory (Generated_Sources_Directory);
87 107
88 -
      XML_Tree.Generator.Generate (XML_Root);
108 +
         XML_Tree.Generator.Generate (XML_Root);
89 109
90 -
      Leave_Directory;
110 +
         Leave_Directory;
111 +
      end if;
91 112
   end Generate;
92 113
93 114
   ----------
Files Coverage
src 70.60%
Project Totals (369 files) 70.60%
1
ignore:
2
  - "tools/mknodes"
3
  - "src/frontends/aadl_ema"
4
  - "src/frontends/ao4aadl"
5
  - "src/transfo"
6
  - "doc"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading