14.1.2 Casing Control
gnatpp allows you to specify the casing for reserved words,
pragma names, attribute designators and identifiers.
For identifiers you may define a
general rule for name casing but also override this rule
via a set of dictionary files.
Three types of casing are supported: lower case, upper case, and mixed case.
Lower and upper case are self-explanatory (but since some letters in
Latin1 and other GNAT-supported character sets
exist only in lower-case form, an upper case conversion will have no
effect on them.)
“Mixed case” means that the first letter, and also each letter immediately
following an underscore, are converted to their uppercase forms;
all the other letters are converted to their lowercase forms.
- -aL
- Attribute designators are lower case
- -aU
- Attribute designators are upper case
- -aM
- Attribute designators are mixed case (this is the default)
- -kL
- Keywords (technically, these are known in Ada as reserved words) are
lower case (this is the default)
- -kU
- Keywords are upper case
- -nD
- Name casing for defining occurrences are as they appear in the source file
(this is the default)
- -nU
- Names are in upper case
- -nL
- Names are in lower case
- -nM
- Names are in mixed case
- -neD
- Enumeration literal casing for defining occurrences are as they appear in the
source file. Overrides -n casing setting.
- -neU
- Enumeration literals are in upper case. Overrides -n casing
setting.
- -neL
- Enumeration literals are in lower case. Overrides -n casing
setting.
- -neM
- Enumeration literals are in mixed case. Overrides -n casing
setting.
- -neD
- Names introduced by type and subtype declarations are always
cased as they appear in the declaration in the source file.
Overrides -n casing setting.
- -ntU
- Names introduced by type and subtype declarations are always in
upper case. Overrides -n casing setting.
- -ntL
- Names introduced by type and subtype declarations are always in
lower case. Overrides -n casing setting.
- -ntM
- Names introduced by type and subtype declarations are always in
mixed case. Overrides -n casing setting.
- -pL
- Pragma names are lower case
- -pU
- Pragma names are upper case
- -pM
- Pragma names are mixed case (this is the default)
- -Dfile
- Use file as a dictionary file that defines
the casing for a set of specified names,
thereby overriding the effect on these names by
any explicit or implicit
-n switch.
To supply more than one dictionary file,
use several -D switches.
gnatpp implicitly uses a default dictionary file
to define the casing for the Ada predefined names and
the names declared in the GNAT libraries.
- -D-
- Do not use the default dictionary file;
instead, use the casing
defined by a -n switch and any explicit
dictionary file(s)
The structure of a dictionary file, and details on the conventions
used in the default dictionary file, are defined in Name Casing.
The -D- and
-Dfile switches are mutually
compatible.