Part 1 Flashcards
Static Variable
Bound to memory cells before execution, begins and remains bound to the same memory cell throughout execution
Stack Dynamic
Storage bindings are created for variables when their declaration statements are elaborated
Explicit heap-Dynamic
Allocated and Deallocated by explicit directive, specified by the programmer, which take effect during execution
Implicit heap-Dynamic
Allocation and deallocation caused by assignment statements
Scope of a variable
Range of statements over which it is visible (can be referenced, used, or accessed)
Local Variables
Those that are declared in that unit
Nonlocal variables
those that are visible in the unit but not declared there
Global Variables
Special category of nonlocal variables
Scope rules
Determine how references to names are associated with variables
Lifetime of a Variable
The time during which it is bound to a particular memory cell
Static Scope
Known at compile time. Based on the physical structure of the program
Dynamic Scope
Determined at run time based on the calling sequence
Static Scope Search
First Locally, then in increasingly larger enclosing scopes, until one is found for the given name
Static Ancestors
Enclosing static scopes to a specific scope
Static Parent
Nearest static ancestor