A particularly versatile class whose instances match one token
multiple times (with a great degree of customizability).
The properties
Method Summary |
|
__init__(self,
token,
min,
max,
skip,
prefix,
postfix,
delimiter,
until,
includeDelimiter,
**kwargs)
|
|
__call__(self,
parser,
origCursor)
|
|
__str__(self)
|
Inherited from AbstractToken |
|
__add__ (self,
other)
Allows you to construct TokenSequence s with the + operator. |
|
__copy__ (self)
|
|
__imod__ (self,
val)
|
|
__invert__ (self)
|
|
__mod__ (self,
val)
|
|
__mul__ (self,
val)
Allows you to construct TokenSeries with the * operator. |
|
__or__ (self,
other)
Allows you to construct CompositeToken s with the | operator. |
|
__repr__ (self)
|
|
__rmul__ (self,
val)
Allows you to construct TokenSeries with the * operator. |
|
__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)
|
|
__sub__ (self,
other)
Allows you to construct TokenSequence s with the - operator,
automatically padded with Whitespace . |
|
__xor__ (self,
message)
Overloading for setting the failMessage of a token. |
Inherited from object |
|
__delattr__ (...)
x.__delattr__('name') <==> del x.name |
|
__getattribute__ (...)
x.__getattribute__('name') <==> x.name |
|
__hash__ (x)
x.__hash__() <==> hash(x) |
|
__new__ (T,
S,
...)
T.__new__(S, ...) -> a new object with type S, a subtype of T |
|
__reduce__ (...)
helper for pickle |
|
__reduce_ex__ (...)
helper for pickle |
Instance Variable Summary |
token |
delimiter : An optional token to require (but omit from the return value) between
each instance of token . |
token |
desc : The token to match. |
int |
max : The maximum number of times desc will try to match. |
int |
min : The minimum number of times desc must match. |
token |
postfix : An optional token to require (but omit from the return value) after
each instance of token . |
token |
prefix : An optional token to require (but omit from the return value) before
each instance of token . |
token |
skip : An optional token to skip between matches. |
|
until : An optional 2-tuple whose first item is a token, and whose second item
is either a message or False. |
Inherited from AbstractToken |
NoneType |
callback : An optional callable which, if not None, will be called whenever an
instance matches successfully. |
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). |