Next: , Previous: Low level API to manipulate tree nodes, Up: The Ocarina Core Library


6.1.4 API to build and manipulate AADL models

This section describes the high level function's to manipulate AADL models:

  1. Builder API~: These functions (declared in the Ocarina.Builder hierarchy) are provided to create the main kinds of nodes: components, namespaces, subclauses, annexes, properties, etc. They are named Add_New_..... They create a new node and insert it as a child of a parent node, except for the root node. This helps ensure that the description structure is valid, since the API only allows valid constructions. All these functions take at least three parameters:

    Other parameters may be required, to specify information such as the category of the component (bus, process, etc.), whether the subclause is a refinement, etc. Some parameters have default values, meaning that they can be omitted if the value is not known when the node is created; the values can be set later, using lower-level access functions. Functions simply named Add_... are used internally to add child nodes to their parents. No verification is performed; they just ensure the child lists are created before inserting the node in them.

  2. Verification API: Functions are provided to check the validity of AADL models. They ensure that all referenced AADL entities are declared, that their type is correct, etc. They also check that AADL properties are consistent.
  3. Interrogation API: These functions (declared in the Ocarina.Analyzer hierarchy) are provided to interrogate AADL models in order to find entities, get properties, etc.
6.1.4.1 Ocarina.Builder

This package defines no subprogram

6.1.4.2 Ocarina.Builder.Annexes

This package provides functions to build annex nodes into the AADL tree.

This package defines the following subprograms:

Set_Annex_Content: Set the text of the annex. Annex is the Node_Id of the annex library or subclause, returned by Add_New_Annex_Subclause or Add_New_Annex_Library. Text is the Name_Id referencing the text of the annex. Return True is everything went right, else False.

     function Set_Annex_Content
          (Annex : Types.Node_Id;
           Text : Types.Name_Id)
          return Boolean;

Add_New_Annex_Subclause: Create a new annex subclause. An annex subclause can be inserted into a component declaration (type or implementation) or a port group declaration. Loc is the location of the annex in the parsed text. Annex_Name is the name of the annex subclause. Namespace is the component or the port group where the annex must be inserted. This functions returns the Node_Id of the newly created annex subclause node, or No_Node if something went wrong.

     function Add_New_Annex_Subclause      (Loc : Locations.Location;
           Annex_Name : Types.Node_Id;
           Namespace : Types.Node_Id)
          return Types.Node_Id;

Add_New_Annex_Library: Create a new annex library. An annex library can be inserted into a package or the top level AADL specification (i.e. the unnamed namespace). Loc is the location of the annex in the parsed text. Annex_Name is the name of the annex library. Namespace is the package specification or the top level AADL specification where the annex must be inserted. This functions returns the Node_Id of the newly created annex library node, or No_Node if something went wrong.

     function Add_New_Annex_Library
          (Loc : Locations.Location;
           Annex_Name : Types.Node_Id;
           Namespace : Types.Node_Id;
           Is_Private : Boolean := False)
          return Types.Node_Id;
6.1.4.3 Ocarina.Builder.Components

This package defines the following subprograms:

Add_Annex: Add an annex subclause into a component (type or implementation). Component is a Node_Id referencing the component. Annex is a Node_Id referencing the annex subclause. Returns True if the annex was correctly added into the component, else False.

     function Add_Annex
          (Component : Node_Id;
           Annex     : Node_Id)
          return Boolean;

Add_Connection: Add a connection into a component implementation. Component is a Node_Id referencing the component implementation. Connection is a Node_Id referencing the connection. Returns True if the connection was correctly added into the component, else False.

     function Add_Connection
          (Component  : Node_Id;
           Connection : Node_Id)
          return Boolean;

Add_Feature: Add a feature into a component type. Component is a Node_Id referencing the component type. Feature is a Node_Id referencing the feature. Returns True if the feature was correctly added into the component, else False.

     function Add_Feature
          (Component : Node_Id;
           Feature   : Node_Id)
          return Boolean;

