Next: , Previous: The GNAT Pretty-Printer gnatpp, Up: Top


15 The GNAT Metric Tool gnatmetric

The gnatmetric tool is an ASIS-based utility for computing various program metrics. It takes an Ada source file as input and generates a file containing the metrics data as output. Various switches control which metrics are computed and output.

gnatmetric generates and uses the ASIS tree for the input source and thus requires the input to be syntactically and semantically legal. If this condition is not met, gnatmetric will generate an error message; no metric information for this file will be computed and reported.

If the compilation unit contained in the input source depends semantically upon units in files located outside the current directory, you have to provide the source search path when invoking gnatmetric. If it depends semantically upon units that are contained in files with names that do not follow the GNAT file naming rules, you have to provide the configuration file describing the corresponding naming scheme (see the description of the gnatmetric switches below.) Alternatively, you may use a project file and invoke gnatmetric through the gnat driver (see The GNAT Driver and Project Files).

The gnatmetric command has the form

     
     
     $ gnatmetric [switches] {filename} [-cargs gcc_switches]

where