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
943cafb7
Commit
943cafb7
authored
Jan 16, 2016
by
yoogx
Browse files
* Core reorganization
parent
cec7a931
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/core/model/ocarina-analyzer.adb
View file @
943cafb7
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 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,7 +31,6 @@
with
Charset
;
with
Ocarina
.
Namet
;
with
Ocarina
.
Output
;
with
GNAT
.
Table
;
...
...
@@ -41,8 +40,8 @@ with Ocarina.Analyzer.REAL;
package
body
Ocarina
.
Analyzer
is
use
Charset
;
use
Ocarina
.
Namet
;
use
Ocarina
.
Output
;
type
Analyzer_Record
is
record
Language
:
Name_Id
;
...
...
@@ -63,11 +62,8 @@ package body Ocarina.Analyzer is
end
if
;
end
loop
;
Set_Standard_Error
;
Write_Line
(
"Analyzers : Cannot find language "
&
Get_Name_String
(
Language
));
Set_Standard_Output
;
return
False
;
raise
Program_Error
with
"Analyzers : Cannot find language "
&
Get_Name_String
(
Language
);
end
Analyze
;
--------------------
...
...
@@ -99,23 +95,20 @@ package body Ocarina.Analyzer is
(
Language
:
String
;
Analyzer
:
Analyzer_Subprogram
)
is
N
:
Name_Id
;
N
:
constant
Name_Id
:=
Get_String_Name
(
To_Lower
(
Language
));
begin
N
:=
Get_String_Name
(
To_Lower
(
Language
));
for
B
in
Analyzers
.
First
..
Analyzers
.
Last
loop
if
Analyzers
.
Table
(
B
).
Language
=
N
then
Set_Standard_Error
;
Write_Line
(
"Cannot register twice analyzer "
&
Language
);
Set_Standard_Output
;
raise
Program_Error
with
"Cannot register twice analyzer "
&
Language
;
end
if
;
end
loop
;
if
Language
'
Length
>
0
then
Analyzers
.
Increment_Last
;
Set_Str_To_Name_Buffer
(
Language
);
Analyzers
.
Table
(
Analyzers
.
Last
).
Language
:=
Name_Find
;
Analyzers
.
Table
(
Analyzers
.
Last
).
Analyzer
:=
Analyzer
;
end
if
;
Analyzers
.
Increment_Last
;
Set_Str_To_Name_Buffer
(
Language
);
Analyzers
.
Table
(
Analyzers
.
Last
).
Language
:=
Name_Find
;
Analyzers
.
Table
(
Analyzers
.
Last
).
Analyzer
:=
Analyzer
;
end
Register_Analyzer
;
end
Ocarina
.
Analyzer
;
src/core/model/ocarina-analyzer.ads
View file @
943cafb7
...
...
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 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- --
...
...
@@ -38,6 +38,8 @@ package Ocarina.Analyzer is
type
Analyzer_Subprogram
is
access
function
(
AADL_Root
:
Node_Id
)
return
Boolean
;
type
Init_Analyzer_Subprogram
is
access
procedure
;
function
Analyze
(
Language
:
Name_Id
;
Root
:
Node_Id
)
return
Boolean
;
procedure
Init_Analyzers
;
...
...
src/core/model/ocarina-builder-aadl-components-connections.adb
View file @
943cafb7
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 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- --
...
...
@@ -34,6 +34,10 @@ with Ocarina.ME_AADL.AADL_Tree.Nodes;
package
body
Ocarina
.
Builder
.
AADL
.
Components
.
Connections
is
use
Ocarina
.
ME_AADL
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
------------------------------
-- Add_Property_Association --
------------------------------
...
...
@@ -42,9 +46,6 @@ package body Ocarina.Builder.AADL.Components.Connections is
(
Connection
:
Node_Id
;
Property_Association
:
Node_Id
)
return
Boolean
is
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
pragma
Assert
(
Connection
/=
No_Node
and
then
Kind
(
Connection
)
=
K_Connection
);
pragma
Assert
(
Property_Association
/=
No_Node
);
...
...
@@ -78,31 +79,13 @@ package body Ocarina.Builder.AADL.Components.Connections is
Destination
:
Node_Id
:=
No_Node
;
In_Modes
:
Node_Id
:=
No_Node
)
return
Node_Id
is
use
Ocarina
.
ME_AADL
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
pragma
Assert
(
Kind
(
Comp_Impl
)
=
K_Component_Implementation
);
Node
:
constant
Node_Id
:=
New_Node
(
K_Connection
,
Loc
);
Node
:
constant
Node_Id
:=
New_Connection
(
Loc
,
Name
,
Category
,
Is_Refinement
,
Is_Bidirect
,
Source
,
Destination
,
In_Modes
);
Success
:
Boolean
:=
True
;
begin
Set_Identifier
(
Node
,
Name
);
if
Name
/=
No_Node
then
Set_Corresponding_Entity
(
Name
,
Node
);
end
if
;
Set_Is_Refinement
(
Node
,
Is_Refinement
);
Set_Is_Bidirectional
(
Node
,
Is_Bidirect
);
Set_Source
(
Node
,
Source
);
Set_Destination
(
Node
,
Destination
);
Set_Category
(
Node
,
Connection_Type
'
Pos
(
Category
));
Set_In_Modes
(
Node
,
In_Modes
);
Set_Properties
(
Node
,
No_List
);
Set_Property_Scope
(
Node
,
New_Node
(
K_Scope_Definition
,
Loc
));
Set_Corresponding_Entity
(
Property_Scope
(
Node
),
Node
);
Success
:=
Add_Connection
(
Component
=>
Comp_Impl
,
Connection
=>
Node
);
if
Success
then
...
...
@@ -110,7 +93,6 @@ package body Ocarina.Builder.AADL.Components.Connections is
else
return
No_Node
;
end
if
;
end
Add_New_Connection
;
--------------------
...
...
@@ -127,11 +109,8 @@ package body Ocarina.Builder.AADL.Components.Connections is
Destination
:
Node_Id
:=
No_Node
;
In_Modes
:
Node_Id
:=
No_Node
)
return
Node_Id
is
use
Ocarina
.
ME_AADL
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
Node
:
constant
Node_Id
:=
New_Node
(
K_Connection
,
Loc
);
begin
Set_Identifier
(
Node
,
Name
);
...
...
@@ -150,7 +129,6 @@ package body Ocarina.Builder.AADL.Components.Connections is
Set_Corresponding_Entity
(
Property_Scope
(
Node
),
Node
);
return
Node
;
end
New_Connection
;
end
Ocarina
.
Builder
.
AADL
.
Components
.
Connections
;
src/core/model/ocarina-builder-aadl-components-prototypes.adb
View file @
943cafb7
...
...
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-201
5
ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 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- --
...
...
@@ -36,6 +36,8 @@ with Ocarina.ME_AADL.AADL_Tree.Nutils;
package
body
Ocarina
.
Builder
.
AADL
.
Components
.
Prototypes
is
use
Ocarina
.
ME_AADL
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
-----------------------
-- Add_New_Prototype --
...
...
@@ -49,9 +51,6 @@ package body Ocarina.Builder.AADL.Components.Prototypes is
Category
:
Ocarina
.
ME_AADL
.
Component_Category
;
Is_Refinement
:
Boolean
:=
False
)
return
Node_Id
is
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
pragma
Assert
(
Container
/=
No_Node
and
then
...
...
@@ -79,7 +78,6 @@ package body Ocarina.Builder.AADL.Components.Prototypes is
else
return
No_Node
;
end
if
;
end
Add_New_Prototype
;
-------------------------------
...
...
@@ -93,10 +91,8 @@ package body Ocarina.Builder.AADL.Components.Prototypes is
Classifier_Ref
:
Node_Id
;
Category
:
Ocarina
.
ME_AADL
.
Component_Category
)
return
Node_Id
is
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
use
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nutils
;
Node
:
constant
Node_Id
:=
New_Node
(
K_Binding_Prototype
,
Loc
);
begin
Set_Identifier
(
Node
,
Name
);
Set_Corresponding_Entity
(
Name
,
Node
);
...
...
@@ -105,7 +101,6 @@ package body Ocarina.Builder.AADL.Components.Prototypes is
Set_Category
(
Node
,
Component_Category
'
Pos
(
Category
));
return
Node
;
end
Add_New_Prototype_Binding
;
end
Ocarina
.
Builder
.
AADL
.
Components
.
Prototypes
;
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