Add_Refined_Type: Add a refined type into a component implementation. Refined types correspond to refinements of the component type features.

     function Add_Refined_Type
          (Component : Node_Id;
           Refined_Type : Node_Id)
          return Boolean;

Add_Subcomponent: Add a subcomponent into a component implementation. Component is a Node_Id referencing the component implementation. Subcomponent is a Node_Id referencing the subcomponent. Returns True if the subcomponent was correctly added into the component, else False.

     function Add_Subcomponent
          (Component    : Node_Id;
           Subcomponent : Node_Id)
          return Boolean;

Add_Subprogram_Call_Sequence: Add a subprogram call sequence into a component implementation. Component is a Node_Id referencing the component implementation. Call_Sequence is a Node_Id referencing the subcomponent. Returns True if the sequence was correctly added into the component, else False.

     function Add_Subprogram_Call_Sequence
          (Component     : Node_Id;
           Call_Sequence : Node_Id)
          return Boolean;

Add_Flow_Spec: Add a flow specification into a component type. Component is a Node_Id referencing the component type. Flow_Spec is a Node_Id referencing the flow. Returns True if the flow was correctly added into the component, else False.

     function Add_Flow_Spec
          (Component : Node_Id;
           Flow_Spec : Node_Id)
          return Boolean;

Add_Flow_Implementation: Add a flow implementation into a component implementation. Component is a Node_Id referencing the component implementation. Flow_Impl is a Node_Id referencing the flow. Returns True if the flow was correctly added into the component, else False.

     function Add_Flow_Implementation
          (Component : Node_Id;
           Flow_Impl : Node_Id)
          return Boolean;

Add_End_To_End_Flow_Spec: Add an end to end flow specification into a component implementation. Component is a Node_Id referencing the component implementation. Flow_Impl is a Node_Id referencing the flow. Returns True if the flow was correctly added into the component, else False.

     function Add_End_To_End_Flow_Spec
          (Component       : Node_Id;
           End_To_End_Flow : Node_Id)
          return Boolean;

Add_Mode: Add a mode (declaration or transition) into a component implementation. Component is a Node_Id referencing the component implementation. Mode is a Node_Id referencing the mode declaration or mode transition. Returns True if the mode was correctly added into the component, else False.

     function Add_Mode
          (Component : Node_Id;
           Mode      : Node_Id)
          return Boolean;

Add_Property_Association: Add a property association into a component (type or implementation). Component is a Node_Id referencing the component type or implementation. Property_Association is a Node_Id referencing the property association. Returns True if the property was correctly added into the component, else False. Component creation

     function Add_Property_Association
          (Component            : Node_Id;
           Property_Association : Node_Id)
          return Boolean;

Add_New_Component_Type: Create a new component type node. A component type can be inserted into a package or the top level AADL specification (aka the unnamed namespace). Loc is the location of the component in the parsed text. Identifier is a Node_Id referencing the name of the component. Namespace is either a package specification or the top level AADL specification. Component_Type is the component category (processor, memory, process, etc.). Is_Private indicates if the component is declaraed in the private or the public part of the package; it is only relevant if Namespace references a package specification. Returns the Node_Id of the newly created component type node, or No_Node if something went wrong.

     function Add_New_Component_Type
          (Loc            : Location;
           Identifier     : Node_Id;
           Namespace      : Node_Id;
           Component_Type : Ocarina.Entities.Components.Component_Category;
           Is_Private     : Boolean := False)
          return Node_Id;

Add_New_Component_Implementation: Create a new component implementation node. A component implementation can be inserted into a package or the top level AADL specification (aka the unnamed namespace). Loc is the location of the component in the parsed text. Identifier is a Node_Id referencing the name of the component. Namespace is either a package specification or the top level AADL specification. Component_Type is the component category (processor, memory, process, etc.). Is_Private indicates if the component is declaraed in the private or the public part of the package; it is only relevant if Namespace references a package specification. Returns the Node_Id of the newly created component implementation node, or No_Node if something went wrong.

     function Add_New_Component_Implementation
          (Loc            : Location;
           Identifier     : Node_Id;
           Namespace      : Node_Id;
           Component_Type : Ocarina.Entities.Components.Component_Category;
           Is_Private     : Boolean := False)
          return Node_Id;

