3.3.5.3 Krunching Method

The initial file name is determined by the name of the unit that the file contains. The name is formed by taking the full expanded name of the unit and replacing the separating dots with hyphens and using lowercase for all letters, except that a hyphen in the second character position is replaced by a tilde if the first character is a, i, g, or s. The extension is .ads for a spec and .adb for a body. Krunching does not affect the extension, but the file name is shortened to the specified length by following these rules:

Of course, no file shortening algorithm can guarantee uniqueness over all possible unit names. If file name krunching is used, it’is your responsibility to ensure that no name clashes occur. The utility program gnatkr is supplied so that you can conveniently determine the krunched name of a file.