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
45138252
Commit
45138252
authored
May 25, 2015
by
yoogx
Browse files
* Add support for fully qualified name passed to the -r flag
For issue #36
parent
c77bf46d
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/core/instance/ocarina-instances.adb
View file @
45138252
...
...
@@ -173,8 +173,12 @@ package body Ocarina.Instances is
if
Root_System_Name
/=
No_Name
then
List_Node
:=
Root_Systems
.
First
;
while
Present
(
List_Node
)
loop
exit
when
ATE
.
Get_Name_Of_Entity
(
List_Node
,
False
)
=
Root_System_Name
;
exit
when
(
ATE
.
Get_Name_Of_Entity
(
List_Node
,
False
)
=
Root_System_Name
or
else
ATE
.
Get_Name_Of_Entity
(
List_Node
,
False
,
True
)
=
Root_System_Name
);
List_Node
:=
ATN
.
Next_Entity
(
List_Node
);
end
loop
;
...
...
@@ -188,7 +192,8 @@ package body Ocarina.Instances is
List_Node
:=
Root_Systems
.
First
;
while
Present
(
List_Node
)
loop
Error_Loc
(
1
)
:=
ATN
.
Loc
(
List_Node
);
Error_Name
(
1
)
:=
ATE
.
Get_Name_Of_Entity
(
List_Node
);
Error_Name
(
1
)
:=
ATE
.
Get_Name_Of_Entity
(
List_Node
,
False
,
True
);
DE
(
"%"
);
List_Node
:=
ATN
.
Next_Entity
(
List_Node
);
end
loop
;
...
...
src/core/tree/ocarina-me_aadl-aadl_tree-entities.adb
View file @
45138252
...
...
@@ -120,9 +120,11 @@ package body Ocarina.ME_AADL.AADL_Tree.Entities is
function
Get_Name_Of_Entity
(
Entity
:
Ocarina
.
Types
.
Node_Id
;
Get_Display_Name
:
Boolean
:=
True
)
return
Ocarina
.
Types
.
Name_Id
Get_Display_Name
:
Boolean
:=
True
;
Fully_Qualified
:
Boolean
:=
False
)
return
Ocarina
.
Types
.
Name_Id
is
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
use
Ocarina
.
Namet
;
use
Ocarina
.
Types
;
pragma
Assert
...
...
@@ -153,32 +155,52 @@ package body Ocarina.ME_AADL.AADL_Tree.Entities is
or
else
Kind
(
Entity
)
=
K_Annex_Subclause
or
else
Kind
(
Entity
)
=
K_Annex_Library
or
else
DNKE
(
Entity
));
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Debug
;
Entity_Name
:
Name_Id
:=
No_Name
;
Package_Name
:
Name_Id
;
Name_Of_Entity
:
Name_Id
:=
No_Name
;
begin
if
Kind
(
Entity
)
/=
K_AADL_Specification
and
then
Identifier
(
Entity
)
/=
No_Node
then
if
Get_Display_Name
then
return
Display_Name
(
Identifier
(
Entity
));
Entity_Name
:=
Display_Name
(
Identifier
(
Entity
));
else
return
Name
(
Identifier
(
Entity
));
Entity_Name
:=
Name
(
Identifier
(
Entity
));
end
if
;
else
return
No_Name
;
end
if
;
end
Get_Name_Of_Entity
;
------------------------
-- Get_Name_Of_Entity --
------------------------
if
Fully_Qualified
then
Package_Name
:=
Display_Name
(
Identifier
(
Namespace
(
Entity
)));
Set_Str_To_Name_Buffer
(
""
);
Set_Str_To_Name_Buffer
(
Get_Name_String
(
Package_Name
)
&
"::"
&
Get_Name_String
(
Entity_Name
));
Name_Of_Entity
:=
Name_Find
;
else
Name_Of_Entity
:=
Entity_Name
;
end
if
;
return
Name_Of_Entity
;
end
Get_Name_Of_Entity
;
function
Get_Name_Of_Entity
(
Entity
:
Ocarina
.
Types
.
Node_Id
;
Get_Display_Name
:
Boolean
:=
True
)
return
String
Get_Display_Name
:
Boolean
:=
True
;
Fully_Qualified
:
Boolean
:=
False
)
return
String
is
use
Ocarina
.
Types
;
use
Ocarina
.
Namet
;
Name
:
constant
Name_Id
:=
Get_Name_Of_Entity
(
Entity
,
Get_Display_Name
);
Name
:
constant
Name_Id
:=
Get_Name_Of_Entity
(
Entity
,
Get_Display_Name
,
Fully_Qualified
);
begin
if
Name
/=
No_Name
then
return
Get_Name_String
(
Name
);
...
...
@@ -532,7 +554,7 @@ package body Ocarina.ME_AADL.AADL_Tree.Entities is
end
Package_Has_Private_Declarations_Or_Properties
;
--
-- This following section is relative to Entities M
E
ssages
-- This following section is relative to Entities M
e
ssages
--
-----------------------------
-- Display_Node_Kind_Error --
...
...
src/core/tree/ocarina-me_aadl-aadl_tree-entities.ads
View file @
45138252
...
...
@@ -44,11 +44,13 @@ package Ocarina.ME_AADL.AADL_Tree.Entities is
function
Get_Name_Of_Entity
(
Entity
:
Ocarina
.
Types
.
Node_Id
;
Get_Display_Name
:
Boolean
:=
True
)
return
Ocarina
.
Types
.
Name_Id
;
Get_Display_Name
:
Boolean
:=
True
;
Fully_Qualified
:
Boolean
:=
False
)
return
Ocarina
.
Types
.
Name_Id
;
function
Get_Name_Of_Entity
(
Entity
:
Ocarina
.
Types
.
Node_Id
;
Get_Display_Name
:
Boolean
:=
True
)
return
String
;
Get_Display_Name
:
Boolean
:=
True
;
Fully_Qualified
:
Boolean
:=
False
)
return
String
;
function
Get_Name_Of_Entity_Reference
(
Entity_Ref
:
Ocarina
.
Types
.
Node_Id
;
...
...
tests/MANIFEST
View file @
45138252
...
...
@@ -287,5 +287,6 @@ tests/github/issue_10/test.aadl
tests/github/issue_10/test2.aadl
tests/github/issue_22/p.aadl
tests/github/issue_35/test.aadl
tests/github/issue_36/test.aadl
tests/root_system/test.aadl
tests/github/issue_36/MANIFEST
0 → 100644
View file @
45138252
AADL_VERSION=-aadlv2
OCARINA_FLAGS=-i -r test::s.i
tests/github/issue_36/test.aadl
0 → 100644
View file @
45138252
package
test
public
system
s
end
s
;
system
implementation
s
.
i
end
s
.
i
;
system
implementation
s
.
i2
end
s
.
i2
;
end
test
;
\ No newline at end of file
tests/github/issue_36/test.aadl.out
0 → 100644
View file @
45138252
tests/root_system/test.aadl.out
View file @
45138252
ocarina: Please select a root system among
test.aadl:13:01: r2.i
test.aadl:7:01: r1.i
test.aadl:13:01:
p1::
r2.i
test.aadl:7:01:
p1::
r1.i
Cannot instantiate AADL model
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