Add_New_Port_Group: Create a new port group type. It can be inserted into a package or the top level AADL specification.

     function Add_New_Port_Group
          (Loc        : Location;
           Name       : Node_Id;
           Namespace  : Node_Id;
           Is_Private : Boolean := False)
          return Node_Id;
6.1.4.4 Ocarina.Builder.Components.Connections

This package defines the following subprograms:

Add_Property_Association: Add a property association to the connection declaration. Connection must reference a connection declaration. Property_Association references the property association. Return True if everything went right, else False.

     function Add_Property_Association
          (Connection           : Node_Id;
           Property_Association : Node_Id)
          return Boolean;

Add_New_Connection: Create and add a new connection into a component implementation. Loc is the location of the connection in the parsed text. Name references an identifier which contains the name of the connection, if any. Comp_Impl references the component implementation. Category is the type of the connection. Is_Refinement indicates wether the connection is a refinement or not. Source and Destination are the left and right memebers of the connection. In_Modes contains the list of the modes associated to the connection. Name can be No_Node, if the connection is not nammed. Return the Node_Id of the newly created connection if everything went right, else No_Node.

     function Add_New_Connection
          (Loc           : Location;
           Name          : Node_Id;
           Comp_Impl     : Node_Id;
           Category      : Ocarina.Entities.Components.Connections.Connection_Type;
           Is_Refinement : Boolean := False;
           Source        : Node_Id := No_Node;
           Destination   : Node_Id := No_Node;
           In_Modes      : Node_Id := No_Node)
          return Node_Id;
6.1.4.5 Ocarina.Builder.Components.Features

The core API for the feature subclause of the component types and the port group types.

This package defines the following subprograms:

Add_Property_Association:

     function Add_Property_Association
          (Feature              : Node_Id;
           Property_Association : Node_Id)
          return Boolean;

Add_New_Port_Spec:

     function Add_New_Port_Spec
          (Loc               : Location;
           Name              : Node_Id;
           Container         : Node_Id;
           Is_In             : Boolean;
           Is_Out            : Boolean;
           Is_Data           : Boolean;
           Is_Event          : Boolean;
           Is_Refinement     : Boolean := False;
           Associated_Entity : Node_Id := No_Node)
          return Node_Id;

Add_New_Port_Group_Spec:

     function Add_New_Port_Group_Spec
          (Loc           : Location;
           Name          : Node_Id;
           Container     : Node_Id;
           Is_Refinement : Boolean := False)
          return Node_Id;

Add_New_Server_Subprogram:

     function Add_New_Server_Subprogram
          (Loc           : Location;
           Name          : Node_Id;
           Container     : Node_Id;
           Is_Refinement : Boolean := False)
          return Node_Id;

Add_New_Data_Subprogram_Spec:

     function Add_New_Data_Subprogram_Spec
          (Loc           : Location;
           Name          : Node_Id;
           Container     : Node_Id;
           Is_Refinement : Boolean := False)
          return Node_Id;

Add_New_Subcomponent_Access:

     function Add_New_Subcomponent_Access
          (Loc           : Location;
           Name          : Node_Id;
           Container     : Node_Id;
           Is_Refinement : Boolean := False;
           Category      : Ocarina.Entities.Components.Component_Category;
           Is_Provided   : Boolean)
          return Node_Id;

Add_New_Parameter:

     function Add_New_Parameter
          (Loc           : Location;
           Name          : Node_Id;
           Container     : Node_Id;
           Is_In         : Boolean := True;
           Is_Out        : Boolean := True;
           Is_Refinement : Boolean := False)
          return Node_Id;
