Document Number: J4/02-0070
March 12, 2002
Page 1 of 2
Interpretation Request - Restricted program pointer with AS phrase on CALL stmt
Don Schricker
References:
Base Document: December 2001
02-0069 - Interpretation Request - Restricted program pointer with AS phrase on CALL
stmt (Schricker)
QUESTION:
Is the AS phrase allowed to override a restricted program pointer? There is no rule that prohibits it.
Consider, for example:
Should this CALL statement be legal?
Note that
SET pp-1 TO ADDRESS OF PROGRAM program-2
is invalid according to the syntax rules of the SET statement unless the signatures of program-1 and
program-2 are the same. Therefore, it would seem that this AS phrase should not be allowed on the
CALL statement unless the two signatures are the same, and in that case there is no need for the AS
phrase.
General rule 7 of the CALL statement, which applies to the format 3 (the program-prototype format)
reads:
7) If the NESTED phrase is not specified, program-prototype-name-1, or the program prototype specified
in the definition of identifier-1 if it is defined as a restricted program-pointer, is used to determine the
characteristics of the called program.
This implies that specifying program-prototype-name-1 and specifying a restricted program-pointer for
identifier-1 are mutually exclusive. Taken literally, it means that program-prototype-name-1 is ignored if
identifer-1 is a restricted program-pointer. Why require program-prototype-name-1 to be specified if it is
to be ignored? This seems like an error.
Document Number: J4/02-0070
March 12, 2002
Page 2 of 2
There are a couple of solutions that come to mind:
Solution 1 – New syntax
change the syntax diagram for format 3 of the CALL statement so that the first line reads:
identifier-1
NESTED
program-prototype-name-1
AS
CALL
update the syntax rules so that
- identifier-5 is required to be a restricted program-pointer
- if identifier-1 is a program-pointer, it is not a restricted program-pointer.
Solution 2 – no change to the syntax, new syntax rule
Add a syntax rule so that when identifer-1 is a restricted program-pointer, it must be restricted to
program-prototype-name-1. This seems very ugly. There's no reason to specify the program prototype
when one has no choice as to what it is.
Summary
If we do nothing, either typing for program-pointers is broken or the user is required to specify syntax
that is ignored. Implementations may differ in their interpretation.
I favor solution 1.