Ada Unit Maker - attolchop

Purpose

The Instrumentor generates several compilation units in the same file. Some compilers require a separate file for each compilation unit.

To achieve this, the Ada Unit Maker feature generates one file for each compilation unit found in a specified Ada source file as the gnatchop command, provided with the GNAT Ada compiler, does. You can choose the name of the generated files from several naming conventions.

Syntax

attolchop [<options>] <source file name> [..<source file name>] [<directory>]

where:

  • <source file name> is the source file name to analyze. If this file cannot be read or contains lexical or syntax errors, a fatal error is generated.

  • <options> is a set of optional command line parameters as specified in the following section.

  • <directory> is the optional output directory.

Description

The Ada Unit Maker feature can generate file names for Rational Apex or Gnat naming standards. To choose the naming standard, either set the ATTOLCHOP environment variable to GNAT or APEX or use the -n command line parameter. By default, the Ada Unit Maker uses the Gnat naming convention.

Gnat Naming

The full compilation unit name is set to lower case and all dot characters (".") are replaced with hyphens ("-"). The feature appends the .ads extension to the name if the unit is an extension or the .adb extension if the unit is a body. The Krunch Gnat short name mode is not supported by the Ada Unit Maker. Please refer to your Gnat documentation for further information.

Rational Apex Naming

The full compilation unit name is set to lower case; then the feature appends a .1.ada extension to the filename if the unit is a specification, or a .2.ada extension if the unit is a body. Please refer to your Apex documentation for further information.

Options

Options can be in any order. They may be upper or lowercase and can be abbreviated to their shortest unambiguous number of characters.

-l

This option must be placed first if it is used. This tells the Ada Unit Maker feature to send the name of the generated file, and no other messages, to the standard output.

-w

Overwrite. By default, the Ada Unit Maker produces an error if a filename already exists. Use the -w option to overwrite any existing files.

-v

This option returns the version number of the product.

-n APEX|GNAT

Naming standard. Use the -n option to select either the Rational Apex or Gnat naming convention. This parameter overrides the default setting (Gnat) as well as the ATTOLCHOP environment variable if set.

Return Codes

After execution, the program exits with the following return codes:

Code Description
0 End of execution with no errors
3 End of execution with one or more warning messages
5 End of execution with one or more errors
7 End of execution because of a fatal error
9 End of execution because of an internal error

All messages are sent to the standard error output device.