Table of Contents

Previous: -reference


Option: resources

-resources
Prints the amount of resources used by ftnchek in processing the program. This listing may be useful in analyzing the size and complexity of a program. It can also help in choosing larger sizes for ftnchek's internal tables if they are too small to analyze a particular program. Default = no.

In this listing, the term ``chunk size'' is the size of the blocks of memory allocated to store the item in question, in units of the size of one item, not necessarily in bytes. When the initially allocated space is filled up, more memory is allocated in chunks of this size. The following is an explanation of the items printed:

Source lines processed:
Total number of lines of code, with separate totals for statement lines and comment lines. Comment lines include lines with 'C' or '*' in column 1 as well as blank lines and lines containing only an inline comment. Statement lines are all other lines, including lines that have an inline comment following some code. Continuation lines are counted as separate lines. Lines in include files are counted each time the file is included.
Total executable statements:
Number of statements in the program, other than specification, data, statement-function, FORMAT, ENTRY, and END statements.
Total number of modules:
A module is any external subprogram, including the main program, subroutines, functions, and block data units. This count is of modules defined within the source, not modules referenced. Statement functions are not included. A subprogram with multiple entry points is only counted once.
Total statement labels defined
Number of labels attached to statements (often called statement numbers). The total label count for the entire program is given, as well as the maximum number in any single subprogram.
Max identifier name chars:
Number of characters used for storing identifier names. An identifier is a variable, subprogram, or common block name. Local names are those of local variables in a subprogram, whereas global names refer to subprogram and common block names, as well as dummy argument names and common variable names. Actual argument text (up to 15 characters for each argument) is also included here. The space used for local names is not recovered at the end of each module, so this number, like global space, grows until the whole program is analyzed. Unfortunately, this figure may include some text stored more than once, although a heuristic is used that will avoid duplicates in many cases.
Max token text chars:
A token is the smallest syntactic unit of the FORTRAN language above the level of individual characters. For instance a token can be a variable name, a numerical constant, a quoted text string, or a punctuation character. Token text is stored while a module is being processed. For technical reasons, single-character tokens are not included in this total. Items that are not represented in the symbol table may be duplicated. The space for token text is recovered at the end of each module, so this figure represents the maximum for any one module.
Max local symbols:
This is the largest number of entries in the local symbol table for any module. Local symbol table entries include all variables and parameters, common block names, statement functions, external subprograms and intrinsic functions referenced by the module. Literal constants are not stored in the local symbol table.
Max global symbols:
This is the number of entries in the global symbol table at the end of processing. Global symbol table entries include external subprogram and common block names. Intrinsic functions and statement functions are not included.
Max number of tokenlists:
A token list is a sequence of tokens representing the actual or dummy argument list of a subprogram, or the list of variables in a common block or namelist. Therefore this number represents the largest sum of COMMON, CALL, NAMELIST and ENTRY statements and function invocations for any one module. The space is recovered at the end of each module.
Max token list/tree space:
This is the largest number of tokens in all the token lists and token trees of any one module. A token tree is formed when analyzing an expression: each operand is a leaf of the tree, and the operators are the nodes. Therefore this number is a measure of the maximum complexity of an individual module. For instance a module with many long arithmetic expressions will have a high number. Note that unlike token text described above, the number of tokens is independent of the length of the variable names or literal constants in the expressions.
Number of subprogram invocations:
This is the sum over all modules of the number of CALL statements and function invocations (except intrinsic functions and statement functions).
Number of common block decls:
This is the sum over all modules of the number of common block declarations. That is, each declaration of a block in a different module is counted separately. (The standard allows multiple declarations of a block within the same module; these are counted as only one declaration since they are equivalent to a single long declaration.)
Number of array dim & param ptrs:
This is the sum over all modules of the number of array dimension and parameter definition text strings saved for use by the -makedcls option. The length of the text strings is not counted. Each dimension of a multidimensional array is counted separately.

These numbers are obviously not the same when project files are used in place of the original source code. Even the numbers for global entities may be different, since some redundant information is eliminated in project files.


Next: -sixchar