6.1.4.6 Ocarina.Builder.Components.Flows

This package defines the following subprograms:

Add_Property_Association: Add a property association to the flow declaration. Flow must reference a flow implementation or a flow specification. Property_Association references the property association. Return True if everything went right, else False.

     function Add_Property_Association
          (Flow                 : Node_Id;
           Property_Association : Node_Id)
          return Boolean;

Add_New_Flow_Spec: Create a new flow specification inside a component type

     function Add_New_Flow_Spec
          (Loc           : Location;
           Name          : Node_Id;
           Comp_Type     : Node_Id;
           Category      : Ocarina.Entities.Components.Flows.Flow_Category;
           Source_Flow   : Node_Id;
           Sink_Flow     : Node_Id;
           Is_Refinement : Boolean := False)
          return Node_Id;

Add_New_Flow_Implementation: Create a new flow implementation inside a component implementation

     function Add_New_Flow_Implementation
          (Loc           : Location;
           Container     : Node_Id;
           Name          : Node_Id;
           Category      : Ocarina.Entities.Components.Flows.Flow_Category;
           In_Modes      : Node_Id;
           Is_Refinement : Boolean)
          return Node_Id;

Add_New_End_To_End_Flow_Spec: Create a new end to end flow specification inside a component implementation

     function Add_New_End_To_End_Flow_Spec
          (Loc           : Location;
           Container     : Node_Id;
           Name          : Node_Id;
           In_Modes      : Node_Id;
           Is_Refinement : Boolean)
          return Node_Id;
6.1.4.7 Ocarina.Builder.Components.Modes

This package provides functions to handle modes in the component implementations.

This package defines the following subprograms:

Add_Property_Association: Add a property association to the mode declaration or mode transition. Mode must either reference a mode declaration or a mode transition. Property_Association references the property association. Return True if everything went right, else False.

     function Add_Property_Association
          (Mode : Node_Id;
           Property_Association : Node_Id)
          return Boolean;

Add_New_Mode: Add a new mode declaration into a component implementation. Loc is the location of the mode declaration in the parsed text. Identifier references an identifier containing the name of the mode. Component references the component implementation. Is_Implicit is used by other parts of the builder API, for "in modes" clauses. You should always keep it False. Return a Node_Id referencing the newly created mode if everything went right, else False.

     function Add_New_Mode
          (Loc : Location;
           Identifier : Node_Id;
           Component : Node_Id)
          return Node_Id;

Add_New_Mode_Transition: Add a new empty mode transition into a component implementation. Source, Destination, etc. of the mode transition must be added manually after the node has been created. Loc is the location of the mode transition in the parsed text. Identifier references an identifier containing the name of the mode. Component references the component implementation. Return a Node_Id referencing the newly created mode if everything went right, else False.

     function Add_New_Mode_Transition
          (Loc : Location;
           Component : Node_Id)
          return Node_Id;
6.1.4.8 Ocarina.Builder.Components.Subcomponents

This package defines the following subprograms:

Add_Property_Association: Add a property association to the subcomponent declaration. Subcomponent must reference a Subcomponent declaration. Property_Association references the property association. Return True if everything went right, else False.

     function Add_Property_Association
          (Subcomponent         : Node_Id;
           Property_Association : Node_Id)
          return Boolean;

Add_New_Subcomponent: Create and add a new subcomponent into a component implementation. Loc is the location of the subcomponent in the parsed text. Name references an identifier which contains the name of the subcomponent. Comp_Impl references the component implementation. Category is the type of the subcomponent. Is_Refinement indicates wether the connection is a refinement or not. In_Modes contains the list of the modes associated to the connection. Return the Node_Id of the newly created subcomponent if everything went right, else No_Node.

     function Add_New_Subcomponent
          (Loc           : Location;
           Name          : Node_Id;
           Comp_Impl     : Node_Id;
           Category      : Ocarina.Entities.Components.Component_Category;
           Is_Refinement : Boolean := False;
           In_Modes      : Node_Id := No_Node)
          return Node_Id;
