Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
54df6737
Commit
54df6737
authored
Jun 30, 2014
by
yoogx
Browse files
* Minor reformatting for GNAT GPL 2014 & GCC 4.9.x
parent
78b6cd55
Changes
148
Show whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
20 of 148+
files are displayed.
Plain diff
Email patch
projects/Makefile.am
View file @
54df6737
...
...
@@ -2,25 +2,16 @@ include $(top_srcdir)/Makefile.common
# The order of the project files is important for saving compile time
BUILD_PROJECTS
=
\
ocarina-core.gpr
\
ocarina-frontends.gpr
\
ocarina-backends.gpr
\
ocarina-config.gpr
\
ocarina-transfo.gpr
\
BUILD_PROJECTS
=
ocarina-core.gpr ocarina-frontends.gpr
\
ocarina-backends.gpr ocarina-config.gpr ocarina-transfo.gpr
\
ocarina-main.gpr
# All project files have to be packaged with "make dist"
EXTRA_DIST
=
\
$(srcdir)
/ocarina.gpr.in
\
$(srcdir)
/ocarina-frontends.gpr
\
$(srcdir)
/ocarina-backends.gpr
\
$(srcdir)
/ocarina-core.gpr
\
$(srcdir)
/ocarina-main.gpr
\
$(srcdir)
/ocarina-transfo.gpr
\
$(srcdir)
/ocarina-config.gpr
\
$(srcdir)
/restrictions.adc
EXTRA_DIST
=
$(srcdir)
/ocarina.gpr.in
$(srcdir)
/ocarina-frontends.gpr
\
$(srcdir)
/ocarina-backends.gpr
$(srcdir)
/ocarina-core.gpr
\
$(srcdir)
/ocarina-main.gpr
$(srcdir)
/ocarina-transfo.gpr
\
$(srcdir)
/ocarina-config.gpr
$(srcdir)
/restrictions.adc
BUILD_STAMPS
=
$
(
BUILD_PROJECTS:.gpr
=
.gpr-build
)
...
...
@@ -42,8 +33,7 @@ LIB_DIRS = $(top_builddir)/src/core/libs \
$(top_builddir)
/src/frontends/libs
\
$(top_builddir)
/src/backends/libs
\
$(top_builddir)
/src/transfo/libs
\
$(top_builddir)
/src/config/libs
\
$(top_builddir)
/src/main/libs
$(top_builddir)
/src/config/libs
$(top_builddir)
/src/main/libs
# All directories used for the build process. If the configure is
# performed from a directory different from the top source directory,
...
...
@@ -60,8 +50,7 @@ BUILD_DIRS_STAMPS = $(BUILD_DIRS:=-stamp)
# Pseudo-IDL files that are used to generate the tree manipulators.
TREE_PIDL_SPECS
=
\
src/core/tree/ocarina-me_aadl-aadl_tree-nodes.idl
\
TREE_PIDL_SPECS
=
src/core/tree/ocarina-me_aadl-aadl_tree-nodes.idl
\
src/core/tree/ocarina-me_aadl-aadl_instances-nodes.idl
\
src/core/tree/ocarina-me_aadl_ba-ba_tree-nodes.idl
\
src/core/tree/ocarina-me_real-real_tree-nodes.idl
\
...
...
src/backends/ocarina-backends-aadl_xml-main.adb
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-201
2
ESA & ISAE. --
-- Copyright (C) 2011-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -67,8 +67,8 @@ package body Ocarina.Backends.AADL_XML.Main is
-------------------
function
Map_Component
(
E
:
Node_Id
)
return
Node_Id
is
Category_Name_String
:
constant
array
(
Component_Category
'
Range
)
of
Name_Id
:=
Category_Name_String
:
constant
array
(
Component_Category
'
Range
)
of
Name_Id
:=
(
CC_Abstract
=>
Get_String_Name
(
"abstract"
),
CC_Bus
=>
Get_String_Name
(
"bus"
),
CC_Data
=>
Get_String_Name
(
"data"
),
...
...
@@ -113,8 +113,7 @@ package body Ocarina.Backends.AADL_XML.Main is
Append_Node_To_List
(
Make_Assignement
(
Make_Defining_Identifier
(
Get_String_Name
(
"identifier"
)),
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
E
)))),
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
E
)))),
XTN
.
Items
(
N
));
end
if
;
...
...
@@ -122,8 +121,7 @@ package body Ocarina.Backends.AADL_XML.Main is
Classifier_Node
:=
Make_XML_Node
(
"classifier"
);
Append_Node_To_List
(
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
E
))),
(
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
E
))),
XTN
.
Subitems
(
Classifier_Node
));
Append_Node_To_List
(
Classifier_Node
,
XTN
.
Subitems
(
N
));
...
...
@@ -176,8 +174,7 @@ package body Ocarina.Backends.AADL_XML.Main is
---------------------
procedure
Visit_Component
(
E
:
Node_Id
)
is
Category
:
constant
Component_Category
:=
Get_Category_Of_Component
(
E
);
Category
:
constant
Component_Category
:=
Get_Category_Of_Component
(
E
);
N
:
Node_Id
;
Old_XML_Node
:
Node_Id
;
...
...
@@ -212,10 +209,12 @@ package body Ocarina.Backends.AADL_XML.Main is
XTN
.
Items
(
AADL_XML_Node
));
Append_Node_To_List
(
AADL_XML_Node
,
XTN
.
Subitems
(
XTN
.
Root_Node
(
XTN
.
XML_File
(
U
))));
(
AADL_XML_Node
,
XTN
.
Subitems
(
XTN
.
Root_Node
(
XTN
.
XML_File
(
U
))));
Components_Node
:=
Make_XML_Node
(
"components"
);
Append_Node_To_List
(
Components_Node
,
XTN
.
Subitems
(
AADL_XML_Node
));
(
Components_Node
,
XTN
.
Subitems
(
AADL_XML_Node
));
end
if
;
Current_XML_Node
:=
Components_Node
;
end
if
;
...
...
@@ -240,8 +239,7 @@ package body Ocarina.Backends.AADL_XML.Main is
Append_Node_To_List
(
Make_Assignement
(
Make_Defining_Identifier
(
Get_String_Name
(
"identifier"
)),
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
F
)))),
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
F
)))),
XTN
.
Items
(
Feature_Node
));
-- Direction: in/out/inout
...
...
@@ -270,7 +268,8 @@ package body Ocarina.Backends.AADL_XML.Main is
XTN
.
Items
(
Direction_Node
));
Append_Node_To_List
(
Direction_Node
,
XTN
.
Subitems
(
Feature_Node
));
(
Direction_Node
,
XTN
.
Subitems
(
Feature_Node
));
end
;
-- Type: event/data/event data
...
...
@@ -300,8 +299,7 @@ package body Ocarina.Backends.AADL_XML.Main is
Make_Defining_Identifier
(
Type_Kind
)),
XTN
.
Items
(
Type_Node
));
Append_Node_To_List
(
Type_Node
,
XTN
.
Subitems
(
Feature_Node
));
Append_Node_To_List
(
Type_Node
,
XTN
.
Subitems
(
Feature_Node
));
end
;
-- Classifier
...
...
@@ -315,7 +313,8 @@ package body Ocarina.Backends.AADL_XML.Main is
(
Display_Name
(
Identifier
(
Corresponding_Instance
(
F
)))),
XTN
.
Subitems
(
Classifier_Node
));
Append_Node_To_List
(
Classifier_Node
,
XTN
.
Subitems
(
Feature_Node
));
(
Classifier_Node
,
XTN
.
Subitems
(
Feature_Node
));
end
;
Append_Node_To_List
(
Feature_Node
,
XTN
.
Subitems
(
Features_Node
));
...
...
@@ -350,19 +349,19 @@ package body Ocarina.Backends.AADL_XML.Main is
Append_Node_To_List
(
Make_Assignement
(
Make_Defining_Identifier
(
Get_String_Name
(
"name"
)),
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
F
)))),
Make_Defining_Identifier
(
Display_Name
(
Identifier
(
F
)))),
XTN
.
Items
(
Property_Node
));
Property_Value_Node
:=
Make_XML_Node
(
"property_value"
);
Append_Node_To_List
(
Property_Value_Node
,
XTN
.
Subitems
(
Property_Node
));
(
Property_Value_Node
,
XTN
.
Subitems
(
Property_Node
));
AADL_Property_Value
:=
Get_Value_Of_Property_Association
(
E
,
Name
(
Identifier
(
F
)));
AADL_Property_Value
:=
Get_Value_Of_Property_Association
(
E
,
Name
(
Identifier
(
F
)));
if
Present
(
AADL_Property_Value
)
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_S
IGNED
_AADLN
UMBER
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_S
igned
_AADLN
umber
and
then
Present
(
ATN
.
Unit_Identifier
(
AADL_Property_Value
))
then
-- This property value denotes a property with a unit
...
...
@@ -373,7 +372,8 @@ package body Ocarina.Backends.AADL_XML.Main is
begin
Unit_Node
:=
Make_XML_Node
(
"unit"
);
Append_Node_To_List
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
Append_Node_To_List
(
Make_Assignement
...
...
@@ -391,13 +391,12 @@ package body Ocarina.Backends.AADL_XML.Main is
(
Make_Defining_Identifier
(
Get_String_Name
(
"unit"
)),
Make_Defining_Identifier
(
ATN
.
Display_Name
(
ATN
.
Unit_Identifier
(
AADL_Property_Value
)))),
(
ATN
.
Unit_Identifier
(
AADL_Property_Value
)))),
XTN
.
Items
(
Unit_Node
));
end
;
elsif
Present
(
AADL_Property_Value
)
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_S
IGNED
_AADLN
UMBER
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_S
igned
_AADLN
umber
and
then
(
not
Present
(
ATN
.
Unit_Identifier
(
AADL_Property_Value
)))
then
...
...
@@ -408,7 +407,8 @@ package body Ocarina.Backends.AADL_XML.Main is
begin
Unit_Node
:=
Make_XML_Node
(
"value"
);
Append_Node_To_List
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
Append_Node_To_List
(
Make_Assignement
...
...
@@ -423,7 +423,7 @@ package body Ocarina.Backends.AADL_XML.Main is
end
;
elsif
Present
(
AADL_Property_Value
)
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_L
ITERAL
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_L
iteral
then
-- This property value denotes a literal
...
...
@@ -432,7 +432,8 @@ package body Ocarina.Backends.AADL_XML.Main is
begin
Unit_Node
:=
Make_XML_Node
(
"value"
);
Append_Node_To_List
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
Append_Node_To_List
(
Make_Assignement
...
...
@@ -446,7 +447,7 @@ package body Ocarina.Backends.AADL_XML.Main is
end
;
elsif
Present
(
AADL_Property_Value
)
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_R
EFERENCE_TERM
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_R
eference_Term
then
-- This property value denotes a reference term
...
...
@@ -455,7 +456,8 @@ package body Ocarina.Backends.AADL_XML.Main is
begin
Unit_Node
:=
Make_XML_Node
(
"reference"
);
Append_Node_To_List
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
Append_Node_To_List
(
Make_Assignement
...
...
@@ -470,7 +472,7 @@ package body Ocarina.Backends.AADL_XML.Main is
end
;
elsif
Present
(
AADL_Property_Value
)
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_E
NUMERATION_TERM
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_E
numeration_Term
then
-- This property value denotes an enumeration term
...
...
@@ -479,19 +481,20 @@ package body Ocarina.Backends.AADL_XML.Main is
begin
Unit_Node
:=
Make_XML_Node
(
"value"
);
Append_Node_To_List
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
Append_Node_To_List
(
Make_Assignement
(
Make_Defining_Identifier
(
Get_String_Name
(
"value"
)),
Make_Defining_Identifier
(
ATN
.
Display_Name
(
ATN
.
Identifier
(
AADL_Property_Value
)))),
(
ATN
.
Display_Name
(
ATN
.
Identifier
(
AADL_Property_Value
)))),
XTN
.
Items
(
Unit_Node
));
end
;
elsif
Present
(
AADL_Property_Value
)
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_N
UMBER_RANGE_TERM
and
then
ATN
.
Kind
(
AADL_Property_Value
)
=
ATN
.
K_N
umber_Range_Term
then
-- This property value denotes a number range term
...
...
@@ -500,7 +503,8 @@ package body Ocarina.Backends.AADL_XML.Main is
begin
Unit_Node
:=
Make_XML_Node
(
"range"
);
Append_Node_To_List
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
Append_Node_To_List
(
Make_Assignement
...
...
@@ -528,9 +532,9 @@ package body Ocarina.Backends.AADL_XML.Main is
(
AADL_Property_Value
))))))),
XTN
.
Items
(
Unit_Node
));
if
Present
(
ATN
.
Unit_Identifier
(
ATN
.
Lower_Bound
(
AADL_Property_Value
)))
if
Present
(
ATN
.
Unit_Identifier
(
ATN
.
Lower_Bound
(
AADL_Property_Value
)))
then
Append_Node_To_List
(
Make_Assignement
...
...
@@ -538,8 +542,7 @@ package body Ocarina.Backends.AADL_XML.Main is
Make_Defining_Identifier
(
ATN
.
Display_Name
(
ATN
.
Unit_Identifier
(
ATN
.
Lower_Bound
(
AADL_Property_Value
))))),
(
ATN
.
Lower_Bound
(
AADL_Property_Value
))))),
XTN
.
Items
(
Unit_Node
));
end
if
;
end
;
...
...
@@ -550,15 +553,17 @@ package body Ocarina.Backends.AADL_XML.Main is
declare
Unit_Node
:
Node_Id
;
begin
Unit_Node
:=
Make_XML_Node
(
ATN
.
Kind
(
AADL_Property_Value
)'
Img
);
Unit_Node
:=
Make_XML_Node
(
ATN
.
Kind
(
AADL_Property_Value
)'
Img
);
Append_Node_To_List
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
(
Unit_Node
,
XTN
.
Subitems
(
Property_Value_Node
));
end
;
end
if
;
Append_Node_To_List
(
Property_Node
,
XTN
.
Subitems
(
Properties_Node
));
(
Property_Node
,
XTN
.
Subitems
(
Properties_Node
));
F
:=
Next_Node
(
F
);
end
loop
;
end
if
;
...
...
src/backends/ocarina-backends-aadl_xml-mapping.adb
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-201
2
ESA & ISAE. --
-- Copyright (C) 2011-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -58,7 +58,8 @@ package body Ocarina.Backends.AADL_XML.Mapping is
function
Map_HI_Node
(
E
:
Node_Id
)
return
Node_Id
is
N
:
constant
Node_Id
:=
New_Node
(
XTN
.
K_HI_Node
);
begin
pragma
Assert
(
AINU
.
Is_Process
(
E
)
pragma
Assert
(
AINU
.
Is_Process
(
E
)
or
else
AINU
.
Is_System
(
E
)
or
else
AINU
.
Is_Processor
(
E
));
...
...
@@ -85,14 +86,14 @@ package body Ocarina.Backends.AADL_XML.Mapping is
-- Map_HI_Unit --
-----------------
function
Map_HI_Unit
(
E
:
Node_Id
)
return
Node_Id
is
function
Map_HI_Unit
(
E
:
Node_Id
)
return
Node_Id
is
U
:
Node_Id
;
N
:
Node_Id
;
P
:
Node_Id
;
Root
:
Node_Id
;
begin
pragma
Assert
(
AINU
.
Is_System
(
E
)
pragma
Assert
(
AINU
.
Is_System
(
E
)
or
else
AINU
.
Is_Process
(
E
)
or
else
AINU
.
Is_Processor
(
E
));
...
...
@@ -105,8 +106,7 @@ package body Ocarina.Backends.AADL_XML.Mapping is
else
Get_Name_String
(
To_XML_Name
(
Display_Name
(
Identifier
(
Parent_Subcomponent
(
E
)))));
(
To_XML_Name
(
Display_Name
(
Identifier
(
Parent_Subcomponent
(
E
)))));
end
if
;
Add_Str_To_Name_Buffer
(
"_aadl_xml"
);
...
...
src/backends/ocarina-backends-ada_tree-debug.adb
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -175,9 +175,7 @@ package body Ocarina.Backends.Ada_Tree.Debug is
is
C
:
Node_Id
;
begin
if
A
=
"Next_Node"
or
else
A
=
"Package_Declaration"
then
if
A
=
"Next_Node"
or
else
A
=
"Package_Declaration"
then
return
;
end
if
;
...
...
@@ -191,9 +189,7 @@ package body Ocarina.Backends.Ada_Tree.Debug is
if
K
=
"Name_Id"
then
Write_Line
(
Quoted
(
V
));
elsif
K
=
"Node_Id"
and
then
Present
(
C
)
then
elsif
K
=
"Node_Id"
and
then
Present
(
C
)
then
case
Kind
(
C
)
is
when
K_Boolean
..
K_String
=>
Write_Line
(
'('
&
Image
(
Kind
(
Node_Id
(
N
)))
&
')'
);
...
...
src/backends/ocarina-backends-ada_tree-debug.ads
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
src/backends/ocarina-backends-ada_tree-generator-spark.adb
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -67,22 +67,25 @@ package body Ocarina.Backends.Ada_Tree.Generator.Spark is
-- Initialize withed package lists for a package specification
if
Kind
(
N
)
=
K_Package_Specification
then
LS
:=
Withed_Packages
(
N
);
LB
:=
Withed_Packages
(
Package_Implementation
(
Package_Declaration
(
N
)));
LB
:=
Withed_Packages
(
Package_Implementation
(
Package_Declaration
(
N
)));
-- Initialize withed package lists for a subprogram specification
elsif
Kind
(
N
)
=
K_Subprogram_Specification
then
LS
:=
Withed_Packages
(
N
);
if
Subprogram_Implementation
(
Main_Subprogram_Unit
(
N
))
/=
No_Node
then
LB
:=
Withed_Packages
(
Subprogram_Implementation
(
Main_Subprogram_Unit
(
N
)));
if
Subprogram_Implementation
(
Main_Subprogram_Unit
(
N
))
/=
No_Node
then
LB
:=
Withed_Packages
(
Subprogram_Implementation
(
Main_Subprogram_Unit
(
N
)));
end
if
;
-- Initialize withed package lists for a subprogram implementation
elsif
Kind
(
N
)
=
K_Subprogram_Implementation
then
LS
:=
Withed_Packages
(
N
);
if
Subprogram_Specification
(
Main_Subprogram_Unit
(
N
))
/=
No_Node
then
LB
:=
Withed_Packages
(
Subprogram_Specification
(
Main_Subprogram_Unit
(
N
)));
LB
:=
Withed_Packages
(
Subprogram_Specification
(
Main_Subprogram_Unit
(
N
)));
end
if
;
end
if
;
...
...
src/backends/ocarina-backends-ada_tree-generator.adb
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
3
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -139,10 +139,11 @@ package body Ocarina.Backends.Ada_Tree.Generator is
-------------------
function
Get_File_Name
(
N
:
Node_Id
)
return
Name_Id
is
pragma
Assert
(
Kind
(
N
)
=
K_Package_Specification
or
else
Kind
(
N
)
=
K_Package_Implementation
or
else
Kind
(
N
)
=
K_Subprogram_Specification
or
else
Kind
(
N
)
=
K_Subprogram_Implementation
);
pragma
Assert
(
Kind
(
N
)
=
K_Package_Specification
or
else
Kind
(
N
)
=
K_Package_Implementation
or
else
Kind
(
N
)
=
K_Subprogram_Specification
or
else
Kind
(
N
)
=
K_Subprogram_Implementation
);
Package_Spec_Suffix
:
constant
String
:=
".ads"
;
Package_Body_Suffix
:
constant
String
:=
".adb"
;
...
...
@@ -162,9 +163,7 @@ package body Ocarina.Backends.Ada_Tree.Generator is
Get_Name_String
(
Conventional_Base_Name
(
Fully_Qualified_Name
(
Defining_Identifier
(
Main_Subprogram_Unit
(
N
)))));
(
Defining_Identifier
(
Main_Subprogram_Unit
(
N
)))));
end
if
;
else
if
Has_Custom_File_Name
(
Package_Declaration
(
N
))
then
...
...
@@ -173,9 +172,7 @@ package body Ocarina.Backends.Ada_Tree.Generator is
Get_Name_String
(
Conventional_Base_Name
(
Fully_Qualified_Name
(
Defining_Identifier
(
Package_Declaration
(
N
)))));
(
Defining_Identifier
(
Package_Declaration
(
N
)))));
end
if
;
end
if
;
...
...
@@ -764,20 +761,15 @@ package body Ocarina.Backends.Ada_Tree.Generator is
-- Generate the different part of the component
-- association but add a new line after "=>"
Generate
(
Defining_Identifier
(
Excp_Handler_Alternative
));
Generate
(
Defining_Identifier
(
Excp_Handler_Alternative
));
Write_Space
;
Write
(
Tok_Arrow
);
Write_Eol
;
Increment_Indentation
;
Write_Indentation
;
Generate
(
Expression
(
Excp_Handler_Alternative
));
Generate
(
Expression
(
Excp_Handler_Alternative
));
Generate_Statement_Delimiter
(
Expression
(
Excp_Handler_Alternative
));
(
Expression
(
Excp_Handler_Alternative
));
Decrement_Indentation
;
Excp_Handler_Alternative
:=
...
...
@@ -1584,8 +1576,7 @@ package body Ocarina.Backends.Ada_Tree.Generator is
-- If the user wants to generates only the spec, or if the
-- package body is empty, we don't generate it.
if
Disable_Pkg_Body_Gen
or
else
Is_Empty
(
Statements
(
N
))
then
if
Disable_Pkg_Body_Gen
or
else
Is_Empty
(
Statements
(
N
))
then
return
;
end
if
;
...
...
@@ -1652,8 +1643,7 @@ package body Ocarina.Backends.Ada_Tree.Generator is
Write_Space
;
Generate
(
Defining_Identifier
(
Package_Declaration
(
N
)));
Generate_Statement_Delimiter
(
Defining_Identifier
(
Package_Declaration
(
N
)));
(
Defining_Identifier
(
Package_Declaration
(
N
)));
Release_Output
(
Fd
);
end
Generate_Package_Implementation
;
...
...
@@ -1712,9 +1702,9 @@ package body Ocarina.Backends.Ada_Tree.Generator is
-- Do not generate empty non instanciated specs
if
not
Is_Instantiated_Package
(
N
)
and
then
Is_Empty
(
Visible_Part
(
N
))
and
then
Is_Empty
(
Private_Part
(
N
))
if
not
Is_Instantiated_Package
(
N
)
and
then
Is_Empty
(
Visible_Part
(
N
))
and
then
Is_Empty
(
Private_Part
(
N
))
then
return
;
end
if
;
...
...
@@ -1792,8 +1782,7 @@ package body Ocarina.Backends.Ada_Tree.Generator is
Write_Space
;
Generate
(
Defining_Identifier
(
Package_Declaration
(
N
)));
Generate_Statement_Delimiter
(
Defining_Identifier
(
Package_Declaration
(
N
)));
(
Defining_Identifier
(
Package_Declaration
(
N
)));
end
if
;
Release_Output
(
Fd
);
...
...
@@ -2491,8 +2480,7 @@ package body Ocarina.Backends.Ada_Tree.Generator is
C
:=
First_Node
(
Discrete_Choices
(
V
));
if
No
(
C
)
or
else
(
Kind
(
C
)
=
K_Literal
and
then
Value
(
C
)
=
No_Value
)
or
else
(
Kind
(
C
)
=
K_Literal
and
then
Value
(
C
)
=
No_Value
)
then
O
:=
V
;
else
...
...
src/backends/ocarina-backends-ada_tree-generator.ads
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
2
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
src/backends/ocarina-backends-ada_tree-nutils.adb
View file @
54df6737
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
3
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
...
...
@@ -65,15 +65,18 @@ package body Ocarina.Backends.Ada_Tree.Nutils is
end
record
;
No_Depth
:
constant
Int
:=
-
1
;
package
Entity_Stack
is
new
GNAT
.
Table
(
Entity_Stack_Entry
,
Int
,
No_Depth
+
1
,
10
,
10
);
package
Entity_Stack
is
new
GNAT
.
Table
(