class documentation

class Builder(object): (source)

Known subclasses: zim.formats.ParseTreeBuilder, zim.parser.BuilderTextBuffer, zim.parser.SimpleTreeBuilder, zim.tokenparser.TokenBuilder

View In Hierarchy

This class defines a 'builder' interface for parse trees. It is used by the parser to construct the parse tree while keeping the parser objects agnostic of how the resulting parse tree objects look.
Method append No summary
Method end No summary
Method start No summary
Method text Append text @param text: text to be appended as string @implementation: must be implemented by sub-classes
def append(self, tag, attrib=None, text=None): (source)
Convenience function to open a tag, append text and close it immediatly. Only used for formatted text that has no sub-processing done.
Parameters
tagthe tag name
attriboptional dict with attributes
textformatted text
Unknown Field: implementation
optional for subclasses, default implementation calls start(), text(), and end()
def end(self, tag): (source)
End formatted region
Parameters
tagthe tag name
Raises
XXXwhen tag does not match current state
Unknown Field: implementation
must be implemented by sub-classes
def start(self, tag, attrib=None): (source)
Start formatted region
Parameters
tagthe tag name
attriboptional dict with attributes
Unknown Field: implementation
must be implemented by sub-classes
def text(self, text): (source)
Append text
Parameters
texttext to be appended as string
Unknown Field: implementation
must be implemented by sub-classes