Commit 7849e269 authored by Maxime Perrotin's avatar Maxime Perrotin

Add connections to the interface view in xml

parent 42a71ec9
......@@ -528,6 +528,14 @@ package body TASTE.Backend.Code_Generators is
Result.Funcs.Insert (Key => To_String (Each.Name),
New_Item => Func_Template (Each));
end loop;
for Each of IV.Connections loop
for C of Each loop
Result.Callers := Result.Callers & C.Caller;
Result.Callees := Result.Callees & C.Callee;
Result.RI_Names := Result.RI_Names & C.RI_Name;
Result.PI_Names := Result.PI_Names & C.PI_Name;
end loop;
end loop;
return Result;
end Interface_View_Template;
end TASTE.Backend.Code_Generators;
......@@ -27,6 +27,8 @@ package TASTE.Backend.Code_Generators is
type IV_As_Template is
record
Funcs : Func_Maps.Map;
-- Connections:
Callers, Callees, PI_Names, RI_Names : Vector_Tag;
end record;
-- Set of functions translating the AST into Templates_Parser mappings
......
......@@ -119,7 +119,6 @@ package body TASTE.Dump is
end loop;
return Result;
end Process_Interfaces;
begin
if not Check or not Trigger then
Put_Info ("Nothing generated from " & Path);
......@@ -140,9 +139,18 @@ package body TASTE.Dump is
end;
end loop;
end if;
IV_Tags := +Assoc ("Functions", Functions);
-- Interface view is made of functions and connections
IV_Tags := +Assoc ("Functions", Functions)
& Assoc ("Callers", IV.Callers)
& Assoc ("Callees", IV.Callees)
& Assoc ("Caller_RIs", IV.RI_Names)
& Assoc ("Callee_PIs", IV.PI_Names);
-- Output is made of interface, deployment and data views
Output_Tags := +Assoc
("Interface_View", String'(Parse (IV_Template, IV_Tags)));
Create_Path (Output_Prefix & "/" & Output_Path);
Create (File => Output_File,
Mode => Out_File,
......
......@@ -741,7 +741,8 @@ package body TASTE.Interface_View is
end loop;
return IV_AST : constant Complete_Interface_View :=
(Flat_Functions => Functions);
(Flat_Functions => Functions,
Connections => Routes_Map);
end Parse_Interface_View;
procedure Rename_Function (IV : in out Complete_Interface_View;
......
......@@ -176,6 +176,7 @@ package TASTE.Interface_View is
type Complete_Interface_View is tagged
record
Flat_Functions : Function_Maps.Map;
Connections : Connection_Maps.Map;
end record;
-- Function to build up the Ada AST by transforming the one from Ocarina
......
@@-- @_Functions_@ : functions generated from functions.tmplt
@@-- @_Callers_@ : connection vector tag: caller function names
@@-- @_Callees_@ : |_ corresponding callee function names
@@-- @_Caller_RIs_@ : |_ corresponding name of RIs
@@-- @_Callee_PIs_@ : |_ corresponding name of PIs
<InterfaceView>
@_Functions'Indent_@
@@TABLE@@
<Connection from="@_Callers_@" ri_name="@_Caller_RIs_@" to="@_Callees_@" pi_name="@_Callee_PIs_@"/>
@@END_TABLE@@
</InterfaceView>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment