Commit b6107aa7 authored by julien.delange's avatar julien.delange
Browse files

add documentation to the code



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@685 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent dea07ba2
......@@ -63,9 +63,22 @@ package body Ocarina.Backends.ASN1.Deployment is
procedure Visit_Subprogram_Instance (E : Node_Id);
Thread_Enumeration : List_Id;
-- The Thread_Enumeration list contains the identifiers
-- and the associated identifier value for each thread
-- within the distributed system.
Thread_Id : Unsigned_Long_Long := 0;
-- The thread identifier, unique for each thread in the
-- DISTRIBUTED system.
Port_Enumeration : List_Id;
-- The Port_Enumeration list contains the enumeration of all
-- ports used in the distributed system. In fact, we add each
-- port in an enumeration and associate a value to them.
Port_Id : Unsigned_Long_Long := 0;
-- The port identifier. This is unique for each port.
Module_Node : Node_Id;
-----------
......@@ -197,13 +210,14 @@ package body Ocarina.Backends.ASN1.Deployment is
---------------------------
procedure Visit_Thread_Instance (E : Node_Id) is
S : Node_Id;
F : Node_Id;
Call_Seq : Node_Id;
Spg_Call : Node_Id;
Thread_Name : Name_Id;
Parent_Name : Name_Id;
Port_Name : Name_Id;
S : Node_Id;
F : Node_Id;
Call_Seq : Node_Id;
Spg_Call : Node_Id;
Thread_Name : Name_Id;
Port_Name : Name_Id;
Parent_Name : Name_Id;
-- Name of the containing process.
begin
Set_Str_To_Name_Buffer ("thread-");
......@@ -222,6 +236,10 @@ package body Ocarina.Backends.ASN1.Deployment is
Thread_Name := To_Upper (Thread_Name);
Thread_Name := Replace_Char (Thread_Name, '_', '-');
-- We replace _ by - because ASN1 does not allow
-- character _.
Append_Node_To_List
(Make_Enumerated_Value
(Thread_Name, Thread_Id),
......@@ -229,6 +247,12 @@ package body Ocarina.Backends.ASN1.Deployment is
Thread_Id := Thread_Id + 1;
-- Here, we build the ASN1 name of the thread and add it to the
-- Thread_Enumeration list that contains all threads of the
-- distributed system. When we discover a thread, we increment
-- the thread identifier so that we have a unique identifier
-- for each thread.
if not AAU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
......@@ -275,6 +299,8 @@ package body Ocarina.Backends.ASN1.Deployment is
Port_Name := To_Upper (Port_Name);
Port_Name := Replace_Char (Port_Name, '_', '-');
-- We replace _ by - because ASN1 does not allow
-- character _.
Append_Node_To_List
(Make_Enumerated_Value
......@@ -282,6 +308,10 @@ package body Ocarina.Backends.ASN1.Deployment is
Port_Enumeration);
Port_Id := Port_Id + 1;
-- Here, we build the port identifier (we increment it)
-- each time a port is discovered in a thread and add
-- it to the Port_Enumeration list that contains all
-- port identifiers.
end if;
F := Next_Node (F);
......
......@@ -160,21 +160,39 @@ package Ocarina.Backends.ASN1_Tree.Nutils is
procedure New_Token (T : Token_Type; I : String := "");
function Make_ASN1_File (Identifier : Node_Id) return Node_Id;
-- Build a node that describes an ASN1 file. The name
-- of the file is described in the parameter.
function Make_Defining_Identifier (Name : Name_Id) return Node_Id;
-- Build a node that contains an identifier.
function Make_Enumerated_Value (Name : Name_Id) return Node_Id;
-- Build a node that describes a member of an enumeration but
-- does not associate any value with it.
function Make_Enumerated_Value (Name : Name_Id; V : Unsigned_Long_Long)
return Node_Id;
-- Make a node that describes a member of an enumeration and associated
-- an integer value to it. The first parameter is the name of the
-- enumeration while the second is its corresponding value.
function Make_Enumerated return Node_Id;
-- Make an enumeration definition list with an empty list of
-- values.
function Make_Enumerated (L : List_Id) return Node_Id;
-- Make an enumerated nodes. The parameters are the values
-- of the enumeration. The returned node_id can be associated
-- with a type definition.
function Make_Type_Definition (Name : Name_Id; Decl : Node_Id)
return Node_Id;
-- Make a Type_Definition node. First parameter is the name
-- of the type, the second one is the declaration of this type
-- Enumerated/Choice/... node.
function Make_Literal (Value : Value_Id) return Node_Id;
-- Make a Literal that contains a value (Value-Id), see
-- Ocarina.Backends.ASN1_Values for more information.
end Ocarina.Backends.ASN1_Tree.Nutils;
......@@ -268,6 +268,12 @@ package body Ocarina.Backends.PO_HI_C is
Generate_PolyORB_HI_C_Makefile (Instance_Root);
-- If we have to generate the ASN1 deployment file, then
-- we enter the directory that contains the generate
-- code and invoke directly the ASN1 generator with the
-- instance root. It should automatically create an .asn1
-- file that contains deployment/messages informations.
if Generate_ASN1_Deployment then
Enter_Directory (CTN.Name (C_Root));
ASN1.Generate (Instance_Root);
......
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