Commit abe6bbf9 authored by Maxime Perrotin's avatar Maxime Perrotin

Add parsing of properties

parent 70c8b054
......@@ -209,6 +209,8 @@ procedure BuildSupport is
when Language_Rhapsody => C_Set_Language_To_Rhapsody;
when Language_Gui => C_Set_Language_To_GUI;
when Language_VHDL => C_Set_Language_To_VHDL;
when Language_VHDL_BRAVE =>
C_Set_Language_To_VHDL_BRAVE;
when Language_System_C => C_Set_Language_To_System_C;
when Language_Device =>
C_Set_Language_To_BlackBox_Device;
......@@ -249,6 +251,17 @@ procedure BuildSupport is
C_Set_Is_Component_Type;
end if;
end;
declare
-- Get the list of AADL properties
Properties : constant Property_Maps.Map :=
Get_Properties_Map (CI);
begin
-- Iterate on the Function properties
for each in Properties.Iterate loop
Put_Line (Property_Maps.Key (each) & " : " &
Property_Maps.Element (each));
end loop;
end;
-- Parse the functional states of this FV
if not Is_Empty (Subcomponents (CI)) then
......
......@@ -25,6 +25,11 @@ package Imported_Routines is
DistName : String;
DistNameLen : Integer);
procedure C_Set_Property (Name : String;
Len : Integer;
Val : String;
Val_Len : Integer);
procedure C_Set_Distant_APLC (Arg : String; Len : Integer);
procedure C_End_IF;
procedure C_End_FV;
......@@ -231,6 +236,7 @@ private
pragma Import (C, C_New_FV, "New_FV");
pragma Import (C, C_Add_PI, "Add_PI");
pragma Import (C, C_Add_RI, "Add_RI");
pragma Import (C, C_Set_Property, "Set_Property");
pragma Import (C, C_Set_Distant_APLC, "Set_Distant_APLC");
pragma Import (C, C_End_IF, "End_IF");
pragma Import (C, C_End_FV, "End_FV");
......
......@@ -149,6 +149,18 @@ void Set_Debug_Messages()
}
}
// Functions in AADL model may contain additional properties, set them in a list
void Set_Property (char *name, size_t name_len, char *val, size_t val_len)
{
AADL_Property *property;
property = (AADL_Property *) malloc (sizeof (AADL_Property));
assert (NULL != fv && NULL != property);
build_string (&(property->name), name, name_len);
build_string (&(property->value), val, val_len);
APPEND_TO_LIST (AADL_Property, fv->properties, property);
}
void Set_Language_To_SDL()
{
......@@ -361,7 +373,7 @@ void Set_Context_Variable (char *name, size_t len1, char *type, size_t len2,
/* Convert '_' to '-' to be ASN.1-compliant */
for (i=0; i<len4; i++) if ('_' == cp->type.module[i]) cp->type.module[i] = '-';
APPEND_TO_LIST (Context_Parameter, fv->context_parameters, cp);
}
......
......@@ -921,6 +921,7 @@ void Create_FV(FV ** fv)
(*fv)->thread_id = 0;
(*fv)->process = NULL;
(*fv)->context_parameters = NULL;
(*fv)->properties = NULL;
/* artificial: for VT-created functions */
(*fv)->artificial = false;
/* original_name is set when artificial==true */
......
......@@ -66,6 +66,7 @@ void Set_Cyclic_IF();
void Set_Unknown_IF();
void Set_ASync_IF();
void Set_Sync_IF();
void Set_Property (char *name, size_t name_len, char *val, size_t val_len);
void Set_Language_To_GUI();
void Set_Language_To_CPP();
void Set_Language_To_VDM();
......
......@@ -140,6 +140,14 @@ typedef struct t_asntype {
DECLARE_LIST (ASN1_Type)
/* Type used to store an AADL property */
typedef struct t_property {
String *name;
String *value;
} Property;
DECLARE_LIST (Property)
/* Type used to define a context parameter (functional state) */
typedef struct t_contextparam {
char *name;
......@@ -241,6 +249,7 @@ typedef struct t_fv {
struct t_FV_list *calling_threads;
int thread_id;
Context_Parameter_list *context_parameters;
Property_list *properties;
bool artificial;
char *original_name;
bool timer;
......
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