Package ZestyParser :: Module Tokens :: Class Defer
[show private | hide private]
[frames | no frames]

Class Defer

AbstractToken --+
                |
               Defer


A token which takes a callable (generally a lambda) which takes no arguments and itself returns a token. A Defer instance, upon being called, will call this function, scan for the returned token, and return that return value. This is primarily intended to allow you to define tokens recursively; if you need to refer to a token that hasn't been defined yet, simply use Defer(lambda: T_SOME_TOKEN), where T_SOME_TOKEN is the token's eventual name.
Method Summary
  __init__(self, func, **kwargs)
  __call__(self, parser, origCursor)
    Inherited from AbstractToken
  __add__(self, other)
Allows you to construct TokenSequences with the + operator.
  __copy__(self)
  __invert__(self)
  __or__(self, other)
Allows you to construct CompositeTokens with the | operator.
  __repr__(self)
  __rshift__(self, callback)
Convenience overloading for setting the callback of a token whose initializer you do not call directly, such as the result of combining tokens with + or |.
  __setattr__(self, name, value)
  __str__(self)
  __xor__(self, message)
Overloading for setting the failMessage of a token.
  _call_failcheck(self, parser, origCursor)
  _call_preprocess(self, parser, origCursor)

Instance Variable Summary
    Inherited from AbstractToken
NoneType callback: An optional callable which, if not None, will be called whenever an instance matches successfully.
  desc: The generic "description" variable which stores the "essence" of any given instance.
NoneType to: An optional callable which, if not None, will be called in the same manner as a callback (after any callback and before returning to the parser instance), but will be passed only one argument: the data matched (or returned by the callback, if any).

Class Variable Summary
    Inherited from AbstractToken
bool callbackArgCount = False
NoneType failMessage = None                                                                  
NoneType _call_orig = None                                                                  

Generated by Epydoc 2.1 on Thu Mar 22 02:13:39 2007 http://epydoc.sf.net