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
c64ae44b
Commit
c64ae44b
authored
Apr 07, 2017
by
yoogx
Browse files
* Correctly resolve <subcomponent>.<feature> construct in mode
instantiation For issue #87
parent
b9377ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/core/instance/ocarina-instances-components-modes.adb
View file @
c64ae44b
...
...
@@ -52,10 +52,10 @@ package body Ocarina.Instances.Components.Modes is
function
Fetch_Port_Reference_Instance
(
Ref
:
Node_Id
;
C
:
Node_Id
)
return
Node_Id
;
-- Return a
n
reference to the instance corresponding to the port
-- Return a reference to the instance corresponding to the port
-- declaration referenced by Ref. C is the AADL component in which
-- the search begins.
Re
search can be continued inside the
-- subcomponent of C incase Ref references a subcomponent port
-- the search begins.
The
search can be continued inside the
-- subcomponent of C in
case Ref references a subcomponent port
-- (C.Th_1.Out_Port for example).
-----------------------------------
...
...
@@ -112,12 +112,28 @@ package body Ocarina.Instances.Components.Modes is
N
:=
Get_First_Homonym_Instance
(
AIN
.
Features
(
Component
),
ATN
.
Name
(
ATN
.
Item
(
Path_Element
)));
ATN
.
Name
(
ATN
.
Item
(
Path_Element
)));
Add_Path_Element_To_Entity_Reference
(
Ref_Inst
,
N
);
if
No
(
N
)
then
-- If the name is not a feature, we check wether it
-- corresponds to a subcomponent.feature
when
K_Subcomponent
=>
N
:=
Get_First_Homonym
(
ATN
.
Subcomponents
(
Component
),
ATN
.
Name
(
ATN
.
Item
(
Path_Element
)));
Add_Path_Element_To_Entity_Reference
(
Ref_Inst
,
N
);
Recursive_Path_Search
(
ATN
.
Next_Node
(
Path_Element
),
AIN
.
Corresponding_Instance
(
N
));
else
Add_Path_Element_To_Entity_Reference
(
Ref_Inst
,
N
);
end
if
;
when
K_Subcomponent
=>
-- This is a feature belonging to a subcomponent, we
-- fetch the subcomponent instance, add it to the new
-- path and then we continue the search with the
...
...
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