Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Ada Code > Reverse engineering legacy Ada code > Mapping information for Reverse engineering Ada > Package mapping for reverse engineering Ada (Ada code)
  
Package mapping for reverse engineering Ada (Ada code)
For each Ada package (standard, generic or generic instantiation), the Reverser creates a Package (Mapping property set to Namespace) or Class in the Model.
A Package or Class is created unless the Reverser matches the Ada package to a Package or Class in the model, in which case it updates that Package or Class. If the Ada package cannot be matched, the Ada Package Mapping options on the Reverse Engineering Options 3 page of the Reverser determine whether a Package or Class is created in the Model. The Reverser attempts to match an Ada package by its name, and its Folder and Namespace structure. For more information about how folder and package structure is reverse engineered, see Folder mapping for reverse engineering Ada (Ada code).
The package body is reverse engineered to a private Operation that is scoped to the Package or Class that is created for the Ada package. The name of the Operation is set to that of the Package. The Operation is stereotyped by the «Ada Create» stereotype.
If the package uses a separate for the body, the Package or Class is stereotyped by the «Ada Separate» stereotype, and the Ada Parent Subprogram tag definition references the Operation that is generated as the subprogram that owns the separate.
If the package is physically nested inside its parents file, the Package or Class is stereotyped by the «Ada Source» stereotype and the Ada Library Unit tag definition is set to FALSE.
The Visibility property of the reverse engineered Package or Class is set according to how the Ada package is declared:
If the Ada package is declared in the parent Ada package specification, the Visibility property is set to Public.
If the Ada package is declared in the private region of the parent Ada package specification, the Visibility property is set to protected.
If the Ada package is declared in the parent package body, the Visibility property is set to Private.
For each renames declaration that renames an Ada package:
The Reverser creates a Package or Class for the renames declaration, depending on whether the Ada package that is renamed by the renames declaration was reverse engineered as a Package or a Class. The name of the new Package is as specified by the renames declaration, and the Package or Class is created as a child of the Package or Class created for the parent Ada package.
The new Package or Class is stereotyped by the «Ada Renames» stereotype:
If the Reverser can find the target Package or Class in the Model, the Package or Class that is renamed by the renames declaration is referenced through the tagged value of the Ada Rename Target tag definition (applied by the «Ada Renames» stereotype).
If the Reverser cannot find the target Package or Class in the Model, the tagged value of the Ada Rename Target Text tag definition (applied by the «Ada Renames» stereotype) is set to the name of the Ada package that is renamed by the renames declaration.
For information about how an Ada package's With and Use clauses are mapped, see With, use and use type clause mapping for reverse engineering Ada (Ada code).
Generic Packages
If the Ada package is a generic, the reverse engineered Package or Class is stereotyped by the «Ada Generic» stereotype.
The parameters of the generic package are reverse engineered to the tagged value of the Ada Generic Parameters tag definition, which is applied to the Package or Class by the «Ada Generic» stereotype.
* 
When mapped to a Class, the Template check box is not selected on the Class' Property Pages.
Generic Instantiations
If the generic instantiation package is an instantiation of a generic package that was reverse engineered as a Package, the generic instantiation package is reverse engineered as a Package in the Model.
If the generic instantiation package is an instantiation of a generic package that was reverse engineered as a Class, the generic instantiation package is reverse engineered as a Class in the Model.
The reverse engineered Package or Class is stereotyped by the «Ada Generic Instance» stereotype.
The parameters of the generic instantiation package are reverse engineered to the tagged value of the Ada Generic Parameters tag definition, which is applied to the Package or Class by the «Ada Generic Instance» stereotype.
If the associated generic package is being reverse engineered, the reverse engineered Package or Class references its parent generic Package, Class or Data Type through the tagged value of the Ada Generic Parent tag definition, which is applied to the Package or Class by the «Ada Generic Instance» stereotype.
If the associated generic package is not being reverse engineered, the name of the generic package is reverse engineered to the tagged value of the Ada Generic Parent Text tag definition, which is applied to the Package or Class by the «Ada Generic Instance» stereotype.