![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Ada Compilation
OverviewNote: Ada Compilation is only available with Apex Ada and Apex Duo. For more information about these products, contact your Rational sales representative.
This chapter presents basic information about Ada compilation.
Ada compilation commands allow program units to be parsed, analyzed, compiled, and linked in the compilation context of a view. The compiler used, the values of compiler switches, and the imported views that provide external visibility are all established by the view context.
Typically, each compilation command produces permanent information that will be used by succeeding commands. For example, the analyze command provides semantic information about the meaning of the units used later to generate code.
Ada Compilation States
At any point, each program unit has a compilation state, which designates the current status of the unit with respect to compilation. Each of the compilation commands performs the processing necessary to advance a unit to a particular state.
- Archived
The unit has no compiler-related information. Either the unit has never been processed by the compiler or all compilation information has been removed.
- Unparsed
The unit's source file has been updated since the compiler was last run.
- Source
The unit has been parsed. The parse command advances the unit to this state.
- Installed
The unit has been checked for semantic consistency. The analyze command advances the unit to this state.
- Coded
Object code has been generated for the unit. The compile command advances the unit to this state.
- Linked
An executable has been generated based on this unit. The link command advances the unit to this state.
Other commands also use compilation states to specify compiler processing that occurs as a side effect of a major operation. For example, the copy_view command has a -goal option that allows one to specify the level of compilation that will occur after the new views have been created.
Closure Sets
In general, a program unit can only be processed to a particular compilation state, if a set of other units have also been processed to that state. For example, an Ada unit can only be analyzed (that is, processed to the installed state) if all of its with'ed units have also been analyzed. Therefore, a unit and a compilation state are sufficient to define a set of other units, known as the compilation state closure set. The possible closure sets are defined as follows:
- Analyze Closure
Includes all the units necessary to perform semantic analysis on the given unit. For Ada units, the analyze closure includes all the units visible to the given unit through with, spec/body, or parent/subunit relationships.
- Code Closure
Includes all the units necessary to generate code for the given unit. For Ada units, the code closure includes the analyze closure and any bodies that must be processed due to macro-expansion of generics or inlining.
- Link Closure
Includes all the units necessary to link an executable. For Ada units, the link closure includes all specs and bodies accessible through with and subunit relationships.
You can find the units in a closure set in views associated with the imports or in the views named in the configuration specified by the -configuration option. note that when using configuration files during compilation (analyze and/or code), all units referenced by the configuration are compiled in addition to all the units in the import closure. When linking, the units referenced in the import closure are replaced by those referenced in the configuration file.
Rational Software Corporation http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2004, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |