CS 3304: Comparative Languages
Implementing Subprograms
[
Course Documents
] : [
Implementing Subprograms
]
Course Documents
Next
Keyword Index
Implementing Subprograms
Handout:
PDF File
(12pp., 548K)
Outline
Implementing Subprograms
Implementing FORTRAN 77 Subprograms
FORTRAN Activation Info
Activation Records
Implementing Subprograms in ALGOL-like Languages
Activation Record Structure
Activation Record Details
Example Factorial Program
Example Factorial Program (1)
Example Factorial Program (2)
Example Factorial Program (3)
Example Factorial Program (4)
Example Factorial Program (5)
The Dynamic Chain
Accessing Nonlocal References
Nonlocal Refs: Static Scoping
Technique 1: Static Chains
Static Depth and Chain Offset
Static Chain Example
Static Chain Example (1)
Static Chain Example (2)
Static Chain Example (3)
Static Chain Example (4)
Static Chain Example (5)
Static Chain Example (6)
Static Chain Example (7)
Static Chain Example (8)
Static Chain Maintenance
Evaluation of Static Chains
Technique 2: Displays
Mechanics of Display References
Static Chain vs. Display
Implementing Blocks
Implementing Dynamic Scoping
Subprograms as Parameters