Subprogram Sequence Control Attributes of Data Control Parameter Passing Explicit Common Environments
Subprogram Sequence Control Attributes of Data Control Parameter Passing Explicit Common Environments
Subprogram Control :
interaction among subprograms
how subprograms pass data among themselves
CALL
RETURN
Simple call-return subprograms
Execution of subprograms
Subprogram definition.
Subprogram activation.
Subprogram definition
Central problem:
the meaning of variable names, i.e. the
correspondence between names and memory
locations.
Names and Referencing
Environments
Direct transmission
Referencing through a named data object
Direct transmission
A data object computed at one point as the
result of an operation may be directly
transmitted to another operation as an operand
Example: x = y + 2*z;
Block-structured languages :
Declaration of X
Declaration of Y
Use of Z Hidden to A
Local Data and Local Referencing
Environments
Local environment of a subprogram:
various identifiers declared in the subprogram :
variables, parameters, subprogram names.