Basic INTERACTIVEXREF Constructs

The following items commonly appear as syntactic variables in the syntax diagrams in this section.

Identifier Specification

An identifier specification defines a particular identifier within a program. If the identifier is redeclared in many different procedures or blocks, you can also indicate the particular procedure or block by specifying an identifier qualification along with the identifier value.

<identifier specification>

──<identifier>─┬────────────────────────────┬──────────────────────────┤
               └─<identifier qualification>─┘

<identifier>

──┬─<letter>─┬──────────────────────────────┬──────────────────────────┤
  │          │ ┌◄─/61\────────┐             │
  │          └─┴─┬─<letter>─┬─┴─────────────┘
  │              ├─<digit>──┤               │
  │              └─ _ ──────┘               │
  │       ┌◄─/29\───────────────────┐       │
  └─<SDO>─┴─<double byte character>─┴─<EDO>─┘

<identifier qualification>

──┬─ AT FIRST ───────────────────────────────────────────────┬─────────┤
  ├─ AT ──<sequence number>──────────────────────────────────┤
  ├─ IN ──<procedure specification>──────────────────────────┤
  ├─ OF ──<procedure specification>──────────────────────────┤
  └─ AT ──<sequence number>── IN ──<procedure specification>─┘

<sequence number>

  ┌◄────────┐
──┴─<digit>─┴──────────────────────────────────────────────────────────┤

<procedure specification>

  ┌◄────────── OF ─────────┐
──┴─<procedure identifier>─┴───────────────────────────────────────────┤

Explanation

<identifier>

An alphanumeric identifier beginning with a letter that is composed entirely of any combination of letters (A through Z), digits (0 through 9), and underscores (_). In an ALGOL program, an identifier of the form B.0002 is also acceptable.

Alternatively, an identifier can be a double-byte identifier that consists of an SDO character, one or more double-byte characters, and an EDO character. SDO and EDO are control characters that signal the beginning and end of double-byte data. Any double-byte character, except for the Kanji space character ('A1A1'), can be contained in a double-byte identifier. In order to use this feature, you must use a terminal or workstation that has the ability to handle double-byte data.

<identifier qualification>

Qualifies the occurrence of the identifier that is intended in case the same identifier is redeclared in many different procedures or blocks.

AT FIRST

Selects the first occurrence of the identifier that the compiler encountered.

AT <sequence number>

Selects the occurrence of the identifier declared, or used closest to, the specified sequence number. If an exact match is not found, a warning message is given. The identifier qualification gives undefined results if the symbol file that was loaded is not sequenced properly.

IN <procedure specification>

Causes INTERACTIVEXREF to look for a use of the identifier in the specified procedure. INTERACTIVEXREF looks first for an identifier declared by the specified procedure. If the identifier is not declared by the specified procedure, an identifier declared in a procedure nested within the specified procedure is sought. If this search fails, a global identifier referenced by the procedure is sought. If all these searches fail, an error occurs.

OF <procedure specification>

Selects the occurrence of the identifier declared by the specified procedure. An occurrence of the identifier declared by a procedure contained within the specified procedure is not acceptable.

AT <sequence number> IN <procedure specification>

Selects the occurrence of the identifier declared or referenced closest to the specified sequence number within the specified procedure. This option is useful as an alternative to AT <sequence number> when the specified procedure, but not the entire source, is properly sequenced. Refer to “Use with Improperly Sequenced Source” in this section.

<procedure specification>

Specifies a particular procedure. The procedure specification need be only long enough so that its outermost environment—a module or a procedure---is the best candidate of all the possible environments specified by that identifier. The best candidate is defined as follows:

  • If only one environment exists and uses the procedure identifier name, it is used.

  • If more than one environment exists with this name, the most global environment is used.

  • If equally global environments exist with this name, the first environment is used.

If more than one environment exists for a specified name, a warning of possible ambiguity and the name of the chosen environment are displayed.

Examples

The following examples use the example INTERACTIVEXREF program contained at the end of this section.

The following REFERENCE command requests information on the identifier B at line 5600:

REF B AT 5600
  CLOSEST MATCH:  B @ 00005400
  B  ::  REAL @ (2,2)  ::  DECLARED @ 00001200
     00002600  *00005400  *00005800
  %

The following REFERENCE command requests information on the identifier B at line 5601:

