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 > Exception mapping for reverse engineering Ada (Ada code)
  
Exception mapping for reverse engineering Ada (Ada code)
For each declared Ada exception, the Reverser creates an Exception in the Package or Class that is created for the owning Ada package. The name of the Exception is that of the reverse engineered exception.
If the Ada exception is declared in an Ada package (not in a subprogram), the exception handler code is reverse engineered with the Ada package body code, that is, it is reverse engineered to the Body property of the Operation that is created for the Package body code.
If the Ada exception is declared in a subprogram, the exception handler code is reverse engineered with the subprogram body code, that is, it is reverse engineered to the Body property of the Operation that is created for the subprogram.
The Visibility property of the reverse engineered Exception is set according to how the Ada exception is declared:
If the Ada exception is declared in the Ada package specification outside the private region, the Visibility property is set to Public.
If the Ada exception is declared in the Ada package specification within the private region, the Visibility property is set to Protected.
If the Ada exception is declared in the Ada package body, the Visibility property is set to Private.
For each renames declaration that renames an exception:
The Reverser creates an Exception for the renames declaration. The name of the new Exception is as specified by the renames declaration, and the Exception is created in the Package or Class created for the parent Ada package.
The new Exception is stereotyped by the «Ada Renames» stereotype:
If the Reverser can find the target Exception in the Model, the Exception 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 Exception 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 exception that is renamed by the renames declaration.