Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Ocarina
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
Ocarina
Commits
3fa81987
Commit
3fa81987
authored
Nov 18, 2016
by
yoogx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Default value are marked constant if a default value can be
computed
parent
7c60fea5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
19 deletions
+29
-19
src/backends/ocarina-backends-po_hi_ada-types.adb
src/backends/ocarina-backends-po_hi_ada-types.adb
+29
-19
No files found.
src/backends/ocarina-backends-po_hi_ada-types.adb
View file @
3fa81987
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
-- --
-- --
-- B o d y --
-- B o d y --
-- --
-- --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2006-2009 Telecom ParisTech, 2010-201
6
ESA & ISAE. --
-- --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- 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- --
-- terms of the GNU General Public License as published by the Free Soft- --
...
@@ -896,8 +896,11 @@ package body Ocarina.Backends.PO_HI_Ada.Types is
...
@@ -896,8 +896,11 @@ package body Ocarina.Backends.PO_HI_Ada.Types is
(
Identifier
(
E
),
(
Identifier
(
E
),
Get_Handling
(
E
,
By_Name
,
H_Ada_Type_Spec
));
Get_Handling
(
E
,
By_Name
,
H_Ada_Type_Spec
));
-- Declare the "default value" of a type. This value is not
-- Declare the "default value" of a type.
-- declared as a 'constant' so that the user can modify it.
-- Note: If a default value can be computed, then this value
-- is declared as a 'constant' so that the user cannot
-- modify it.
if
No
(
Get_Handling
(
E
,
By_Name
,
H_Ada_Type_Default_Value
))
then
if
No
(
Get_Handling
(
E
,
By_Name
,
H_Ada_Type_Default_Value
))
then
Data_Representation
:=
Get_Data_Representation
(
E
);
Data_Representation
:=
Get_Data_Representation
(
E
);
...
@@ -906,15 +909,22 @@ package body Ocarina.Backends.PO_HI_Ada.Types is
...
@@ -906,15 +909,22 @@ package body Ocarina.Backends.PO_HI_Ada.Types is
-- protected types.
-- protected types.
if
Data_Representation
/=
Data_With_Accessors
then
if
Data_Representation
/=
Data_With_Accessors
then
declare
Default_Value
:
constant
Node_Id
:=
Get_Ada_Default_Value
(
E
);
begin
N
:=
N
:=
Make_Object_Declaration
Make_Object_Declaration
(
Defining_Identifier
=>
(
Defining_Identifier
=>
Map_Ada_Default_Value_Identifier
(
E
),
Map_Ada_Default_Value_Identifier
(
E
),
Constant_Present
=>
Present
(
Default_Value
),
Object_Definition
=>
Map_Ada_Defining_Identifier
(
E
),
Object_Definition
=>
Map_Ada_Defining_Identifier
(
E
),
Expression
=>
Get_Ada_Default_Value
(
E
)
);
Expression
=>
Default_Value
);
Set_Handling
(
E
,
By_Name
,
H_Ada_Type_Default_Value
,
N
);
Set_Handling
(
E
,
By_Name
,
H_Ada_Type_Default_Value
,
N
);
Append_Node_To_List
(
N
,
ADN
.
Visible_Part
(
Current_Package
));
Append_Node_To_List
(
N
,
ADN
.
Visible_Part
(
Current_Package
));
end
;
else
else
N
:=
No_Node
;
N
:=
No_Node
;
end
if
;
end
if
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment