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
d77188d2
Commit
d77188d2
authored
Aug 02, 2016
by
yoogx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/yoogx/ocarina
parents
0192de4d
5bcaae76
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
52 deletions
+43
-52
src/backends/ocarina-backends-aadl_xml-main.adb
src/backends/ocarina-backends-aadl_xml-main.adb
+4
-22
src/backends/ocarina-backends-alloy.adb
src/backends/ocarina-backends-alloy.adb
+3
-4
src/backends/ocarina-backends-cheddar-main.adb
src/backends/ocarina-backends-cheddar-main.adb
+4
-23
src/backends/ocarina-backends-utils.adb
src/backends/ocarina-backends-utils.adb
+23
-3
src/backends/ocarina-backends-utils.ads
src/backends/ocarina-backends-utils.ads
+9
-0
No files found.
src/backends/ocarina-backends-aadl_xml-main.adb
View file @
d77188d2
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-201
5
ESA & ISAE. --
-- Copyright (C) 2011-201
6
ESA & ISAE. --
-- --
-- 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- --
...
...
@@ -36,11 +36,11 @@ with Ocarina.AADL_Values;
with
Ocarina
.
ME_AADL
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Entities
;
with
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
with
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
with
Ocarina
.
Backends
.
AADL_XML
.
Mapping
;
with
Ocarina
.
Backends
.
Utils
;
package
body
Ocarina
.
Backends
.
AADL_XML
.
Main
is
...
...
@@ -49,14 +49,14 @@ package body Ocarina.Backends.AADL_XML.Main is
use
Ocarina
.
ME_AADL
.
AADL_Instances
.
Entities
;
use
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
use
Ocarina
.
Backends
.
AADL_XML
.
Mapping
;
use
Ocarina
.
Backends
.
Utils
;
package
ATN
renames
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
package
AINU
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
package
XTN
renames
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
use
type
ATN
.
Node_Kind
;
procedure
Visit_Component
(
E
:
Node_Id
);
procedure
Visit_Subcomponents_Of
(
E
:
Node_Id
);
procedure
Visit_Subcomponents_Of
is
new
Visit_Subcomponents_Of_G
(
Visit
);
function
Map_Component
(
E
:
Node_Id
)
return
Node_Id
;
...
...
@@ -126,24 +126,6 @@ package body Ocarina.Backends.AADL_XML.Main is
return
N
;
end
Map_Component
;
----------------------------
-- Visit_Subcomponents_Of --
----------------------------
procedure
Visit_Subcomponents_Of
(
E
:
Node_Id
)
is
S
:
Node_Id
;
begin
if
not
AINU
.
Is_Empty
(
Subcomponents
(
E
))
then
S
:=
First_Node
(
Subcomponents
(
E
));
while
Present
(
S
)
loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit
(
Corresponding_Instance
(
S
));
S
:=
Next_Node
(
S
);
end
loop
;
end
if
;
end
Visit_Subcomponents_Of
;
Root_System_Node
:
Node_Id
:=
No_Node
;
AADL_XML_Node
:
Node_Id
:=
No_Node
;
Current_XML_Node
:
Node_Id
:=
No_Node
;
...
...
src/backends/ocarina-backends-alloy.adb
View file @
d77188d2
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2014-201
5
ESA & ISAE. --
-- Copyright (C) 2014-201
6
ESA & ISAE. --
-- --
-- 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- --
...
...
@@ -126,8 +126,8 @@ package body Ocarina.Backends.Alloy is
(
Get_Name_String
(
Normalize_Name
(
Fully_Qualified_Instance_Name
(
E
))))
&
" extends Component{}{"
);
else
Put_Line
(
Kind
(
E
)'
Img
);
Root_System_Name
:=
Normalize_Name
(
Display_Name
(
Identifier
(
E
)));
Put_Line
...
...
@@ -135,7 +135,6 @@ package body Ocarina.Backends.Alloy is
"one sig "
&
To_Lower
(
Get_Name_String
(
Root_System_Name
))
&
" extends Component{}{"
);
end
if
;
Put_Line
...
...
@@ -172,7 +171,7 @@ package body Ocarina.Backends.Alloy is
Put_Line
(
FD
,
"none"
);
end
if
;
-- Rule#3: list properties
-- Rule
#3: list properties
Put
(
FD
,
ASCII
.
HT
&
"properties="
);
if
Present
(
AIN
.
Properties
(
E
))
then
...
...
src/backends/ocarina-backends-cheddar-main.adb
View file @
d77188d2
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2010-201
6
ESA & ISAE. --
-- --
-- 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- --
...
...
@@ -31,11 +31,11 @@
with
Ocarina
.
ME_AADL
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Entities
;
with
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
with
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
with
Ocarina
.
Backends
.
Cheddar
.
Mapping
;
with
Ocarina
.
Backends
.
Utils
;
package
body
Ocarina
.
Backends
.
Cheddar
.
Main
is
...
...
@@ -44,8 +44,8 @@ package body Ocarina.Backends.Cheddar.Main is
use
Ocarina
.
ME_AADL
.
AADL_Instances
.
Entities
;
use
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
use
Ocarina
.
Backends
.
Cheddar
.
Mapping
;
use
Ocarina
.
Backends
.
Utils
;
package
AINU
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
package
XTN
renames
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
procedure
Visit_Component
(
E
:
Node_Id
);
...
...
@@ -54,26 +54,7 @@ package body Ocarina.Backends.Cheddar.Main is
procedure
Visit_Thread
(
E
:
Node_Id
);
procedure
Visit_Process
(
E
:
Node_Id
);
procedure
Visit_Data
(
E
:
Node_Id
);
----------------------------
-- Visit_Subcomponents_Of --
----------------------------
procedure
Visit_Subcomponents_Of
(
E
:
Node_Id
);
procedure
Visit_Subcomponents_Of
(
E
:
Node_Id
)
is
S
:
Node_Id
;
begin
if
not
AINU
.
Is_Empty
(
Subcomponents
(
E
))
then
S
:=
First_Node
(
Subcomponents
(
E
));
while
Present
(
S
)
loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit
(
Corresponding_Instance
(
S
));
S
:=
Next_Node
(
S
);
end
loop
;
end
if
;
end
Visit_Subcomponents_Of
;
procedure
Visit_Subcomponents_Of
is
new
Visit_Subcomponents_Of_G
(
Visit
);
Root_System_Node
:
Node_Id
:=
No_Node
;
Cheddar_Node
:
Node_Id
:=
No_Node
;
...
...
src/backends/ocarina-backends-utils.adb
View file @
d77188d2
...
...
@@ -3868,9 +3868,9 @@ package body Ocarina.Backends.Utils is
return
False
;
end
Process_Use_Defaults_Sockets
;
-------------------------
-
--
Get_Associated_Bus
--
-------------------------
-
-------------------------
--
Get_Associated_Bus
--
-------------------------
function
Get_Associated_Bus
(
Port
:
Node_Id
)
return
Node_Id
is
C
:
Node_Id
;
...
...
@@ -4048,4 +4048,24 @@ package body Ocarina.Backends.Utils is
return
Core_Id
;
end
Get_Core_Id
;
------------------------------
-- Visit_Subcomponents_Of_G --
------------------------------
procedure
Visit_Subcomponents_Of_G
(
E
:
Node_Id
)
is
package
AINU
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
S
:
Node_Id
;
begin
if
not
AINU
.
Is_Empty
(
Subcomponents
(
E
))
then
S
:=
First_Node
(
Subcomponents
(
E
));
while
Present
(
S
)
loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit
(
Corresponding_Instance
(
S
));
S
:=
Next_Node
(
S
);
end
loop
;
end
if
;
end
Visit_Subcomponents_Of_G
;
end
Ocarina
.
Backends
.
Utils
;
src/backends/ocarina-backends-utils.ads
View file @
d77188d2
...
...
@@ -35,6 +35,15 @@ package Ocarina.Backends.Utils is
type
Browsing_Kind
is
(
By_Source
,
By_Destination
,
Default
);
------------------
-- AST visitor --
------------------
generic
with
procedure
Visit
(
E
:
Node_Id
);
procedure
Visit_Subcomponents_Of_G
(
E
:
Node_Id
);
-- Visit the component instance corresponding to the subcomponents of E
--------------------------
-- Directory Operations --
--------------------------
...
...
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