HP 3000 Manuals

XREF [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

XREF 

XREF is an HP Pascal Option.

When the XREF compiler option is ON (and the LIST option is also ON), the
listing includes a cross reference for each function, procedure, and
outer block.

Syntax 

$XREF {ON }$
      {OFF}

Default       OFF.

Location      Anywhere.

A cross reference lists each identifier that is accessible to the block.
For each file that references the identifier, the cross reference shows
the file name and gives the numbers of the lines on which the identifier
is referenced.  The symbol @ after a line number means that the
identifier is declared on that line.  The symbol * after a line number
means that the value of the identifier is (or could be) changed on that
line.

The line numbers are assigned by the editor (if the source file is
numbered) or by the compiler (if the source file is unnumbered.)  Lines
from included files (see the INCLUDE option) are numbered independently
(see the second example for the LIST option).

Although the XREF option is legal anywhere in the source code, it affects
only the code that follows it.  Therefore, its most practical location is
the beginning of the source code.

Example 

     0    1.000   0   $XREF ON$
     0    2.000   0   $TITLE 'Show_xref'$
     0    3.000   0   PROGRAM show_xref (input,output);
     0    4.000   0   $INCLUDE 'const'$
     0    1.000   0   CONST
     0    2.000   0      k = 100;
     1    5.000   0   VAR
     1    6.000   0      n : integer;
     2    7.000   0      t : Boolean;
     0    8.000   0   PROCEDURE check (VAR b : Boolean);
     2    9.000   1   BEGIN
     2   10.000   1      IF n > k THEN b := true
     4   11.000   1      ELSE  b := false;
     5   12.000   1   END;

                             C R O S S   R E F E R E N C E
                             ---------   -----------------

           Page   Line #   Page   Line #   Page   Line #   Page   Line #
     B
         PXA32.EXAMPLES.ATFTEST

              1 00008.000@    1 00010.000*    1 00011.000*
     BOOLEAN              global scope
         PXA32.EXAMPLES.ATFTEST

              1 00008.000
     CHECK                global scope
         PXA32.EXAMPLES.ATFTEST

              1 00008.000
     FALSE                global scope
         PXA32.EXAMPLES.ATFTEST

              1 00011.000
     K                    global scope
         PXA32.EXAMPLE.ATFTEST

              1 00010.000
     N                    global scope
         PXA32.EXAMPLES.ATFTEST

              1 00010.000
     TRUE                 global scope
         PXA32.EXAMPLES.ATFTEST

              1 00010.000

     3   13.000   1   BEGIN
     3   14.000   1      readln(n);
     4   15.000   1      check(t);
     5   16.000   1      IF t THEN writeln ('Too big!')
     7   17.000   1      ELSE writeln ('No Problem');
     8   18.000   1   END.

     PAGE   2  Show_xref

                             C R O S S   R E F E R E N C E
                             ---------   -----------------

           Page   Line #   Page   Line #   Page   Line #   Page   Line #
     BOOLEAN
        PXA32.EXAMPLES.ATFTEST

              1 00007.000     1 0008.000
     CHECK
        PXA32.EXAMPLES.ATFTEST

              1 00008.000     1 0015.000
     FALSE
        PXA32.EXAMPLES.ATFTEST

              1 00011.000
     INPUT
        PXA32.EXAMPLES.ATFTEST

              1 00003.000
     INTEGER
        PXA32.EXAMPLES.ATFTEST

              1 00006.000
     K
        PXA32.EXAMPLES.ATFTEST

              1 00010.000
        const

              1 00002.000
     N
        PXA32.EXAMPLES.ATFTEST

              1 00006.000@    1 00010.000    1 00014.000*

     OUTPUT
        PXA32.EXAMPLES.ATFTEST

              1 00003.000
     READLN
        PXA32.EXAMPLES.ATFTEST

              1 00014.000
     SHOW_XREF
        PXA32.EXAMPLES.ATFTEST

              1 00003.000
     T
        PXA32.EXAMPLES.ATFTEST

              1 00007.000     1 00015.000*    1 00016.000

     PAGE   3  Show_xref

                             C R O S S   R E F E R E N C E
                             ---------   -----------------

           Page   Line #   Page   Line #   Page   Line #   Page   Line #
     TRUE
        PXA32.EXAMPLES.ATFTEST

              1 00010.000
     WRITELN
        PXA32.EXAMPLES.ATFTEST

              1 00016.000     1 0017.000



MPE/iX 5.0 Documentation