Abstract base level parser element class.
|
__init__(self,
savelist=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
setName(self,
name)
Define name for this expression, for use in debugging. |
source code
|
|
|
setResultsName(self,
name,
listAllMatches=False)
Define name for referencing matching tokens as a nested attribute of
the returned parse results. |
source code
|
|
|
setBreak(self,
breakFlag=True)
Method to invoke the Python pdb debugger when this element is about
to be parsed. |
source code
|
|
|
setParseAction(self,
*fns,
**kwargs)
Define action to perform when successfully matching parse element
definition. |
source code
|
|
|
|
|
|
|
|
|
parseImpl(self,
instring,
loc,
doActions=True) |
source code
|
|
|
|
|
|
|
|
|
scanString(self,
instring,
maxMatches=2147483647)
Scan the input string for expression matches. |
source code
|
|
|
transformString(self,
instring)
Extension to scanString , to modify matching text with
modified tokens that may be returned from a parse action. |
source code
|
|
|
searchString(self,
instring,
maxMatches=2147483647)
Another extension to scanString , simplifying the access
to the tokens found to match the given parse expression. |
source code
|
|
|
__add__(self,
other)
Implementation of + operator - returns And |
source code
|
|
|
__radd__(self,
other)
Implementation of + operator when left operand is not a
ParserElement |
source code
|
|
|
__sub__(self,
other)
Implementation of - operator, returns And with error
stop |
source code
|
|
|
__rsub__(self,
other)
Implementation of - operator when left operand is not a
ParserElement |
source code
|
|
|
__mul__(self,
other)
Implementation of * operator, allows use of expr * 3 in
place of expr + expr + expr . |
source code
|
|
|
|
|
__or__(self,
other)
Implementation of | operator - returns MatchFirst |
source code
|
|
|
__ror__(self,
other)
Implementation of | operator when left operand is not a
ParserElement |
source code
|
|
|
__xor__(self,
other)
Implementation of ^ operator - returns Or |
source code
|
|
|
__rxor__(self,
other)
Implementation of ^ operator when left operand is not a
ParserElement |
source code
|
|
|
__and__(self,
other)
Implementation of & operator - returns Each |
source code
|
|
|
__rand__(self,
other)
Implementation of & operator when left operand is not a
ParserElement |
source code
|
|
|
__invert__(self)
Implementation of ~ operator - returns NotAny |
source code
|
|
|
|
|
suppress(self)
Suppresses the output of this ParserElement ; useful to
keep punctuation from cluttering up returned output. |
source code
|
|
|
leaveWhitespace(self)
Disables the skipping of whitespace before matching the characters in
the ParserElement 's defined pattern. |
source code
|
|
|
setWhitespaceChars(self,
chars)
Overrides the default whitespace chars |
source code
|
|
|
|
|
ignore(self,
other)
Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or
other ignorable patterns. |
source code
|
|
|
setDebugActions(self,
startAction,
successAction,
exceptionAction)
Enable display of debugging messages while doing pattern matching. |
source code
|
|
|
setDebug(self,
flag=True)
Enable display of debugging messages while doing pattern matching. |
source code
|
|
|
|
|
|
|
|
|
|
|
validate(self,
validateTrace=[ ] )
Check defined expressions for valid structure, check for infinite
recursive definitions. |
source code
|
|
|
parseFile(self,
file_or_filename,
parseAll=False)
Execute the parse expression on the given file or filename. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|