NAGWare Fortran Tools - f95 Tools - nag_polopt95

 

Index

NAME
DESCRIPTION
BASIC LAYOUT MENU
COMMENT FORMATTING MENU
STYLE MENU
BLANK LINE INSERTION MENU
RELABELLING OPTIONS MENU
SEE ALSO

 

NAME

nag_polopt95 - Polish options editor.

 

DESCRIPTION

nag_polopt95 is the NAGWare f95 Tools polish options file editor.

One of the NAGWare f95 Tools is a pretty printer, nag_polish95, which can be used specifically to reformat Fortran programs. Other tools also make use of the polish routines to recreate Fortran source code from the internal representation used by these tools. Hence the appearance of the output of all the transformation tools, including nag_polish95 itself, can be controlled by the polish options file. nag_polopt95 is one of the recommended way of creating and editing this polish options file. It is a menu driven editor.

The graphical user interface version of this editor nag_po95, which is also incorporated in nag_tools, provides an easier to use interface to this tool.

 

BASIC LAYOUT MENU

Indent step
The number of extra spaces added to indent the body of a construct like DO, CASE, IF ... THEN, ELSE etc. (see also indent continuation) [Default: 2]
Left Margin
The initial number of spaces added in front of statements, before any indent. If you use statement labels then a value of at least four makes the program easier to read; traditionalists may wish to choose 6. [Default: 4]
Right Margin
Free format Fortran allows lines of up to 132 columns. Many editors, terminals and printers use 80 columns so this is the default. [Default: 80 (78 in the GUI)]
Maximum Indentation
This sets a limit on how far the polisher is allowed to push deeply nested loops. A value about two thirds of the way between the left and right margins is suitable. Values very close to the Right Margin figure may make the output program untidy. [Default: 60]
Labels before Indent
Statement labels may be output before or after the required indentation. The default is to have the label against the left margin. [Default: On]
Indent continuation
The number of spaces that continuation lines are indented relative to the previous statement. This may be negative. [Default: 2]

 

COMMENT FORMATTING MENU

This menu is accessed from the basic layout menu,

Do not alter comments
When ``On'' comments are not changed in any way except that any comments beginning with ``C'' or ``*'' are changed to begin with ``!''. If this option is ``On'' the other options in this section are disabled. This option may be used where the layout of comments must be preserved, e.g. tables. [Default: On]
Indent comments
Comments can be indented to the surrounding program text (On) or lined up with the Left Margin (Off). In-line comments will be indented after the ``In-line comment margin'' (On) or placed immediately after the statement text (Off). [Default: On]
Indent comment marker
If ``Indent comments in line with text'' is ``On'', the comment marker may be placed at the beginning of the line and the comment body lined up with the program text (Off), or the comment marker may be lined up with the program text (On). This option has no effect if ``Indent comments in line with text'' is ``Off''. [Default: On]
In-line comments margin
Fortran allows comments to be placed on the same line as executable statements. If this option is non-zero, comments after short lines are moved over to line up with each other giving a smarter appearance to the program. This option only has effect when ``Indent comment'' is On. [Default: 35]
Break long comment word
When a comment extends beyond the Right margin it is wrapped, breaking the comment between words. When a comment contains a word too big to fit (eg, if the In-line comments margin is too far to the right) then the word can either be broken (On) or allowed to extend past the right margin (Off). [Default: Off]
Delete existing comments and blank lines
Removes all existing comments and blank lines from the file. The option to insert a blank line after declarations is unaffected by this option. [Default: Off]
Delete existing blank lines
Deletes all existing blank lines from the file. The option to insert a blank line after declarations is unaffected by this option. [Default: Off]

 

STYLE MENU

Keyword, Identifier, Intrinsics and Construct Label case
There are three kinds of case available from the polisher. These are:

1. Upper All letters in upper case.

2. Lower All letters in lower case.

3. Capitalised The first letter is upper case, the rest of the word (if any) in lower case.

Case changing for tokens (language elements) is broken down into four categories:

1. Keyword case The basic symbols of the Fortran language, e.g. DO, PROGRAM, REAL etc. [Default: Upper]

2. Identifier case All user-defined variables, function names, etc. [Default: Lower]

3. Intrinsics case An intrinsic procedure name. The polisher cannot always distinguish the use of an intrinsic procedure name for another purpose. This option has a fourth alternative option ``AsIdentfs'' which means as identifiers. [Default: AsIdentfs]

4. Construct Label case The case of construct labels. [Default: Upper]

Add names to ENDs
Where END statements are unnamed, this option will insert the optional PROGRAM, BLOCK DATA, FUNCTION, SUBROUTINE or MODULE followed by the name, where appropriate, eg END might become END PROGRAM TEST. Alternatively any such existing keywords and names may be deleted. Non-optional FUNCTION or SUBROUTINE keywords will not be removed from internal or module procedure END statements. The options are Asis, Remove or Insert. [Default: Asis]

Formats flushed to end
Moves format statements to the end of the program unit. [Default: Off]

KIND= in type declarations
In declarations of types, the kind number may be specified with or without the text KIND= before it. This option allows this statement to be inserted or removed (for all types except CHARACTER). The options are Remove or Insert. [Default: Remove]

Old style relational operators
By default the new style of relational operator ( ==, >, <, /=, <=, >= ) are used. This option causes the polisher to use the old style, e.g. ( .EQ., .GT., .LT., .NE., .LE., .GE. ). [Default: Off]

Blank line after declarations
A blank line may be inserted after the declarations and before the executable statements if there are no comments present at that position. [Default: On]

Convert do loop terminators to unique END DO statements
Converts labelled do loops, e.g. ``DO 10 i=1,5'' to DO - END DO constructs. If multiple DO loops end on a single shared statement (e.g. ``10 CONTINUE'') the appropriate number of END DO statements will be added. [Default: Off]

Delete unused labels
Deletes labels which are never referenced. This option does not apply to FORMAT statement labels. If a CONTINUE statement has an unused label the whole statement will be deleted. [Default: Off]

Change blank comment lines to blank lines
Converts blank comment lines (i.e. a `!', `C' or `*' with no accompanying comment text) to blank lines. [Default: On]

Add names/operators to END INTERFACE
Add the generic name or operator to the END INTERFACE statement. [Default: On]

Add names to END TYPE
Add the user defined type name to the END TYPE statement. [Default: Off]

 

BLANK LINE INSERTION MENU

In addition to the single option ``blank line after declarations'' offered by the style menu, the tool also allows you to insert blank comment lines before and/or after certain classes of statement if there is no comment already there. By default none of these options is on. The menu to alter these is accessed from the style menu.

This menu consists of a table of the keywords identifying statement types, which may have blank comments added before or after. Entering the appropriate number toggles blank line insertion on or off.

 

RELABELLING OPTIONS MENU

Relabel statements
Statement relabelling may be switched on or off. [Default: Off]
1st statement label
The first label used in each program unit for statements. [Default: 10]
Label step
The step between successive labels. [Default: 10]
Relabel FORMAT differently
If ``Off'' FORMAT statements are labelled in the same run as the other statements, or if ``On'' FORMATs are labelled in a separate number sequence. Do not specify overlapping sequences. [Default: On]
1st FORMAT label
The first FORMAT statement label if they are to be numbered separately from the executable statements. [Default: 90000]
FORMAT label step
The step between successive FORMAT labels. [Default: 10]

 

SEE ALSO

nag_polish95, nag_tools.

Copyright, Numerical Algorithms Group, Oxford, 1997-2001