Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Private Attributes
symtable.Class Class Reference
Inheritance diagram for symtable.Class:
Inheritance graph
[legend]
Collaboration diagram for symtable.Class:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def get_methods
def __repr__
def get_type
def get_id
def get_name
def get_lineno
def is_optimized
def is_nested
def has_children
def has_exec
def has_import_star
def get_identifiers
def lookup
def get_symbols
def get_children

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Private Attributes

 __methods = None

Detailed Description

Definition at line 159 of file symtable.py.


Member Function Documentation

def symtable.SymbolTable.__repr__ (   self) [inherited]

Definition at line 47 of file symtable.py.

00047 
00048     def __repr__(self):
00049         if self.__class__ == SymbolTable:
00050             kind = ""
00051         else:
00052             kind = "%s " % self.__class__.__name__
00053 
00054         if self._table.name == "global":
00055             return "<{0}SymbolTable for module {1}>".format(kind, self._filename)
00056         else:
00057             return "<{0}SymbolTable for {1} in {2}>".format(kind,
00058                                                             self._table.name,
00059                                                             self._filename)

def symtable.SymbolTable.get_children (   self) [inherited]

Definition at line 116 of file symtable.py.

00116 
00117     def get_children(self):
00118         return [_newSymbolTable(st, self._filename)
00119                 for st in self._table.children]
00120 

def symtable.SymbolTable.get_id (   self) [inherited]

Definition at line 70 of file symtable.py.

00070 
00071     def get_id(self):
00072         return self._table.id

def symtable.SymbolTable.get_identifiers (   self) [inherited]

Definition at line 97 of file symtable.py.

00097 
00098     def get_identifiers(self):
00099         return self._table.symbols.keys()

Here is the caller graph for this function:

def symtable.SymbolTable.get_lineno (   self) [inherited]

Definition at line 76 of file symtable.py.

00076 
00077     def get_lineno(self):
00078         return self._table.lineno

Definition at line 163 of file symtable.py.

00163 
00164     def get_methods(self):
00165         if self.__methods is None:
00166             d = {}
00167             for st in self._table.children:
00168                 d[st.name] = 1
00169             self.__methods = tuple(d)
00170         return self.__methods
00171 

def symtable.SymbolTable.get_name (   self) [inherited]

Definition at line 73 of file symtable.py.

00073 
00074     def get_name(self):
00075         return self._table.name

def symtable.SymbolTable.get_symbols (   self) [inherited]

Definition at line 108 of file symtable.py.

00108 
00109     def get_symbols(self):
00110         return [self.lookup(ident) for ident in self.get_identifiers()]

Here is the call graph for this function:

def symtable.SymbolTable.get_type (   self) [inherited]

Definition at line 60 of file symtable.py.

00060 
00061     def get_type(self):
00062         if self._table.type == _symtable.TYPE_MODULE:
00063             return "module"
00064         if self._table.type == _symtable.TYPE_FUNCTION:
00065             return "function"
00066         if self._table.type == _symtable.TYPE_CLASS:
00067             return "class"
00068         assert self._table.type in (1, 2, 3), \
00069                "unexpected type: {0}".format(self._table.type)

def symtable.SymbolTable.has_children (   self) [inherited]

Definition at line 86 of file symtable.py.

00086 
00087     def has_children(self):
00088         return bool(self._table.children)

def symtable.SymbolTable.has_exec (   self) [inherited]
Return true if the scope uses exec.  Deprecated method.

Definition at line 89 of file symtable.py.

00089 
00090     def has_exec(self):
00091         """Return true if the scope uses exec.  Deprecated method."""
00092         return False

def symtable.SymbolTable.has_import_star (   self) [inherited]
Return true if the scope uses import *

Definition at line 93 of file symtable.py.

00093 
00094     def has_import_star(self):
00095         """Return true if the scope uses import *"""
00096         return bool(self._table.optimized & OPT_IMPORT_STAR)

def symtable.SymbolTable.is_nested (   self) [inherited]

Definition at line 83 of file symtable.py.

00083 
00084     def is_nested(self):
00085         return bool(self._table.nested)

def symtable.SymbolTable.is_optimized (   self) [inherited]

Definition at line 79 of file symtable.py.

00079 
00080     def is_optimized(self):
00081         return bool(self._table.type == _symtable.TYPE_FUNCTION
00082                     and not self._table.optimized)

def symtable.SymbolTable.lookup (   self,
  name 
) [inherited]

Definition at line 100 of file symtable.py.

00100 
00101     def lookup(self, name):
00102         sym = self._symbols.get(name)
00103         if sym is None:
00104             flags = self._table.symbols[name]
00105             namespaces = self.__check_children(name)
00106             sym = self._symbols[name] = Symbol(name, flags, namespaces)
00107         return sym

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

symtable.Class.__methods = None [static, private]

Definition at line 161 of file symtable.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: