Home | Trees | Index | Help |
---|
Package ZestyParser :: Module Tokens |
|
Version: 0.8.0
Author: Adam Atlas
Contact: adam@atlas.st
Copyright: Copyright 2006-2007 Adam Atlas. Released under the MIT license (see LICENSE.txt).
Classes | |
---|---|
AbstractToken |
Base class from which most tokens defined in this module derive. |
Placeholder |
|
TokenWrapper |
If you write your own token type in a way other than subclassing AbstractToken, e.g. |
_EOF |
Matches returning None if the parser is at the end of its input. |
_Whitespace |
|
ListReplacing |
|
SingleReplacing |
|
Basic Tokens | |
Raw |
A class whose instances match only a particular string. |
RE |
A class whose instances match Python regular expressions. |
RawToken |
A class whose instances match only a particular string. |
Token |
A class whose instances match Python regular expressions. |
TakeToken |
A class whose instances match and return a given number of characters
from the parser's data . |
Complex Tokens | |
CompositeToken |
A class whose instances match any of a number of tokens. |
TokenSequence |
A class whose instances match a sequence of tokens. |
TokenSeries |
A particularly versatile class whose instances match one token multiple times (with a great degree of customizability). |
Special Tokens | |
Defer |
A token which takes a callable (generally a lambda) which takes no arguments and itself returns a token. |
Default |
A class whose instances always return desc and do not advance the parser's
cursor. |
Lookahead |
Scans for another token and returns its result as usual, but doesn't actually advance the parser's cursor. |
Negative |
Scans for another token, and only matches (returning True) if that token did not match. |
TokenSequence Flags | |
Omit |
See TokenSequence . |
Skip |
See TokenSequence . |
Only |
See TokenSequence . |
Function Summary | |
---|---|
This is a factory function used for when you want an AbstractToken -compatible callback that
returns a constant. | |
_pad(p,
subj,
outer)
| |
count_args(callable)
|
Variable Summary | |
---|---|
Default |
EmptyToken : A Default instance initialized with the empty
string. |
_EOF |
EOF : A token which matches (and returns None ) if the parser is
at the end of its data sequence. |
int |
Inf = -1 |
_Whitespace |
Whitespace = _Whitespace
|
list |
replstack = []
|
list |
rstack = []
|
Function Details |
---|
Const(value)This is a factory function used for when you want anAbstractToken -compatible callback that
returns a constant. Example:
RawToken('foo') >> Const('bar')This token matches 'foo' as usual, but always returns 'bar'. |
Variable Details |
---|
EmptyTokenADefault instance initialized with the empty
string.
|
EOFA token which matches (and returns In ZestyParser, a token object must, at minimum, be a callable taking
a Tokens module contains a variety of
predefined token classes (instances of which are callable) and other
valid token objects which should cover most parsing situations.
|
Inf
|
Whitespace
|
replstack
|
rstack
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Apr 26 01:32:22 2007 | http://epydoc.sf.net |