Package compiler :: Module symbols :: Class Scope
[hide private]
[frames] | no frames]

_ClassType Scope

Known Subclasses:

Instance Methods [hide private]
 
__init__(self, name, module, klass=None)
 
__repr__(self)
 
mangle(self, name)
 
add_def(self, name)
 
add_use(self, name)
 
add_global(self, name)
 
add_param(self, name)
 
get_names(self)
 
add_child(self, child)
 
get_children(self)
 
DEBUG(self)
 
check_name(self, name)
Return scope of name.
 
get_free_vars(self)
 
handle_children(self)
 
force_global(self, name)
Force name to be global in scope.
 
add_frees(self, names)
Process list of free vars from nested scope.
 
get_cell_vars(self)
Method Details [hide private]

check_name(self, name)

 

Return scope of name.

The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.

force_global(self, name)

 

Force name to be global in scope.

Some child of the current node had a free reference to name. When the child was processed, it was labelled a free variable. Now that all its enclosing scope have been processed, the name is known to be a global or builtin. So walk back down the child chain and set the name to be global rather than free.

Be careful to stop if a child does not think the name is free.

add_frees(self, names)

 

Process list of free vars from nested scope.

Returns a list of names that are either 1) declared global in the parent or 2) undefined in a top-level parent. In either case, the nested scope should treat them as globals.