Modules | Files | Inheritance Tree | Inheritance Graph | Name Index | Config
module Synopsis::Formatter::ClassTree
class ClassTree
Files: Synopsis/Formatter/ClassTree.py
ClassTree-inheritance

Maintains a tree of classes directed by inheritance. This object always exists in HTML, since it is used for other things such as printing class bases.


Operations Summary:
 __init__(self) [Source]
 add_inheritance(self, supername, subname)
Adds an edge to the graph. [Source]
 subclasses(self, classname)
Returns a sorted list of all classes derived from the given class [Source]
 superclasses(self, classname)
Returns a sorted list of all classes the given class derives from. [Source]
 classes(self)
Returns a sorted list of all class names [Source]
 add_class(self, name)
Adds a class to the list of classes by name [Source]
 _is_root(self, name) [Source]
 _is_leaf(self, name) [Source]
 roots(self)
Returns a list of classes that have no superclasses [Source]
 graphs(self)
Returns a list of graphs. [Source]
 leaves(self, graph)
Returns a list of leaves in the given graph. [Source]
 _make_graphs(self) [Source]
 visitAST(self, ast) [Source]
 visitScope(self, scope) [Source]
 visitClass(self, clas)
Adds this class and all edges to the lists [Source]

Operation Details:
  add_inheritance(self, supername, subname)

Adds an edge to the graph. Supername and subname are the scoped names of the two classes involved in the edge, and are copied before being stored.


  superclasses(self, classname)

Returns a sorted list of all classes the given class derives from. The classes are returned as scoped names, which you may use to lookup the class declarations in the 'types' dictionary if you need to.


  graphs(self)

Returns a list of graphs. Each graph is just a list of connected classes.


  leaves(self, graph)

Returns a list of leaves in the given graph. A leaf is a class with no subclasses