Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
1eeeaac7
Commit
1eeeaac7
authored
Jun 06, 2015
by
yoogx
Browse files
* Allow instanciation of incomplete models
For ticket #41
parent
88527aa6
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/core/instance/ocarina-instances-components-subcomponents.adb
View file @
1eeeaac7
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
5
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 --
...
...
@@ -72,18 +72,18 @@ package body Ocarina.Instances.Components.Subcomponents is
New_Instance
:
Node_Id
:=
No_Node
;
New_Subinstance
:
Node_Id
;
begin
New_Instance
:=
New_Node
(
K_Subcomponent_Instance
,
ATN
.
Loc
(
Subcomponent
));
AIN
.
Set_Identifier
(
New_Instance
,
Duplicate_Identifier
(
ATN
.
Identifier
(
Subcomponent
)));
AIN
.
Set_Corresponding_Declaration
(
New_Instance
,
Subcomponent
);
Set_Destinations
(
New_Instance
,
New_List
(
K_List_Id
,
No_Location
));
if
Present
(
Entity_Ref
(
Subcomponent
))
and
then
Present
(
ATE
.
Get_Referenced_Entity
(
Entity_Ref
(
Subcomponent
)))
then
New_Instance
:=
New_Node
(
K_Subcomponent_Instance
,
ATN
.
Loc
(
Subcomponent
));
AIN
.
Set_Identifier
(
New_Instance
,
Duplicate_Identifier
(
ATN
.
Identifier
(
Subcomponent
)));
AIN
.
Set_Corresponding_Declaration
(
New_Instance
,
Subcomponent
);
Set_Destinations
(
New_Instance
,
New_List
(
K_List_Id
,
No_Location
));
-- Verify whether the component has been instantiateed or not
New_Subinstance
:=
...
...
@@ -103,7 +103,6 @@ package body Ocarina.Instances.Components.Subcomponents is
end
if
;
else
Display_No_Entity_Ref
(
Subcomponent
);
Display_Instantiation_Error
(
Subcomponent
);
end
if
;
return
New_Instance
;
...
...
src/core/instance/ocarina-instances-components.adb
View file @
1eeeaac7
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
5
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 --
...
...
@@ -249,9 +249,11 @@ package body Ocarina.Instances.Components is
-- subcomponent with the current AADL component
-- implementation.
Annotate
(
ATE
.
Get_Referenced_Entity
(
Entity_Ref
(
List_Node
)),
Component
);
if
Present
(
Entity_Ref
(
List_Node
))
then
Annotate
(
ATE
.
Get_Referenced_Entity
(
Entity_Ref
(
List_Node
)),
Component
);
end
if
;
-- Set the component instance and the
-- subcomponent instance.
...
...
@@ -265,14 +267,15 @@ package body Ocarina.Instances.Components is
-- We apply the properties to the component
-- corresponding to the subcomponent.
Success
:=
Apply_Properties
(
Instance_Root
,
Corresponding_Instance
(
Instance_Node
),
ATN
.
Properties
(
List_Node
),
Override_Mode
=>
True
)
and
then
Success
;
if
Present
(
Entity_Ref
(
List_Node
))
then
Success
:=
Apply_Properties
(
Instance_Root
,
Corresponding_Instance
(
Instance_Node
),
ATN
.
Properties
(
List_Node
),
Override_Mode
=>
True
)
and
then
Success
;
end
if
;
else
Display_Instantiation_Error
(
List_Node
);
Success
:=
False
;
...
...
src/core/instance/ocarina-instances-messages.adb
View file @
1eeeaac7
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
5
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 --
...
...
@@ -54,7 +54,7 @@ package body Ocarina.Instances.Messages is
pragma
Assert
(
Present
(
Node
));
Error_Loc
(
1
)
:=
Loc
(
Node
);
Error_Name
(
1
)
:=
Get_Name_Of_Entity
(
Node
);
D
E
(
"%is not associated with any entity"
);
D
W
(
"%is not associated with any entity"
);
end
Display_No_Entity_Ref
;
----------------------------------------
...
...
src/core/instance/ocarina-instances-processor-properties.adb
View file @
1eeeaac7
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE. --
-- Copyright (C) 2005-2009 Telecom ParisTech, 2010-201
5
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 --
...
...
@@ -683,9 +683,11 @@ package body Ocarina.Instances.Processor.Properties is
List_Node
:=
AIN
.
First_Node
(
AIN
.
Subcomponents
(
Component
));
while
Present
(
List_Node
)
loop
Resolve_Properties_Of_Component_Instance
(
Root
=>
Root
,
Component
=>
Corresponding_Instance
(
List_Node
));
if
Present
(
Corresponding_Instance
(
List_Node
))
then
Resolve_Properties_Of_Component_Instance
(
Root
=>
Root
,
Component
=>
Corresponding_Instance
(
List_Node
));
end
if
;
List_Node
:=
AIN
.
Next_Node
(
List_Node
);
end
loop
;
end
if
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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