HP 3000 Manuals

XREF Directive [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

XREF Directive 

The XREF directive produces a cross reference listing of a program unit.
It is equivalent to the CROSSREF directive.

Syntax 

$XREF [ON ]
      [OFF]

Default               Off; no cross reference listing is produced.

Location              The XREF directive must appear before any
                      nondirective statements in the program unit and it
                      must precede an executable program unit like
                      PROGRAM, FUNCTION, or SUBROUTINE.

Toggling/ Duration    Cannot be toggled after the appearance of
                      nondirective statements in the program unit.

Example 

The following is a sample program using the XREF directive.

      1        $XREF
      2              INTEGER FUNCTION icp(op)
      3              COMMON /chars/ iblnk,ibkslsh,iequal,irparen,ilparen
      4             1 icomma,iperiod,iplus,iminus,isemi,idollar,ileta,iletz
      5        C     ...
      6        C     ... returns incoming priority of op
      7              INTEGER op
      8              INTEGER legal(34)
      9              data legal /2h( ,2h+ ,2h- ,2h* ,2h/ ,2h^ ,2h-1,2h-2,
     10             1            2h-3,2h-4,2h-5,2h-6,2h-7,2h-8,2h-9,2h10,
     11             2            2h11,2h12,2h13,2h14,2h15,2h16,2h17,2h18,
     12             3            2h19,2h20,2h21,2h22,2h23,2h24,2h25,2h26,
     13             4            2h27,2h) /
     14              icp=-1
     15              DO 20 i=1,34
     16              IF (op .EQ. legal(i)) GO TO 30
     17           20 CONTINUE
     18        C     ...
     19        C     ... illegal op to icp
     20              CALL eror(7)
     21              RETURN
     22        C     ...
     23           30 GO TO (80,40,40,50,50,60,70,70,70,70,70,70,70,70,70,
     24             1       70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,
     25             2       70,70,70,80),i
     26           40 icp=1
     27              RETURN
     28           50 icp=2
     29              RETURN
     30           60 icp=4
     31              RETURN
     32           70 icp=5
     33              RETURN
     34           80 icp=100
     35              RETURN
     36              END

The following is the cross reference listing for the above program.  The
default line width is 80 columns.  It can be changed with the PAGEWIDTH
directive.

     SYMBOL    TYPE    FILE   LINE
     ------    ----    ----   ----
     CHARS/    (COMMN) xref.f $3
     EROR      (PROC ) xref.f #20
     I         (VAR  ) xref.f !15   16   25
     IBKSLSH   (VAR  ) xref.f %3
     IBLNK     (VAR  ) xref.f %3
     ICOMMA    (VAR  ) xref.f %4
     ICP       (PROC ) xref.f *2   !14  !26  !28  !30  !32  !34
     IDOLLAR   (VAR  ) xref.f %4
     IEQUAL    (VAR  ) xref.f %3
     ILETA     (VAR  ) xref.f %4
     ILETZ     (VAR  ) xref.f %4
     ILPAREN   (VAR  ) xref.f %3
     IMINUS    (VAR  ) xref.f %4
     IPERIOD   (VAR  ) xref.f %4
     IPLUS     (VAR  ) xref.f %4
     IRPAREN   (VAR  ) xref.f %3
     ISEMI     (VAR  ) xref.f %4
     LEGAL     (VAR  ) xref.f *8   @9    16
     OP        (ARGMT) xref.f %2   *7    16

        NUMBER OF ERRORS =     0   NUMBER OF WARNINGS =    0

---------------------------------------------------------------------------------------------
|                   |                                                                       |
| SYMBOL            | The symbol name.                                                      |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| TYPE              | The class of the symbol:                                              |
|                   |    *   ARGMT - argument passed to a procedure or function.            |
|                   |    *   COMMN - name of a common block.                                |
|                   |    *   CONST - named constant in a PARAMETER statement.               |
|                   |    *   NMLST - NAMELIST variable.                                     |
|                   |    *   PROC - internal or external procedure or function name.        |
|                   |    *   VAR - variables.                                               |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| FILE              | The file where the symbol is found.                                   |
|                   |                                                                       |
---------------------------------------------------------------------------------------------
|                   |                                                                       |
| LINE              | One or more rows of line numbers that indicate where the symbol is    |
|                   | found.  Each line has a suffix that indicates the status of the       |
|                   | symbol at time of access.                                             |
|                   |    *   blank - symbol is being referenced.                            |
|                   |    *   !  - symbol is being modified.                                 |
|                   |    *   * - symbol is being defined and declared.                      |
|                   |    *   % - symbol is being declared.                                  |
|                   |    *   ^ - symbol is being declared, defined, and modified.           |
|                   |    *   # - symbol is being called.                                    |
|                   |    *   $ - symbol is declared, defined and used.                      |
|                   |    *   @ - symbol is declared and modified.                           |
|                   |                                                                       |
---------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation