Package tdi :: Package markup :: Package text :: Module parser :: Class TextParser
[frames] | no frames]

Class TextParser

source code

object --+
         |
        TextParser

Text Parser
Instance Methods
 
__init__(self, listener, lexer=<class 'tdi.markup.text.parser.TextLexer'>)
Initialization
source code
 
handle_text(self, data) source code
 
handle_escape(self, escaped, data) source code
 
handle_starttag(self, name, attrs, closed, data) source code
 
handle_endtag(self, name, data) source code
 
handle_comment(self, data) source code
 
handle_pi(self, data) source code
 
handle_msection(self, name, value, data) source code
 
handle_decl(self, name, value, data) source code
 
feed(self, food) source code
 
finalize(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  __implements__ = [<class 'tdi.interfaces.ListenerInterface'>, ...
Properties

Inherited from object: __class__

Method Details

__init__(self, listener, lexer=<class 'tdi.markup.text.parser.TextLexer'>)
(Constructor)

source code 
Initialization
Parameters:
  • listener (BuildingListenerInterface) - The building listener
  • lexer (callable) - Lexer class/factory. This must be a callable taking an event listener and returning a lexer instance
Overrides: object.__init__

handle_text(self, data)

source code 

See Also: ListenerInterface

handle_escape(self, escaped, data)

source code 

See Also: ListenerInterface

handle_starttag(self, name, attrs, closed, data)

source code 

See Also: ListenerInterface

handle_endtag(self, name, data)

source code 

See Also: ListenerInterface

handle_comment(self, data)

source code 

See Also: ListenerInterface

handle_pi(self, data)

source code 

See Also: ListenerInterface

handle_msection(self, name, value, data)

source code 

See Also: ListenerInterface

handle_decl(self, name, value, data)

source code 

See Also: ListenerInterface

feed(self, food)

source code 

See Also: ParserInterface

finalize(self)

source code 
Raises:

See Also: ParserInterface


Class Variable Details

__implements__

Value:
[<class 'tdi.interfaces.ListenerInterface'>,
 <class 'tdi.interfaces.ParserInterface'>]