CS 3304: Comparative Languages
Names and Binding
[
Course Documents
] : [
Names and Binding
]
Previous
Contents
Next
Keyword Index
Static (Lexical) Scope
Based on program text
To connect a name reference to a variable, you (or the compiler) must find the declaration
Search process
: search declarations, first locally, then in increasingly larger enclosing scopes, until one is found for the given name
Enclosing static scopes (to a specific scope) are called its
static ancestors
; the nearest static ancestor is called a
static parent