REF B AT 5601
  CLOSEST MATCH:  B @ 00005800
  B  ::  REAL @ (2,2)  ::  DECLARED @ 00001200
     00002600  *00005400  *00005800
  %

The following REFERENCE command requests information on the identifier B at line 2600. Because this command does not specify a <procedure specification> value, the global REAL B is used by default. Therefore, the INTEGER B declared at 3300 is not located.

REF B AT 2600
  CLOSEST MATCH:  B @ 00002600
  B  ::  REAL @ (2,2)  ::  DECLARED @ 00001200
     00002600 *00005400  *00005800
  %

The following REFERENCE command requests information on the INTEGER type B in procedure TWO:

REF B IN TWO
  B OF TWO  ::  INTEGER @ (3,2)  ::  DECLARED @ 00003300
    *00004600
  %

The following REFERENCE command requests information on the identifier C in procedure TWO:

REF C IN TWO
  C OF THREE OF TWO :: INTEGER @ (4,2) :: DECLARED @ 00003700
    *00003800   00003900
  %

The following command causes an error because C is not declared by procedure TWO. OF <procedure specification> does not check nested procedures for an occurrence of the identifier.

REF C OF TWO
  ERROR: REFERENCES - IDENTIFIER NOT DECLARED BY SPECIFIED ENVIRONMENT.
         SCANNING C
  %

Either one of the following two REFERENCE commands would produce information on the identifier C in procedure THREE of TWO:

REF C OF THREE
REF C OF THREE OF TWO
  C OF THREE OF TWO :: INTEGER @ (4,2):: DECLARED @ 00003700
    *00003800   00003900
  %

Range Specification

A range specification is used to restrict a request to a certain subset of the source file. Ranges can be specified in terms of either sequence numbers or environments (procedure names). Sequence numbers and environments cannot be intermixed in the same range specification.

<range specification>

──┬─────┬─ * ────────────────────────────┬─────────────────────────────┤
  ├─ - ─┘                                │
  ├───────────┬─<subrange specification>─┘
  ├─────┬─ * ─┘
  └─ - ─┘

<subrange specification>

    ┌◄────────────────────────────────── , ──────────────────────────────────┐
──┬─┴─┬─────┬─<procedure specification>─┬──────────────────────────────────┬─┴─┬─┤
  │   ├─ - ─┘                           └─ THRU <procedure specification> ─┤   │
  │   ├─────┬─ ( ──<procedure specification>── ) ──────────────────────────┘   │
  │   └─ - ─┘                                                                  │
  │ ┌◄────────────────────── , ─────────────────────┐                          │
  └─┴─<sequence  number>─┬────────────────────────┬─┴──────────────────────────┘
                         ├─ - ──<sequence number>─┤
                         └─ - ── END ─────────────┘

Explanation

*

Specifies the current default reference range.

–*

Specifies the opposite of the current default reference range.

<subrange specification>

Specifies a procedure range or sequence range to be included.

<procedure specification>

Includes the specified procedure and all procedures nested within it.

–<procedure specification>

Includes all procedures except the one specified, and all procedures nested within this procedure.

<procedure specification> THRU <procedure specification>

Includes all procedures in order of declaration from the first specified procedure through the second specified procedure.

–<procedure specification> THRU <procedure specification>

Includes all procedures except the procedures in order of declaration from the first specified procedure through the second.

(<procedure specification>)

Includes the specified procedure, but not the procedures nested within it.

–(<procedure specification>)

Includes all procedures except the one specified. The procedures nested within that procedure are included.

Examples

The following examples use the example INTERACTIVEXREF program contained at the end of this section.

The following range specification includes all sequence numbers from 1850 through 2300 and 5000 through the end of the file:

1850-2300, 5000-END

The following range specification includes global procedure ONE and all procedures declared within it, and global procedure TWO, but not the procedure declared within it—that is, procedure THREE:

ONE, (TWO)

The following range specification includes the entire source file except the global procedure ONE and all the procedures declared within it:

-ONE

The following range specification specifies the opposite of the current default reference range:

-*

The following range specification includes the current default reference range as well as global procedure ONE and all the procedures declared within that procedure:

*, ONE

The following range specification includes the entire source file except for the global procedure TWO. The procedures nested within TWO are included.

-(TWO)