6.1.4.9 Ocarina.Builder.Components.Subprogram_Calls

This package defines the following subprograms:

Add_Property_Association: Add a property association to the subprogram call. Subprogram_Call must reference a subprogram call (not a call sequence). Property_Association references the property association. Return True if everything went right, else False.

     function Add_Property_Association
          (Subprogram_Call      : Node_Id;
           Property_Association : Node_Id)
          return Boolean;

Add_Subprogram_Call: Add a subprogram call to the subprogram call sequence. Subprogram_Call must reference a subprogram call (not a call sequence). Call_Sequence references the subprogram call sequence. Return True if everything went right, else False.

     function Add_Subprogram_Call      (Call_Sequence   : Node_Id;
           Subprogram_Call : Node_Id)
          return Boolean;

Add_New_Subprogram_Call: Create and add a new subprogram call into a subprogram call sequence. Loc is the location of the call sequence in the parsed text. Name references an identifier which contains the name of the subprogram call. Call_Sequence references the subprogram call sequence that contains the subprogram call. The function return the Node_Id of the newly created subprogram call if everything went right, else No_Node.

     function Add_New_Subprogram_Call      (Loc           : Location;
           Name          : Node_Id;
           Call_Sequence : Node_Id)
          return Node_Id;

Add_New_Subprogram_Call_Sequence: Create and add a new subprogram call sequence into a component implementation. Loc is the location of the call sequence in the parsed text. Name references an identifier which contains the name of the call sequence, if any. Comp_Impl references the component implementation. In_Modes contains the list of the modes associated to the connection. Name can be No_Node, if the sequence is not nammed. Subprogram calls Return the Node_Id of the newly created call sequence if everything went right, else No_Node.

     function Add_New_Subprogram_Call_Sequence
          (Loc       : Location;
           Name      : Node_Id;
           Comp_Impl : Node_Id;
           In_Modes  : Node_Id := No_Node)
          return Node_Id;
6.1.4.10 Ocarina.Builder.Namespaces

This package defines the following subprograms:

Add_Declaration: Insert any component, property_set, package or port_group into the AADL specification. Namespace must reference the node created with Initialize_Unnamed_Namespace or a package specification. Return True if the element was correctly inserted, else False

     function Add_Declaration
          (Namespace : Types.Node_Id;
           Element : Types.Node_Id)
          return Boolean;

Initialize_Unnamed_Namespace: Create the AADL specification node, which corresponds to the top level of the AADL description. This function must be invoked first, as all the other elements of the description will be added to this one. Loc is the location of the AADL specification in the parsed text. Return a reference to the newly created node if everything went right, else False.

     function Initialize_Unnamed_Namespace
          (Loc : Locations.Location)
          return Types.Node_Id;

Add_New_Package: Checks if a package of that name already exists. If so, return this one, else create a new one and return it. Loc is the location of the package specification in the parsed text. Pack_Name is a Node_Id referencing an identifier which contains the name of the package. Namespace must reference the top level AADL specification node.

     function Add_New_Package
          (Loc : Locations.Location;
           Pack_Name : Types.Node_Id;
           Namespace : Types.Node_Id)
          return Types.Node_Id;

Add_Property_Association: Add a property association to the list of the package properties, without checking for homonyms or whatever. This function should be only used by other functions of the core API. Namespace must reference a package specification. Return True if the property was added, else False.

     function Add_Property_Association
          (Pack : Types.Node_Id;
           Property_Association : Types.Node_Id)
          return Boolean;
6.1.4.11 Ocarina.Builder.Properties

This package defines the following subprograms:

Add_New_Property_Set: Either Single_Value /= No_Node and Mulitple_Values = No_Node, then we have a single valued constant; or Single_Value = No_Node, then we have a muli valued constant

     function Add_New_Property_Set
          (Loc       : Location;
           Name      : Node_Id;
           Namespace : Node_Id)
          return Node_Id;

