December 2009
Intermediate to advanced
380 pages
9h 2m
English
Given a variable reference x in a program, we need to figure out which memory space it lives in so we can load or store its value. The interpreter figures this out by resolving x and asking for its surrounding scope. That scope tells the interpreter in what kind of scope the variable belongs: global, function, or data aggregate instance. Once the interpreter knows the kind of memory space, it can pick the proper dictionary in physical memory.
If the symbol table says x is a global variable, the interpreter loads it from the global space. If x resolves to a local variable or parameter, the interpreter loads it from the function space on the top of the function space stack.
If x is a field of a class, ...
Read now
Unlock full access