TOC PREV NEXT INDEX DOC LIST MASTER INDEX



Locate_Loop_Nesting

This command locates loops in programs that:

Note: This is computed across subprogram calls; that is, if a subprogram call appears inside a loop, the subprogram's looping characteristics are added to the local statistics. Only the worst-case looping is reported for each subprogram.

Usage Tip: Areas where loops are highly nested or the repetition count is high are obvious areas for optimization of those statements inside the loops.

Command-Line Interface

Locate_Loop_Nesting
  -Repetition_Threshold [integer-expression, default = 1000]
  -Minimum_Nesting_Level [integer-expression, default = 3]
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/loop_nesting_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Locate_Misspellings

This command locates all misspellings in the following constructs:

The public domain GNU ispell program has been integrated into the Ada Analyzer to check spelling. The default dictionary is located in

$AA_HOME/lib/ispell/ispell.dict.

If an ispell dictionary is already in use on your network or machine, you can specify that this dictionary be used by modifying the environment variable $ISPELL_DICTIONARY to the pathname of this dictionary. Users can expand the base dictionary with private words by creating a file called ispell.words in their home directory and adding words one to a line.

The file named allowed_name_abbreviations located in the standards_conformance subdirectory of the current configuration policy can also be updated to add acceptable words. These can be abbreviated forms that are used in the program but otherwise not in the dictionary.

It is also possible to report words that are spelled correctly but are considered prohibited for use by the project for some reason. The file named prohibited_names located in the standards_conformance subdirectory of the current configuration policy contains this list. A Boolean parameter is available to enable reporting of prohibited words.

Usage Tip: Misspellings are obviously not programming errors, but they detract from high-quality code. Prohibiting certain words can ensure that project-specific references do not appear in units that are designated for reuse.

Command-Line Interface

Locate_Misspellings
  -Include_Comment_Checking
  -Include_Declaration_Checking
  -Include_String_Literal_Checking
  -Include_Prohibited_Words
  -Check_Words_Containing_Numbers
  -Check_Words_Over_N_Characters [integer-expression, default = 1]
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/misspelling_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Misspellings in Comments

Misspellings in Declarations

Misspellings in String Literals

Use of Prohibited Words

Locate_Name_Anomalies

This command checks all name declarations against the following criteria:

The user may set threshold or Boolean enable/disable parameters for each criterion. If a particular output is not desired, setting the threshold to an unreasonably high or low value will ensure no output for that item.

A description of the program that checks spelling and the associated dictionaries is located in the description of the Locate_Misspellings command on page 172.

Usage Tip: This command can be used to locate violations of project naming conventions.

Command-Line Interface

Locate_Name_Anomalies
  -Minimum_Length [integer-expression, default = 3]
  -Maximum_Length [integer-expression, default = 50]
  -Maximum_Segment_Count [integer-expression, default = 4]
  -Check_Spelling
  -Check_Prohibited_Words
  -Check_Words_Containing_Numbers
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/naming_anomaly_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Names That Are Too Short

Names That Are Too Long

Names with Too Many Segments

Misspelled Names

Use of Prohibited Names

Locate_Named_Declarations

This command locates all named declarations and sorts them by kind.

Usage Tip: This command can be used to check project naming conventions or to generate a dictionary of all names and their locations. It can also be used to find all declarations of a particular kind.

Command-Line Interface

Locate_Named_Declarations
  -Include_Constants
  -Include_Variables
  -Include_Types
  -Include_Packages
  -Include_Procedures
  -Include_Functions
  -Include_Renames
  -Include_Generics
  -Include_Instantiations
  -Include_Tasks
  -Include_Entries
  -Include_Exceptions
  -Include_Parameters
  -Include_Generic_Parameters
  -Include_Record_Components
  -Include_Discriminants
  -Include_Enumeration_Literals
  -Include_Loop_Identifiers
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/naming_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Note: Hypertables containing other declaration names are identical in content and format.

Locate_Objects_By_Size

This command locates all object declarations and computes their type, scope, and size as it would be on the target machine. The file type_sizing_file in the current configuration policy contains sizing parameters that may need modification to match a specific target. The file type_sizing_name_map in the current configuration policy can be used to specify the exact size of a qualified type name. See page 42 for more details on configuring these parameters.

Usage Tip: Objects that are extremely large often impact code size and execution time. Some targets even limit object size. Objects that are not statically sized can also be of interest.

Command-Line Interface

Locate_Objects_By_Size
  -Include_Constants
  -Include_Non_Statically_Sized_Objects
  -Display_In_Bytes
  -Display_In_Words
  -Size_Minimum [integer-expression, default = 0]
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/object_size_analysis]
  <list of units>

Nonstandard Parameters

Note: Only one of the Display_In_Bytes and Display_In_Words options should be enabled at any one time. If both are present, the last one in the options string takes precedence.