Add_New_Property_Constant_Declaration: Either Single_Value /= No_Node and Mulitple_Values = No_Node, then we have a single valued constant; or Single_Value = No_Node, then we have a muli valued constant

     function Add_New_Property_Constant_Declaration
          (Loc             : Location;
           Name            : Node_Id;
           Property_Set    : Node_Id;
           Constant_Type   : Node_Id;
           Unit_Identifier : Node_Id;
           Single_Value    : Node_Id;
           Multiple_Values : List_Id)
          return Node_Id;

Add_New_Property_Type_Declaration: Either Applies_To_All is set to True and Applies_To is empty, or Applies_To_All is False and Applies_To is not empty

     function Add_New_Property_Type_Declaration
          (Loc             : Location;
           Name            : Node_Id;
           Property_Set    : Node_Id;
           Type_Designator : Node_Id)
          return Node_Id;

Add_New_Property_Name_Declaration: Either Applies_To_All is set to True and Applies_To is empty, or Applies_To_All is False and Applies_To is not empty

     function Add_New_Property_Name_Declaration
          (Loc                     : Location;
           Name                    : Node_Id;
           Property_Set            : Node_Id;
           Is_Inherit              : Boolean;
           Is_Access               : Boolean;
           Single_Default_Value    : Node_Id;
           Multiple_Default_Value  : List_Id;
           Property_Name_Type      : Node_Id;
           Property_Type_Is_A_List : Boolean;
           Applies_To_All          : Boolean;
           Applies_To              : List_Id)
          return Node_Id;

Add_New_Property_Association: If Check_For_Conflicts is set to True, then the function checks whether there is a property association of that name already. If override is set to True and there is a conflict, then it is overridden by the new association. Else the new association is ignored. If Check_For_Conflicts is set to False, then the value of Override is ignored.

     function Add_New_Property_Association
          (Loc                 : Location;
           Name                : Node_Id;
           Property_Name       : Node_Id;
           Container           : Node_Id;
           In_Binding          : Node_Id;
           In_Modes            : Node_Id;
           Property_Value      : Node_Id;
           Is_Constant         : Boolean;
           Is_Access           : Boolean;
           Is_Additive         : Boolean;
           Applies_To          : List_Id;
           Check_For_Conflicts : Boolean := False;
           Override            : Boolean := False)
          return Node_Id;
6.1.4.12 Ocarina.Analyzer.Finder

This package provides functions to search nodes in the abstract tree. The functions return No_Node if nothing was found.

This package defines the following subprograms:

Select_Nodes: Build a list (chained using the accessor Next_Entity) from Decl_List and appends it to Last_Node. This list will contain the nodes whose kinds correspond to Kinds.

     procedure Select_Nodes
          (Decl_List  :        List_Id;
           Kinds      :        Node_Kind_Array;
           First_Node : in out Node_Id;
           Last_Node  : in out Node_Id);

Find_Property_Entity: Find a property entity (type, name or constant). If Property_Set_Identifier is No_Node and the current scope is the one of a property set, try to find the property in it. Finally, look for the implicit property sets (AADL_Project and AADL_Properties).

     function Find_Property_Entity
          (Root                    : Node_Id;
           Property_Set_Identifier : Node_Id;
           Property_Identifier     : Node_Id;
           Options                 : Analyzer_Options)
          return Node_Id;

Find_Component_Classifier: Same as above, but find a component classifier

     function Find_Component_Classifier
          (Root                 : Node_Id;
           Package_Identifier   : Node_Id;
           Component_Identifier : Node_Id;
           Options              : Analyzer_Options)
          return Node_Id;

Find_Port_Group_Classifier: Same as above, but find a port group

     function Find_Port_Group_Classifier
          (Root                  : Node_Id;
           Package_Identifier    : Node_Id;
           Port_Group_Identifier : Node_Id;
           Options               : Analyzer_Options)
          return Node_Id;

