HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Lookahead

HLASM Language Reference
SC26-4940-06

Symbol attributes are established in either definition mode or lookahead mode.

Definition mode occurs whenever a previously undefined symbol is encountered in the name field of a statement, or in the operand field of an EXTRN or WXTRN statement during open code processing. Symbols within a macro definition are defined when the macro is expanded.

Lookahead mode is entered:
  • When the assembler processes a conditional assembly instruction and encounters an attribute reference (other than D' and O') to an ordinary symbol that is not yet defined.
  • When the assembler encounters a forward AGO or AIF branch in open code to a sequence symbol that is not yet defined.

Lookahead is a sequential, statement-by-statement, forward scan over the source text.

If the attribute reference is made in a macro, forward scan begins with the first source statement following the outermost macro instruction. During lookahead the assembler:
  • Bypasses macro definition and generation
  • Does not generate object text
  • Does not perform open-code variable substitution
  • Ignores AIF and AGO branch instructions
  • Ignores the record following a REPRO statement
  • Establishes interim data attributes for undefined symbols it encounters in operand fields of instructions. The data attributes are replaced when a symbol is encountered in definition mode.

Lookahead mode ends when the desired symbol or sequence symbol is found, or when the END statement or end of file is reached. All statements read by lookahead are saved on an internal file, and are fully processed when the lookahead scan ends.

If a COPY instruction is encountered during lookahead, it is fully processed at that time, the assembler copies the statements from the library, scans them, and saves them on the lookahead file. When lookahead mode has ended any COPY instructions saved to the lookahead file are ignored, as the statements from the copy member have already been read and saved to the lookahead file.

If a variable symbol is used for the member name of a COPY that is expanded during lookahead, the value of the variable symbol at the time the COPY is expanded is used.

For purposes of attribute definition, a symbol is considered partially defined if it depends in any way upon a symbol not yet defined. For example, if the symbol is defined by a forward EQU that is not yet resolved, that symbol is assigned a type attribute of U.

In this case it is possible that, by the end of the assembly, the type attribute has changed to some other value.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014