class documentation

class FillInLocalPointers(Visitor): (source)

View In Hierarchy

Fill in ClassType pointers using symbol tables. This is an in-place visitor! It modifies the original tree. This is necessary because we introduce loops.

Method __init__ Create this visitor.
Method EnterClassType Fills in a class type.
Method _Lookup Look up a node by name.
Instance Variable _lookup_map Undocumented

Inherited from Visitor:

Method Enter Undocumented
Method Leave Undocumented
Method Visit Undocumented
Class Variable old_node Undocumented
Class Variable unchecked_node_names Undocumented
Class Variable visits_all_node_types Undocumented
Instance Variable enter_functions Undocumented
Instance Variable leave_functions Undocumented
Instance Variable visit_class_names Undocumented
Instance Variable visit_functions Undocumented
Class Variable _visitor_functions_cache Undocumented
def __init__(self, lookup_map, fallback=None): (source)

Create this visitor. You're expected to then pass this instance to node.Visit(). Args: lookup_map: A map from names to symbol tables (i.e., objects that have a "Lookup" function). fallback: A symbol table to be tried if lookup otherwise fails.

def EnterClassType(self, node): (source)

Fills in a class type. Args: node: A ClassType. This node will have a name, which we use for lookup. Returns: The same ClassType. We will have done our best to fill in its "cls" attribute. Call VerifyLookup() on your tree if you want to be sure that all of the cls pointers have been filled in.

def _Lookup(self, node): (source)

Look up a node by name.

_lookup_map = (source)

Undocumented