From: José Fonseca Date: Fri, 13 Jan 2012 23:21:10 +0000 (+0000) Subject: Add a few more comments. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=9c4a257be710745d69ed5039a0ee07b3d3fd7597;hp=993748b1388b5d393588f073d677397eca109f8b;p=apitrace Add a few more comments. --- diff --git a/specs/stdapi.py b/specs/stdapi.py index 0b2fe82..5dd4845 100644 --- a/specs/stdapi.py +++ b/specs/stdapi.py @@ -399,6 +399,7 @@ class Polymorphic(Type): class Visitor: + '''Abstract visitor for the type hierarchy.''' def visit(self, type, *args, **kwargs): return type.visit(self, *args, **kwargs) @@ -451,6 +452,7 @@ class Visitor: class OnceVisitor(Visitor): + '''Visitor that guarantees that each type is visited only once.''' def __init__(self): self.__visited = set() @@ -463,6 +465,10 @@ class OnceVisitor(Visitor): class Rebuilder(Visitor): + '''Visitor which rebuild types as it visits them. + + By itself it is a no-op -- it is intended to be overwritten. + ''' def visit_void(self, void): return void @@ -518,7 +524,7 @@ class Rebuilder(Visitor): class Collector(Visitor): - '''Collect.''' + '''Visitor which collects all unique types as it traverses them.''' def __init__(self): self.__visited = set() @@ -586,6 +592,10 @@ class Collector(Visitor): class API: + '''API abstraction. + + Essentially, a collection of types, functions, and interfaces. + ''' def __init__(self, name = None): self.name = name