Python: module simpleparse.processor

simpleparse.processor | index s:\sp\simpleparse\processor.py

Classes
`` |  | MethodSource Processor
class MethodSource
`` | `Base class for MethodSource objects (including Processors and Parsers) Most applications will use either Processor or Parser objects, rather than directly using a MethodSource object. The MethodSource is basically just a generic object whose attributes are accessed during generation and/or post-processing of parse results. The following are the special attribute forms for use in _m_productionname -- alters the method used in the TextTools engine for storing results. If this is a callable object, then call the object with: object( taglist,text,l,r,subtags ) If it is TextTools.AppendToTagobj, then append the result tuple to the associated object (_o_productionname). This requires that _o_productionname have an "append" method, obviously. If it is the constant TextTools.AppendMatch, then append the string value which matched the production. If it is TextTools.AppendTagobj, then append the associated tagobject itself to the results tree. _o_productionname -- with AppendToTagobj, AppendTagobj and cases where there is no _m_productionname defined, this allows you to provide an explicit tagobject for reporting in the results tree/getting called with results.`
| Data and non-method functions defined here: __doc__ = 'Base class for MethodSource objects (including P...n the results tree/getting called with results.\n\t' `str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.` __module__ = 'simpleparse.processor' `str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.`
class Processor(MethodSource)
`` | `Provides definition of a generic processing API Basically, a Processor has a method __call__ which takes two arguments, a value (which is either a 3-tuple or a 4-tuple depending on whether a top-level production is being processed), and a pointer to the buffer being parsed.`
| Methods defined here: __call__(self, value, buffer) `Process the results of a parsing run over buffer` __repr__(self) `Return a representation of the class` Data and non-method functions defined here: __doc__ = 'Provides definition of a generic processing API\n...ed),\n\tand a pointer to the buffer being parsed.\n\t' `str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.` __module__ = 'simpleparse.processor' `str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.`

Data
`` |  | __file__ = r'S:\sp\simpleparse\processor.pyc' __name__ = 'simpleparse.processor'