Find_Feature: Find a feature in a component type or implementation

     function Find_Feature
          (Component          : Node_Id;
           Feature_Identifier : Node_Id)
          return Node_Id;

Find_Mode: Same as above, but find a mode

     function Find_Mode
          (Component       : Node_Id;
           Mode_Identifier : Node_Id)
          return Node_Id;

Find_Subcomponent: Find a subcomponent in a component implementation. If In_Modes is specified, return the subcomponent that are set in the given modes.

     function Find_Subcomponent
          (Component               : Node_Id;
           Subcomponent_Identifier : Node_Id;
           In_Modes                : Node_Id := No_Node)
          return Node_Id;

Find_Subprogram_Call: Same as above but find a subprogram call

     function Find_Subprogram_Call      (Component       : Node_Id;
           Call_Identifier : Node_Id;
           In_Modes        : Node_Id := No_Node)
          return Node_Id;

Find_Connection: Same as above but find a connection

     function Find_Connection
          (Component             : Node_Id;
           Connection_Identifier : Node_Id;
           In_Modes              : Node_Id := No_Node)
          return Node_Id;

Find_Flow_Spec: Find a flow in a component type or implementation

     function Find_Flow_Spec
          (Component       : Node_Id;
           Flow_Identifier : Node_Id)
          return Node_Id;

Find_Subclause: Same as above but find a subclause

     function Find_Subclause      (Component  : Node_Id;
           Identifier : Node_Id)
          return Node_Id;

Find_All_Declarations: Returns the first node of a list of declarations corresponding to the Kinds requested. Following nodes are accessed through the Next_Entity accessor. If no Kinds are requested, then return all the declarations found. If the Namespace is not given, search the declaration in the whole AADL specification declarations and its namespaces. Otherwise, search the declaration in the given namespace.

     function Find_All_Declarations
          (Root      : Node_Id;
           Kinds     : Node_Kind_Array;
           Namespace : Node_Id := No_Node)
          return Entity_List;

Find_All_Component_Types: Return the first component type found in the Namespace. If Namespace is No_Node, then return the first component type declaration in the whole AADL specification. Following declarations are accessed using the Next_Entity accessor.

     function Find_All_Component_Types
          (Root      : Node_Id;
           Namespace : Node_Id := No_Node)
          return Entity_List;

Find_All_Top_Level_Systems: Return all systems implementations whose component type do not have any feature. Those systems correspond to the roots of the instantiated architecture. Note that there should be only one such system; else this would mean several independent architectures are described.

     function Find_All_Top_Level_Systems (Root : Node_Id) return Entity_List;

Find_All_Subclauses: General function that returns the first node of a list of subclauses corresponding to the Kinds requested. Following nodes are accessed through the Next_Entity accessor.

     function Find_All_Subclauses
          (AADL_Declaration : Node_Id;
           Kinds            : Node_Kind_Array)
          return Entity_List;

Find_All_Features: Applicable to component types and implementations, and port group types.

     function Find_All_Features
          (AADL_Declaration : Node_Id)
          return Entity_List;

Find_All_Subclause_Declarations_Except_Properties: Applicable to component types and implementations, and port group types.

     function Find_All_Subclause_Declarations_Except_Properties
          (AADL_Declaration : Node_Id)
          return Entity_List;

Find_All_Property_Associations: Applicable to component types and implementations, and port group types.

     function Find_All_Property_Associations
          (AADL_Declaration : Node_Id)
          return Entity_List;

Find_Property_Association: Find the property association named Property_Association_Name. Return No_Node if nothing was found.

     function Find_Property_Association
          (AADL_Declaration          : Node_Id;
           Property_Association_Name : Name_Id)
          return Node_Id;
6.1.4.13 Ocarina.Analyzer.Queries

This package contains routines that are used to get several information from the AADL tree.

This package defines the following subprograms:

Is_An_Extension: Returns True if Component is an extension of Ancestor, whether by the keyword 'extends' or because Ancestor is a corresponding component type.

     function Is_An_Extension
          (Component : Node_Id;
           Ancestor  : Node_Id)
          return Boolean;

Needed_By: Return True iff N is needed by Entity (for example Entity has a subcompnent of type N). It also return True if N is needed indirectly by Entity (through another intermediate need). In order for this function to work fine, the AADL tree must have been expanded. However, since it acts only on the AADL syntax tree, this function is put in this package. NOTE: If N is a property *declaration* node, the result will be True reguardless the actual need of Entity to N.

     function Needed_By (N : Node_Id; Entity : Node_Id) return Boolean;

Property_Can_Apply_To_Entity: Return True if the property association Property can be applied to Entity. Otherwise, return False. Beware that this function performs exact verification; a property cannot apply to a package.

     function Property_Can_Apply_To_Entity
          (Property : Node_Id;
           Entity   : Node_Id)
          return Boolean;

Is_Defined_Property: Return True if the property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Is_Defined_String_Property: Return True if the aadlstring property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_String_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Is_Defined_Integer_Property: Return True if the aadlinteger property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_Integer_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Is_Defined_Boolean_Property: Return True if the aadlboolean property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_Boolean_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Is_Defined_Float_Property: Return True if the aadlreal property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_Float_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Is_Defined_Reference_Property: Return True if the component reference property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_Reference_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Is_Defined_List_Property: Return True if the 'list of XXX' property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_List_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Is_Defined_Enumeration_Property: Return True if the enumeration property named 'Name' is defined for the AADL entity 'Entity'.

     function Is_Defined_Enumeration_Property
          (Entity : Node_Id;
           Name   : String)
          return Boolean;

Get_Value_Of_Property_Association: Return the value of the property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return No_Node.

     function Get_Value_Of_Property_Association
          (Entity : Node_Id;
           Name   : String)
          return Node_Id;

Get_String_Property: Return the value of the aadlstring property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return "".

     function Get_String_Property
          (Entity : Node_Id;
           Name   : String)
          return String;

Get_String_Property: Return the value of the aadlstring property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return No_Name.

     function Get_String_Property
          (Entity : Node_Id;
           Name   : String)
          return Name_Id;

Get_Integer_Property: Return the value of the aadlinteger property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return 0.

     function Get_Integer_Property
          (Entity : Node_Id;
           Name   : String)
          return Unsigned_Long_Long;

Get_Float_Property: Return the value of the aadlreal property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return 0.0.

     function Get_Float_Property
          (Entity : Node_Id;
           Name   : String)
          return Long_Long_Float;

Get_Boolean_Property: Return the value of the aadlboolean property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return False.

     function Get_Boolean_Property
          (Entity : Node_Id;
           Name : String)
          return Boolean;

Get_Reference_Property: Return the value of the component reference property association named 'Name' if it is defined for 'Entity'. Otherwise, return No_Node.

     function Get_Reference_Property
          (Entity : Node_Id;
           Name   : String)
          return Node_Id;

Get_List_Property: Return the value of the 'list of XXX' property association named 'Name' if it is defined for 'Entity'. The returned list is a Node_Container list. Otherwise, return No_List.

     function Get_List_Property
          (Entity : Node_Id;
           Name   : String)
          return List_Id;

Get_Enumeration_Property: Return the value of the enumeration property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return "".

     function Get_Enumeration_Property
          (Entity : Node_Id;
           Name   : String)
          return String;

Get_Enumeration_Property: Return the value of the enumeration property association named 'Name' if it is defined defined for 'Entity'. Otherwise, return No_Name.

     function Get_Enumeration_Property
          (Entity : Node_Id;
           Name : String)
          return Name_Id;

Compute_Property_Value: Compute the value of a property value and return a Node_Id containing this value. This value does not contain any reference (value ()).

     function Compute_Property_Value (Property_Value : Node_Id) return Node_Id;