Sample Output

Key:

 Size:  Units depend on parameter selection.

 ObjContext: There are three parts to the context:

  Var = variable; Cst = constant

  Gen = generic; Blank = nongeneric

  Pkg = package; Proc = procedure; Func = function; Task = task

Locate_Objects_Set_And_Used

This command locates all parameter and variable declarations and collects all sets (writes) and uses (reads) of those objects.

Usage Tip: The number and location of all sets and uses of an object can be important to understanding the flow of data in the system and its synchronization requirements. Obviously, if an object has either no sets or no uses it should be investigated further.

Command-Line Interface

Locate_Objects_Set_And_Used
  -Expand
  -From_References
  -Separate_Record_Component_References
  -Include_Initialization
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/object_set_used_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Expanded Output

The appearance of P_Set, P_Use, and P_Both in the usage column means that a composite object has been partially set, partially used, or both. That is, one component of a record object has been referenced and not the entire object.

Locate_Obsolescent_Ada83_Features

This command will locate the use of all features specified in Annex J, "Obsolescent Features," of the Ada 95 language definition. The Ada 95 LRM defined several largely redundant features to maintain compatibility with Ada 83 programs. These features may be removed from the Ada language definition at some point and are not recommended in newly written Ada programs. The features located by this command are:

Command-Line Interface

Locate_Obsolescent_Ada83_Features
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/calling_relationships]
  <list of units>

Nonstandard Parameters

All parameters are standard parameters.

Sample Output

Library Unit Renamings

Reduced Accuracy Subtypes

Constrained Attributes

Reference to Package Ascii

Numeric_Error Exceptions

At Clauses

Interrupt Entries

Mod Clauses

Storage Size Attributes

Locate_Operators

This command locates all numeric and string operators. Certain operators are often very expensive in terms of execution time; location of these operators can be important to optimization efforts.

The output is sorted to help locate redundant expressions. The default sorts only the left operand of the expression. The output can be resorted to sort on the right operand.

Usage Tip: The use of some operators (concatenate, for example) can be very expensive on some targets. Knowing where these operators are used can be important to optimization efforts. It is also true that when requirements are stated functionally, they often include redundant algorithmic requirements for clarity. These can lead to redundant expressions in disparate parts of the software. This command can aid in locating these redundancies.

Command-Line Interface

Locate_Operators
  -Include_Concatenate_Operators
  -Include_Plus_Operators
  -Include_Minus_Operators
  -Include_Times_Operators
  -Include_Divide_Operators
  -Include_Unary_Minus_Operators
  -Include_Unary_Plus_Operators
  -Include_Modulo_Operators
  -Include_Remainder_Operators
  -Include_Power_Operators
  -Include_Absolute_Value_Operators
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/operator_selection_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Note: Hypertables for all other operators contain output identical in content and format except unary operators which, of course, have only one operand.

Locate_Others_Clauses

This command locates all uses of Ada others clauses, including:

Command-Line Interface

Locate_Others_Clauses
  -Include_Case_When_Others
  -Include_Handler_When_Others
  -Include_Aggregate_Others
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/others_clause_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Case Statement When Others

Exception Handler When Others

Aggregate Others Choice

Locate_Packages_With_State

This command locates packages that have state (that is, static variable declarations that would have to be protected from multiple access in a multitasking system).

Usage Tip: It is useful to know when a package offers a "pure" abstraction that will always behave the same way or whether some state is updated as a side effect of calling package subprograms. In multitasking, it is typically necessary to synchronize such data.

Command-Line Interface

Locate_Packages_With_State
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/packages_with_state_analysis]
  <list of units>

Nonstandard Parameters

All parameters are standard parameters.

Sample Output

Locate_Potential_Programming_Errors

This command locates several coding constructs that have a high potential for error. These constructs include:

Command-Line Interface

Locate_Potential_Programming_Errors
  -Include_Calls_With_Defaults
  -Include_Divide_By_Zero_Potential
  -Include_Real_Relational_Operators
  -Include_Static_Loop_Ranges
  -Include_Static_Slice_Ranges
  -Include_Operator_Renames
  -Include_Handlers_Of_Numeric_Error
  -Include_Function_Exception_Handlers
  -Include_Blocking_Protected_Operations
  -Include_Infinite_Recursion
  -Sort_By_Subsystem
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/misc_programming_error_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

Calls with Defaults

Divide-by-Zero Potential

Real Relational Operators

Static Loop Ranges

Static Slice Ranges

Operator Renames

Handlers for Numeric_Error without Constraint_Error

Protected Operations with Blocking Operations

Function Handlers without Raise or Return Statements

Infinite Recursion


Rational Software Corporation  http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2000, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX DOC LIST MASTER INDEX