kazoo.adb 1.64 KB
Newer Older
1
2
3
4
5
--  ******************************* KAZOO  *******************************  --
--  (c) 2017-2021 European Space Agency - maxime.perrotin@esa.int
--  See LICENSE file
--  *********************************************************************** --

Maxime Perrotin's avatar
Maxime Perrotin committed
6
7
with Ada.Exceptions,
     GNAT.OS_Lib,
8
     GNAT.Traceback.Symbolic,
9
     TASTE,
10
     TASTE.AADL_Parser,
Maxime Perrotin's avatar
Maxime Perrotin committed
11
     TASTE.Parser_Utils,
12
     TASTE.Dump;
13
use TASTE.AADL_Parser,
Maxime Perrotin's avatar
Maxime Perrotin committed
14
    TASTE.Parser_Utils;
Maxime Perrotin's avatar
Maxime Perrotin committed
15

Maxime Perrotin's avatar
Maxime Perrotin committed
16
procedure Kazoo is
Maxime Perrotin's avatar
Maxime Perrotin committed
17
begin
taste's avatar
taste committed
18
   declare
19
      Model : TASTE_Model := Parse_Project;
taste's avatar
taste committed
20
   begin
21
22
23
      --  Call Template-based dump backends (convert to xml, graphviz...)
      TASTE.Dump.Dump_Input_Model (Model);

24
      if Model.Configuration.Debug_Flag then
25
         --  Dump not based on templates (deprecated)
26
         Model.Dump;
27
28
      end if;

29
30
31
      if Model.Configuration.Glue then
         Model.Preprocessing;
         Model.Add_Concurrency_View;
32
         Model.Add_CV_Properties;
33
         Model.Concurrency_View.Generate_CV;
Maxime Perrotin's avatar
Maxime Perrotin committed
34
      end if;
35

36
      Model.Generate_Code;
37
38
39
40
41
42

      if Model.Configuration.Generate_Doc then
         Dump_Documentation
           (Output_Folder =>
              Model.Configuration.Output_Dir.Element & "/Dump/Doc");
      end if;
taste's avatar
taste committed
43
   end;
Maxime Perrotin's avatar
Maxime Perrotin committed
44
exception
45
46
   when TASTE.Quit_TASTE =>
      GNAT.OS_Lib.OS_Exit (1);
Maxime Perrotin's avatar
Maxime Perrotin committed
47
   when Error : others =>
48
      Put_Error ("Ending application because of the following error:");
Maxime Perrotin's avatar
Maxime Perrotin committed
49
      Put_Error (Ada.Exceptions.Exception_Message (Error));
50
51
52
      Put_Debug (Ada.Exceptions.Exception_Information (Error));
      Put_Debug ("Symbolic Traceback (use gdb for better output): "
                 & GNAT.Traceback.Symbolic.Symbolic_Traceback (Error));
Maxime Perrotin's avatar
Maxime Perrotin committed
53
      GNAT.OS_Lib.OS_Exit (1);
Maxime Perrotin's avatar
Maxime Perrotin committed
54
end Kazoo;