Browse Prior Art Database

Determination of Range of an Entry Variable

IP.com Disclosure Number: IPCOM000079415D
Original Publication Date: 1973-Jun-01
Included in the Prior Art Database: 2005-Feb-26
Document File: 2 page(s) / 14K

Publishing Venue

IBM

Related People

Tapscott, RP: AUTHOR

Abstract

Entry variables are variables that range over procedures. An important problem in compiling programs, is to determine exactly which procedures can be referenced using a given entry variable. This algorithm determines this set of procedures.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 54% of the total text.

Page 1 of 2

Determination of Range of an Entry Variable

Entry variables are variables that range over procedures. An important problem in compiling programs, is to determine exactly which procedures can be referenced using a given entry variable. This algorithm determines this set of procedures.

Ascertaining the effects on the arguments, returned value, and global values on the invocation of the PL/1 entry variable, is subject to the following conditions.

First, the entry variable may be modified directly within one of the internal procedures being invoked, or within the current procedure.

Secondly, the entry variable may itself be passed as an argument to one or more procedures, which modify the corresponding parameter.

Thirdly, the value assigned to the entry variable may be "returned" on the invocation of one or more procedures.

Finally, the entry variable may be a parameter of the current procedure and, if modified by the current procedure or procedures invoked from the current procedure, must have all additional values reflected upwards to the procedures invoking the current one.

The first condition above is handled by a preliminary scan of the program text which produces a list of those values directly assigned to the entry variable in the main procedure being processed, and which produces a list of "aliases" (equivalent values) of the entry variable.

The remaining conditions are handled iteratively as follows: Step 1:.

Each invocation of a user defined procedure has one of the following cases:
1) Y = FN;
2) Y = FN (A(1),A(2),A(3),--,An);
3) CALL FN;
4) CALL FN (A(1),A(2),A(3),--,An); where:

Y is the formal "returned" value, a

FN is the procedure, entry point, or entry variable being

invoked, and A(i) is an item in the argument list of the

invocation. If case 1) or 2) is encountered step 2 follows,

otherwise step 3 follows:

Step 2:.

If Y is an entry variable then the formal return value of FN, if FN is a procedure or entry point, is examined and all known values of the formal return value are added to the value list of Y, unless one of the known values is also an entry variable, in which case its known value list is added to that of Y along with the value lists of all known aliases.

1

Page 2 of 2

If FN is also an entry variable then the preceding is repeated for all known values of FN, i.e., if FN is known to have the values A and B, where A and B...