| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
ParserElement --+
|
ParseElementEnhance --+
|
NotAny
Lookahead to disallow matching with the given parse expression.
NotAny does not advance the parsing position within
the input string, it only verifies that the specified parse expression
does not match at the current position. Also, NotAny
does not skip over leading whitespace. NotAny always
returns a null token list. May be constructed using the '~'
operator.
Example:
AND, OR, NOT = map(CaselessKeyword, "AND OR NOT".split())
# take care not to mistake keywords for identifiers
ident = ~(AND | OR | NOT) + Word(alphas)
boolean_term = Optional(NOT) + ident
# very crude boolean expression - to support parenthesis groups and
# operation hierarchy, use infixNotation
boolean_expr = boolean_term + ZeroOrMore((AND | OR) + boolean_term)
# integers that are followed by "." are actually floats
integer = Word(nums) + ~Char(".")
| Instance Methods | |||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
| Static Methods | |
|
Inherited from |
| Class Variables | |
__slotnames__ =
|
|
|
Inherited from |
|
| Properties | |
|
Inherited from |
| Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
|
str(x)
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Wed Oct 31 00:55:29 2018 | http://epydoc.sourceforge.net |