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
e1e20ecd
Commit
e1e20ecd
authored
Nov 26, 2017
by
Maxime Perrotin
Browse files
Use dictionaries to store interfaces
parent
b775161f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/parser_utils.adb
View file @
e1e20ecd
...
...
@@ -671,9 +671,11 @@ package body Parser_Utils is
Iface
:=
Parse_Interface
(
PI_Or_RI
);
Iface
.
Parent_Function
:=
Result
.
Name
;
if
AIN
.
Is_Provided
(
PI_Or_RI
)
then
Result
.
Provided
:=
Result
.
Provided
&
Iface
;
Result
.
Provided
.
Insert
(
Key
=>
To_String
(
Iface
.
Name
),
New_Item
=>
Iface
);
else
Result
.
Required
:=
Result
.
Required
&
Iface
;
Result
.
Required
.
Insert
(
Key
=>
To_String
(
Iface
.
Name
),
New_Item
=>
Iface
);
end
if
;
PI_Or_RI
:=
AIN
.
Next_Node
(
PI_Or_RI
);
end
loop
;
...
...
@@ -761,6 +763,7 @@ package body Parser_Utils is
V1
:
Remote_Entities
.
Vector
:=
Empty_Vector
;
V2
:
Remote_Entities
.
Vector
:=
Empty_Vector
;
Corr
:
Taste_Terminal_Function
;
PI
:
Taste_Interface
;
begin
Put
(
" ... RI "
&
To_String
(
RI
.
Name
)
&
" ---> "
);
Put
(
To_String
(
Remote
.
Function_Name
)
&
"."
);
...
...
@@ -769,14 +772,11 @@ package body Parser_Utils is
V1
:=
RI
.
Remote_Interfaces
.
Value_Or
(
V1
);
V1
.
Append
(
Remote
);
Corr
:=
Functions
.
Element
(
To_String
(
Remote
.
Function_Name
));
for
PI
of
Corr
.
Provided
loop
-- TODO: replace with a Map
if
PI
.
Name
=
Remote
.
Interface_Name
then
V2
:=
PI
.
Remote_Interfaces
.
Value_Or
(
V2
);
V2
.
Append
(
Remote_Entity
'(
Function_Name
=>
Each
.
Name
,
Interface_Name
=>
RI
.
Name
));
end
if
;
exit
when
PI
.
Name
=
Remote
.
Interface_Name
;
end
loop
;
PI
:=
Corr
.
Provided
.
Element
(
To_String
(
Remote
.
Interface_Name
));
V2
:=
PI
.
Remote_Interfaces
.
Value_Or
(
V2
);
V2
.
Append
(
Remote_Entity
'(
Function_Name
=>
Each
.
Name
,
Interface_Name
=>
RI
.
Name
));
end
if
;
end
;
end
loop
;
...
...
src/parser_utils.ads
View file @
e1e20ecd
...
...
@@ -153,6 +153,8 @@ package Parser_Utils is
end
record
;
package
Interfaces
is
new
Indefinite_Vectors
(
Natural
,
Taste_Interface
);
package
Interfaces_Maps
is
new
Indefinite_Ordered_Maps
(
String
,
Taste_Interface
);
type
Context_Parameter
is
record
...
...
@@ -175,8 +177,8 @@ package Parser_Utils is
Context_Params
:
Ctxt_Params
.
Vector
;
User_Properties
:
Property_Maps
.
Map
;
Timers
:
String_Vectors
.
Vector
;
Provided
:
Interfaces
.
Vector
;
Required
:
Interfaces
.
Vector
;
Provided
:
Interfaces
_Maps
.
Map
;
Required
:
Interfaces
_Maps
.
Map
;
end
record
;
-- package Functions is new Indefinite_Vectors (Natural,
...
...
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