class documentation

class ASTBuilder: (source)

Constructor: ASTBuilder(system)

View In Hierarchy

Keeps tracks of the state of the AST build, creates documentable and adds objects to the system.

Method __init__ Undocumented
Method addAttribute Add a new attribute to the system.
Method parseFile Undocumented
Method parseString Undocumented
Method pop Leave a documentable.
Method popClass Leave a class.
Method popFunction Leave a function.
Method processModuleAST Undocumented
Method push Enter a documentable.
Method pushClass Create and a new class in the system.
Method pushFunction Create and enter a new function in the system.
Instance Variable ast_cache Undocumented
Instance Variable current Undocumented
Instance Variable currentMod Undocumented
Instance Variable system Undocumented
Method _pop Undocumented
Method _push Create and enter a new object of the given type and add it to the system.
Instance Variable _stack Undocumented
def __init__(self, system: model.System): (source)

Undocumented

def addAttribute(self, name: str, kind: model.DocumentableKind | None, parent: model.Documentable, lineno: int) -> model.Attribute: (source)

Add a new attribute to the system.

def parseFile(self, path: Path, ctx: model.Module) -> ast.Module | None: (source)

Undocumented

def parseString(self, py_string: str, ctx: model.Module) -> ast.Module | None: (source)

Undocumented

Leave a documentable.

def popClass(self): (source)

Leave a class.

def popFunction(self): (source)

Leave a function.

def processModuleAST(self, mod_ast: ast.Module, mod: model.Module): (source)

Undocumented

def push(self, obj: model.Documentable, lineno: int): (source)

Enter a documentable.

def pushClass(self, name: str, lineno: int) -> model.Class: (source)

Create and a new class in the system.

def pushFunction(self, name: str, lineno: int) -> model.Function: (source)

Create and enter a new function in the system.

Undocumented

Undocumented

Undocumented

Undocumented

def _pop(self, cls: type[model.Documentable]): (source)

Undocumented

def _push(self, cls: type[DocumentableT], name: str, lineno: int, parent: model.Documentable | None = None) -> DocumentableT: (source)

Create and enter a new object of the given type and add it to the system.

Parameters
cls:type[DocumentableT]Undocumented
name:strUndocumented
lineno:intUndocumented
parent:model.Documentable | NoneParent of the new documentable instance, it will use self.current if unspecified. Used for attributes declared in methods, typically ``__init__``.
Returns
DocumentableTUndocumented