December 2000
Intermediate to advanced
816 pages
16h 57m
English
The scope of an identifier is defined to be the portion of the program where its declaration applies, or what we refer to as “variable visibility.” In other words, it is like asking yourself in which parts of a program do you have access to a specific identifier. Variables either have local or global scope.
Variables defined within a function have local scope, and those which are at the highest level in a module have global or nonlocal scope.
In their famous “dragon” book on compiler theory, Aho, Sethi, and Ullman summarize it this way:
“The portion of the program to which a declaration applies is called the scope of that declaration. An occurrence of a name in a procedure is said to be ...
Read now
Unlock full access