Commit 2f56caee authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Setup parsing of context parameters

parent 991ebcff
...@@ -269,8 +269,6 @@ procedure BuildSupport is ...@@ -269,8 +269,6 @@ procedure BuildSupport is
NA : constant Name_Array := NA : constant Name_Array :=
Get_Source_Text (Asn1type); Get_Source_Text (Asn1type);
FS_File : Unbounded_String; FS_File : Unbounded_String;
-- For the Ada AST:
CP : Context_Parameter;
begin begin
-- Some special DATA components have no -- Some special DATA components have no
-- Source_Text property in DataView.aadl -- Source_Text property in DataView.aadl
...@@ -288,12 +286,6 @@ procedure BuildSupport is ...@@ -288,12 +286,6 @@ procedure BuildSupport is
To_String (FS_file), To_String (FS_file),
To_String (FS_file)'Length, To_String (FS_file)'Length,
FS_Fullname); FS_Fullname);
CP := (Name => US (FS_Fullname),
Sort => US (FS_type),
Default_Value => US (FS_value),
ASN1_Module => US (FS_module),
ASN1_File_Name => FS_file);
pragma Unreferenced (CP);
end; end;
end if; end if;
FV_Subco := Next_Node (FV_Subco); FV_Subco := Next_Node (FV_Subco);
......
...@@ -400,6 +400,8 @@ package body Buildsupport_Utils is ...@@ -400,6 +400,8 @@ package body Buildsupport_Utils is
-- To get the optional zip filename where user code is stored: -- To get the optional zip filename where user code is stored:
Source_Text : constant Name_Array := Get_Source_Text (Inst); Source_Text : constant Name_Array := Get_Source_Text (Inst);
Zip_Id : Name_Id := No_Name; Zip_Id : Name_Id := No_Name;
-- To get the context parameters
Subco : Node_Id;
begin begin
Result.Name := US (Name); Result.Name := US (Name);
Result.Language := Get_Source_Language (Inst); Result.Language := Get_Source_Language (Inst);
...@@ -407,6 +409,20 @@ package body Buildsupport_Utils is ...@@ -407,6 +409,20 @@ package body Buildsupport_Utils is
Zip_Id := Source_Text (1); Zip_Id := Source_Text (1);
Result.Zip_File := Just (US (Get_Name_String (Zip_Id))); Result.Zip_File := Just (US (Get_Name_String (Zip_Id)));
end if; end if;
-- Parse context parameters
if Present (AIN.Subcomponents (Inst)) then
Subco := AIN.First_Node (AIN.Subcomponents (Inst));
while Present (Subco) loop
case Get_Category_Of_Component (Subco) is
when CC_Data =>
null;
when others =>
null;
end case;
Subco := AIN.Next_Node (Subco);
end loop;
end if;
return Result; return Result;
end Parse_Function; end Parse_Function;
......
...@@ -105,6 +105,9 @@ package Buildsupport_Utils is ...@@ -105,6 +105,9 @@ package Buildsupport_Utils is
-- Types needed to build the AST of the TASTE Interface View in Ada -- Types needed to build the AST of the TASTE Interface View in Ada
type Parameter_Direction is (param_in, param_out); type Parameter_Direction is (param_in, param_out);
package Option_UString is new Option_Type (Unbounded_String);
use Option_UString;
type ASN1_Parameter is type ASN1_Parameter is
record record
Name : Unbounded_String; Name : Unbounded_String;
...@@ -139,18 +142,16 @@ package Buildsupport_Utils is ...@@ -139,18 +142,16 @@ package Buildsupport_Utils is
Sort : Unbounded_String; Sort : Unbounded_String;
Default_Value : Unbounded_String; Default_Value : Unbounded_String;
ASN1_Module : Unbounded_String; ASN1_Module : Unbounded_String;
ASN1_File_Name : Unbounded_String; ASN1_File_Name : Option (Present => False);
end record; end record;
package Ctxt_Params is new Indefinite_Vectors (Natural, Context_Parameter); package Ctxt_Params is new Indefinite_Vectors (Natural, Context_Parameter);
package Option_Zip is new Option_Type (Unbounded_String);
use Option_Zip;
type Taste_Terminal_Function is type Taste_Terminal_Function is
record record
Name : Unbounded_String; Name : Unbounded_String;
Language : Supported_Source_Language; Language : Supported_Source_Language;
Zip_File : Option_Zip.Option (False) := Nothing; Zip_File : Option (Present => False);
Context_Params : Ctxt_Params.Vector; Context_Params : Ctxt_Params.Vector;
User_Properties : Property_Maps.Map; User_Properties : Property_Maps.Map;
Timers : String_Vectors.Vector; Timers : String_Vectors.Vector;
......
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