Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
6788fd7d
Commit
6788fd7d
authored
Feb 23, 2018
by
Maxime Perrotin
Browse files
Set instance of and type as 1st-class properties
parent
1d37c85b
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/taste-backend-skeletons.adb
View file @
6788fd7d
...
...
@@ -192,29 +192,47 @@ package body TASTE.Backend.Skeletons is
is
use
Interface_Vectors
;
use
Ctxt_Params
;
Result
:
Func_As_Template
;
List_Of_PIs
:
Tag
;
List_Of_RIs
:
Tag
;
Timers
:
Tag
;
Result
:
Func_As_Template
;
List_Of_PIs
:
Tag
;
List_Of_RIs
:
Tag
;
Timers
:
Tag
;
Property_Names
:
Vector_Tag
;
Property_Values
:
Vector_Tag
;
begin
Result
.
Header
:=
+
Assoc
(
"Name"
,
F
.
Name
)
&
Assoc
(
"Language"
,
Language_Spelling
(
F
))
&
Assoc
(
"Has_Context"
,
(
Length
(
F
.
Context_Params
)
>
0
));
-- Add list of PI names
for
Each
of
F
.
Provided
loop
Result
.
Provided
:=
Result
.
Provided
&
Interface_Template
(
Each
);
List_Of_PIs
:=
List_Of_PIs
&
Each
.
Name
;
end
loop
;
-- Add list of RI names
for
Each
of
F
.
Required
loop
Result
.
Required
:=
Result
.
Required
&
Interface_Template
(
Each
);
List_Of_RIs
:=
List_Of_RIs
&
Each
.
Name
;
end
loop
;
-- Add list of timers (names)
for
Each
of
F
.
Timers
loop
Timers
:=
Timers
&
Each
;
end
loop
;
-- Add all user-defined properties
for
Each
of
F
.
User_Properties
loop
Property_Names
:=
Property_Names
&
Each
.
Name
;
Property_Values
:=
Property_Values
&
Each
.
Value
;
end
loop
;
-- Setup the mapping for the template
Result
.
Header
:=
Result
.
Header
&
Assoc
(
"List_Of_PIs"
,
List_Of_PIs
)
&
Assoc
(
"List_Of_RIs"
,
List_Of_RIs
)
&
Assoc
(
"Timers"
,
Timers
);
&
Assoc
(
"List_Of_PIs"
,
List_Of_PIs
)
&
Assoc
(
"List_Of_RIs"
,
List_Of_RIs
)
&
Assoc
(
"Property_Names"
,
Property_Names
)
&
Assoc
(
"Property_Values"
,
Property_Values
)
&
Assoc
(
"Timers"
,
Timers
);
return
Result
;
end
Func_Template
;
...
...
src/taste-interface_view.adb
View file @
6788fd7d
...
...
@@ -553,6 +553,20 @@ package body TASTE.Interface_View is
end
loop
;
end
if
;
Result
.
User_Properties
:=
Get_Properties_Map
(
Inst
);
-- Check User properties for first-class attributes
-- Currently: component type and instance
for
Each
of
Result
.
User_Properties
loop
if
Each
.
Name
=
"TASTE_IV_Properties::is_Component_Type"
and
then
Each
.
Value
=
"true"
then
Result
.
Is_Type
:=
True
;
end
if
;
if
Each
.
Name
=
"TASTE_IV_Properties::is_instance_of"
then
Result
.
Instance_Of
:=
Just
(
Each
.
Value
);
end
if
;
end
loop
;
return
Result
;
exception
when
Error
:
Interface_Error
=>
...
...
@@ -823,9 +837,12 @@ package body TASTE.Interface_View is
Put_Line
(
Output
,
" |_Full Prefix: "
&
To_String
(
Value_Or
(
Each
.
Full_Prefix
,
US
(
"(none)"
))));
Put_Line
(
Output
,
" |_Language : "
&
Each
.
Language
'
Img
);
Put_Line
(
Output
,
" |_Zip file : "
Put_Line
(
Output
,
" |_Language
: "
&
Each
.
Language
'
Img
);
Put_Line
(
Output
,
" |_Zip file
: "
&
To_String
(
Value_Or
(
Each
.
Zip_File
,
US
(
"(none)"
))));
Put_Line
(
Output
,
" |_Is type : "
&
Each
.
Is_Type
'
Img
);
Put_Line
(
Output
,
" |_Instance of : "
&
To_String
(
Value_Or
(
Each
.
Instance_Of
,
US
(
"(n/a)"
))));
Put_Line
(
Output
,
" Cxtx Params:"
);
for
CP
of
Each
.
Context_Params
loop
Put_Line
(
Output
,
" |_"
&
To_String
(
CP
.
Name
)
&
":"
...
...
src/taste-interface_view.ads
View file @
6788fd7d
...
...
@@ -136,6 +136,8 @@ package TASTE.Interface_View is
Timers
:
String_Vectors
.
Vector
;
Provided
:
Interfaces_Maps
.
Map
;
Required
:
Interfaces_Maps
.
Map
;
Is_Type
:
Boolean
:=
False
;
Instance_Of
:
Optional_Unbounded_String
:=
Nothing
;
end
record
;
package
Function_Maps
is
new
Indefinite_Ordered_Maps
(
String
,
...
...
src/taste-parser_version.ads
View file @
6788fd7d
package
TASTE
.
Parser_Version
is
Parser_Release
:
constant
String
:=
"
53a8b63
; Commit
Author: Maxime Perrotin <Maxime.Perrotin@esa.int>
"
;
"
1d37c85
; Commit
Date: Fri Feb 23 13:52:26 2018
"
;
Ocarina_Version
:
constant
String
:=
"Ocarina 2017.x (Working Copy from r
0b92ed3
)"
;
"Ocarina 2017.x (Working Copy from r
c50d394
)"
;
end
TASTE
.
Parser_Version
;
\ No newline at end of file
templates/skeletons/ada/body.tmplt
View file @
6788fd7d
...
...
@@ -9,7 +9,8 @@
@@--
@
_Has_Context_
@
:
Flag
,
True
if
there
are
context
parameters
@@--
@
_Provided_Interfaces_
@
:
List
of
Provided
interfaces
with
parameters
@@--
@
_Required_Interfaces_
@
:
List
of
Required
interfaces
with
parameters
@@--
@
_Property_Names_
@
:
List
of
User
-
defined
properties
(
names
)
@@--
@
_Property_Values_
@
:
List
of
User
-
defined
properties
(
values
)
--
Body
file
for
function
@
_Name_
@
--
Generated
by
TASTE
on
@
_NOW_
@
--
You
can
edit
this
file
,
it
will
not
be
overwritten
...
...
templates/skeletons/ada/header.tmplt
View file @
6788fd7d
...
...
@@ -9,6 +9,8 @@
@@--
@
_Has_Context_
@
:
Flag
,
True
if
there
are
context
parameters
@@--
@
_Provided_Interfaces_
@
:
List
of
Provided
interfaces
with
parameters
@@--
@
_Required_Interfaces_
@
:
List
of
Required
interfaces
with
parameters
@@--
@
_Property_Names_
@
:
List
of
User
-
defined
properties
(
names
)
@@--
@
_Property_Values_
@
:
List
of
User
-
defined
properties
(
values
)
--
Header
file
for
function
@
_Name_
@
in
@
_Language_
@
language
--
Generated
by
TASTE
on
@
_NOW_
@
--
Context
Parameters
present
:
@
_YES_NO
:
Has_Context_
@
...
...
templates/skeletons/c/body.tmplt
View file @
6788fd7d
...
...
@@ -9,12 +9,18 @@
@@-- @_Has_Context_@ : Flag, True if there are context parameters
@@-- @_Provided_Interfaces_@ : List of Provided interfaces with parameters
@@-- @_Required_Interfaces_@ : List of Required interfaces with parameters
@@-- @_Property_Names_@ : List of User-defined properties (names)
@@-- @_Property_Values_@ : List of User-defined properties (values)
/* Body file for function @_Name_@
* Generated by TASTE on @_NOW_@
* You can edit this file, it will not be overwritten
* Provided interfaces : @_List_Of_PIs_@
* Required interfaces : @_List_Of_RIs_@
* User-defined properties for this function:
@@TABLE@@
* |_ @_Property_Names_@ = @_Property_Values_@
@@END_TABLE@@
* Timers : @_Timers_@
*/
...
...
templates/skeletons/c/header.tmplt
View file @
6788fd7d
...
...
@@ -9,12 +9,18 @@
@@-- @_Has_Context_@ : Flag, True if there are context parameters
@@-- @_Provided_Interfaces_@ : List of Provided interfaces with parameters
@@-- @_Required_Interfaces_@ : List of Required interfaces with parameters
@@-- @_Property_Names_@ : List of User-defined properties (names)
@@-- @_Property_Values_@ : List of User-defined properties (values)
/* Header file for function @_Name_@ in @_Language_@ language
* Generated by TASTE on @_NOW_@
* Context Parameters present : @_YES_NO:Has_Context_@
* Provided interfaces : @_List_Of_PIs_@
* Required interfaces : @_List_Of_RIs_@
* User-defined properties for this function:
@@TABLE@@
* |_ @_Property_Names_@ = @_Property_Values_@
@@END_TABLE@@
* DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN DURING THE BUILD
*/
...
...
Write
Preview
Supports
Markdown
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