|
Gaudi Framework, version v24r2 |
| Home | Generated: Wed Dec 4 2013 |


Public Member Functions | |
| def | setDefaultWhitespaceChars |
| def | __init__ |
| def | copy |
| def | setName |
| def | setResultsName |
| def | setBreak |
| def | setParseAction |
| def | addParseAction |
| def | setFailAction |
| def | preParse |
| def | parseImpl |
| def | postParse |
| def | tryParse |
| def | resetCache |
| def | enablePackrat |
| def | parseString |
| def | scanString |
| def | transformString |
| def | searchString |
| def | __add__ |
| def | __radd__ |
| def | __sub__ |
| def | __rsub__ |
| def | __mul__ |
| def | __rmul__ |
| def | __or__ |
| def | __ror__ |
| def | __xor__ |
| def | __rxor__ |
| def | __and__ |
| def | __rand__ |
| def | __invert__ |
| def | __call__ |
| def | suppress |
| def | leaveWhitespace |
| def | setWhitespaceChars |
| def | parseWithTabs |
| def | ignore |
| def | setDebugActions |
| def | setDebug |
| def | __str__ |
| def | __repr__ |
| def | streamline |
| def | checkRecursion |
| def | validate |
| def | parseFile |
| def | getException |
| def | __getattr__ |
| def | __eq__ |
| def | __ne__ |
| def | __hash__ |
| def | __req__ |
| def | __rne__ |
Static Public Attributes | |
| string | DEFAULT_WHITE_CHARS " \n\t\r" |
| tuple | setDefaultWhitespaceChars staticmethod(setDefaultWhitespaceChars) |
| tuple | resetCache staticmethod(resetCache) |
| tuple | enablePackrat staticmethod(enablePackrat) |
Private Member Functions | |
| def | _normalizeParseActionArgs |
| def | _skipIgnorables |
| def | _parseNoCache |
| def | _parseCache |
Private Attributes | |
| __dict__ | |
Static Private Attributes | |
| tuple | _normalizeParseActionArgs staticmethod(_normalizeParseActionArgs) |
| _parse _parseNoCache | |
| dictionary | _exprArgCache {} |
| _packratEnabled False | |
Abstract base level parser element class.
Definition at line 666 of file pyparsing.py.
| def pyparsing.ParserElement.__init__ | ( | self, | |
savelist = False |
|||
| ) |
Definition at line 676 of file pyparsing.py.
| def pyparsing.ParserElement.__add__ | ( | self, | |
| other | |||
| ) |
| def pyparsing.ParserElement.__and__ | ( | self, | |
| other | |||
| ) |
| def pyparsing.ParserElement.__call__ | ( | self, | |
| name | |||
| ) |
Shortcut for setResultsName, with listAllMatches=default::
userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno")
could be written as::
userdata = Word(alphas)("name") + Word(nums+"-")("socsecno")
Definition at line 1309 of file pyparsing.py.
| def pyparsing.ParserElement.__eq__ | ( | self, | |
| other | |||
| ) |
Definition at line 1420 of file pyparsing.py.
| def pyparsing.ParserElement.__getattr__ | ( | self, | |
| aname | |||
| ) |
Definition at line 1413 of file pyparsing.py.
| def pyparsing.ParserElement.__hash__ | ( | self | ) |
Definition at line 1435 of file pyparsing.py.
| def pyparsing.ParserElement.__invert__ | ( | self | ) |
| def pyparsing.ParserElement.__mul__ | ( | self, | |
| other | |||
| ) |
Definition at line 1193 of file pyparsing.py.
| def pyparsing.ParserElement.__ne__ | ( | self, | |
| other | |||
| ) |
Definition at line 1432 of file pyparsing.py.
| def pyparsing.ParserElement.__or__ | ( | self, | |
| other | |||
| ) |
| def pyparsing.ParserElement.__radd__ | ( | self, | |
| other | |||
| ) |
Implementation of + operator when left operand is not a ParserElement
Definition at line 1163 of file pyparsing.py.
| def pyparsing.ParserElement.__rand__ | ( | self, | |
| other | |||
| ) |
Implementation of & operator when left operand is not a ParserElement
Definition at line 1295 of file pyparsing.py.
| def pyparsing.ParserElement.__repr__ | ( | self | ) |
Definition at line 1378 of file pyparsing.py.
| def pyparsing.ParserElement.__req__ | ( | self, | |
| other | |||
| ) |
Definition at line 1438 of file pyparsing.py.
| def pyparsing.ParserElement.__rmul__ | ( | self, | |
| other | |||
| ) |
Definition at line 1242 of file pyparsing.py.
| def pyparsing.ParserElement.__rne__ | ( | self, | |
| other | |||
| ) |
Definition at line 1441 of file pyparsing.py.
| def pyparsing.ParserElement.__ror__ | ( | self, | |
| other | |||
| ) |
Implementation of | operator when left operand is not a ParserElement
Definition at line 1255 of file pyparsing.py.
| def pyparsing.ParserElement.__rsub__ | ( | self, | |
| other | |||
| ) |
Implementation of - operator when left operand is not a ParserElement
Definition at line 1183 of file pyparsing.py.
| def pyparsing.ParserElement.__rxor__ | ( | self, | |
| other | |||
| ) |
Implementation of ^ operator when left operand is not a ParserElement
Definition at line 1275 of file pyparsing.py.
| def pyparsing.ParserElement.__str__ | ( | self | ) |
Definition at line 1375 of file pyparsing.py.
| def pyparsing.ParserElement.__sub__ | ( | self, | |
| other | |||
| ) |
Implementation of - operator, returns And with error stop
Definition at line 1173 of file pyparsing.py.
| def pyparsing.ParserElement.__xor__ | ( | self, | |
| other | |||
| ) |
|
private |
Internal method used to decorate parse actions that take fewer than 3 arguments, so that all parse actions can be called as f(s,l,t).
Definition at line 747 of file pyparsing.py.
|
private |
Definition at line 993 of file pyparsing.py.
|
private |
Definition at line 913 of file pyparsing.py.
|
private |
Definition at line 881 of file pyparsing.py.
| def pyparsing.ParserElement.addParseAction | ( | self, | |
| fns, | |||
| kwargs | |||
| ) |
Add parse action to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.
Definition at line 862 of file pyparsing.py.
| def pyparsing.ParserElement.checkRecursion | ( | self, | |
| parseElementList | |||
| ) |
Definition at line 1386 of file pyparsing.py.
| def pyparsing.ParserElement.copy | ( | self | ) |
Make a copy of this ParserElement. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element.
Definition at line 699 of file pyparsing.py.
| def pyparsing.ParserElement.enablePackrat | ( | ) |
Enables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method ParserElement.enablePackrat(). If your program uses psyco to "compile as you go", you must call enablePackrat before calling psyco.full(). If you do not do this, Python will crash. For best results, call enablePackrat() immediately after importing pyparsing.
Definition at line 1018 of file pyparsing.py.
| def pyparsing.ParserElement.getException | ( | self | ) |
Definition at line 1410 of file pyparsing.py.
| def pyparsing.ParserElement.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.
Definition at line 1346 of file pyparsing.py.
| def pyparsing.ParserElement.leaveWhitespace | ( | self | ) |
Disables the skipping of whitespace before matching the characters in the ParserElement's defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars.
Definition at line 1323 of file pyparsing.py.
| def pyparsing.ParserElement.parseFile | ( | self, | |
| file_or_filename, | |||
parseAll = False |
|||
| ) |
Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing.
Definition at line 1393 of file pyparsing.py.
| def pyparsing.ParserElement.parseImpl | ( | self, | |
| instring, | |||
| loc, | |||
doActions = True |
|||
| ) |
Definition at line 906 of file pyparsing.py.
| def pyparsing.ParserElement.parseString | ( | self, | |
| instring, | |||
parseAll = False |
|||
| ) |
Execute the parse expression with the given string.
This is the main interface to the client code, once the complete
expression has been built.
If you want the grammar to require that the entire input string be
successfully parsed, then set parseAll to True (equivalent to ending
the grammar with StringEnd()).
Note: parseString implicitly calls expandtabs() on the input string,
in order to report proper column numbers in parse actions.
If the input string contains tabs and
the grammar uses parse actions that use the loc argument to index into the
string being parsed, you can ensure you have a consistent view of the input
string by:
- calling parseWithTabs on your grammar before calling parseString
(see L{I{parseWithTabs}<parseWithTabs>})
- define your parse action using the full (s,loc,toks) signature, and
reference the input string using the parse action's s argument
- explictly expand the tabs in your input string before calling
parseString
Definition at line 1039 of file pyparsing.py.
| def pyparsing.ParserElement.parseWithTabs | ( | self | ) |
Overrides default behavior to expand <TAB>s to spaces before parsing the input string. Must be called before parseString when the input grammar contains elements that match <TAB> characters.
Definition at line 1339 of file pyparsing.py.
| def pyparsing.ParserElement.postParse | ( | self, | |
| instring, | |||
| loc, | |||
| tokenlist | |||
| ) |
Definition at line 909 of file pyparsing.py.
| def pyparsing.ParserElement.preParse | ( | self, | |
| instring, | |||
| loc | |||
| ) |
Definition at line 894 of file pyparsing.py.
| def pyparsing.ParserElement.resetCache | ( | ) |
Definition at line 1013 of file pyparsing.py.
| def pyparsing.ParserElement.scanString | ( | self, | |
| instring, | |||
maxMatches = _MAX_INT |
|||
| ) |
Scan the input string for expression matches. Each match will return the
matching tokens, start location, and end location. May be called with optional
maxMatches argument, to clip scanning after 'n' matches are found.
Note that the start and end locations are reported relative to the string
being parsed. See L{I{parseString}<parseString>} for more information on parsing
strings with embedded tabs.
Definition at line 1080 of file pyparsing.py.
| def pyparsing.ParserElement.searchString | ( | self, | |
| instring, | |||
maxMatches = _MAX_INT |
|||
| ) |
Another extension to scanString, simplifying the access to the tokens found to match the given parse expression. May be called with optional maxMatches argument, to clip searching after 'n' matches are found.
Definition at line 1143 of file pyparsing.py.
| def pyparsing.ParserElement.setBreak | ( | self, | |
breakFlag = True |
|||
| ) |
Method to invoke the Python pdb debugger when this element is about to be parsed. Set breakFlag to True to enable, False to disable.
Definition at line 729 of file pyparsing.py.
| def pyparsing.ParserElement.setDebug | ( | self, | |
flag = True |
|||
| ) |
Enable display of debugging messages while doing pattern matching. Set flag to True to enable, False to disable.
Definition at line 1366 of file pyparsing.py.
| def pyparsing.ParserElement.setDebugActions | ( | self, | |
| startAction, | |||
| successAction, | |||
| exceptionAction | |||
| ) |
Enable display of debugging messages while doing pattern matching.
Definition at line 1358 of file pyparsing.py.
| def pyparsing.ParserElement.setDefaultWhitespaceChars | ( | chars | ) |
Overrides the default whitespace chars
Definition at line 670 of file pyparsing.py.
| def pyparsing.ParserElement.setFailAction | ( | self, | |
| fn | |||
| ) |
Define action to perform if parsing fails at this expression.
Fail acton fn is a callable function that takes the arguments
fn(s,loc,expr,err) where:
- s = string being parsed
- loc = location where expression match was attempted and failed
- expr = the parse expression that failed
- err = the exception thrown
The function returns no value. It may throw ParseFatalException
if it is desired to stop parsing immediately.
Definition at line 868 of file pyparsing.py.
| def pyparsing.ParserElement.setName | ( | self, | |
| name | |||
| ) |
Define name for this expression, for use in debugging.
Definition at line 709 of file pyparsing.py.
| def pyparsing.ParserElement.setParseAction | ( | self, | |
| fns, | |||
| kwargs | |||
| ) |
Define action to perform when successfully matching parse element definition.
Parse action fn is a callable method with 0-3 arguments, called as fn(s,loc,toks),
fn(loc,toks), fn(toks), or just fn(), where:
- s = the original string being parsed (see note below)
- loc = the location of the matching substring
- toks = a list of the matched tokens, packaged as a ParseResults object
If the functions in fns modify the tokens, they can return them as the return
value from fn, and the modified list of tokens will replace the original.
Otherwise, fn does not need to return any value.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{parseString}<parseString>} for more information
on parsing strings containing <TAB>s, and suggested methods to maintain a
consistent view of the parsed string, the parse location, and line and column
positions within the parsed string.
Definition at line 841 of file pyparsing.py.
| def pyparsing.ParserElement.setResultsName | ( | self, | |
| name, | |||
listAllMatches = False |
|||
| ) |
Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original ParserElement object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names.
Definition at line 717 of file pyparsing.py.
| def pyparsing.ParserElement.setWhitespaceChars | ( | self, | |
| chars | |||
| ) |
| def pyparsing.ParserElement.streamline | ( | self | ) |
Definition at line 1381 of file pyparsing.py.
| def pyparsing.ParserElement.suppress | ( | self | ) |
Suppresses the output of this ParserElement; useful to keep punctuation from cluttering up returned output.
Definition at line 1317 of file pyparsing.py.
| def pyparsing.ParserElement.transformString | ( | self, | |
| instring | |||
| ) |
Extension to scanString, to modify matching text with modified tokens that may be returned from a parse action. To use transformString, define a grammar and attach a parse action to it that modifies the returned token list. Invoking transformString() on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. transformString() returns the resulting transformed string.
Definition at line 1115 of file pyparsing.py.
| def pyparsing.ParserElement.tryParse | ( | self, | |
| instring, | |||
| loc | |||
| ) |
Definition at line 985 of file pyparsing.py.
| def pyparsing.ParserElement.validate | ( | self, | |
validateTrace = [] |
|||
| ) |
Check defined expressions for valid structure, check for infinite recursive definitions.
Definition at line 1389 of file pyparsing.py.
|
private |
Definition at line 1422 of file pyparsing.py.
|
staticprivate |
Definition at line 1012 of file pyparsing.py.
|
staticprivate |
Definition at line 839 of file pyparsing.py.
|
staticprivate |
Definition at line 1017 of file pyparsing.py.
|
staticprivate |
Definition at line 1009 of file pyparsing.py.
| pyparsing.ParserElement.callDuringTry |
Definition at line 697 of file pyparsing.py.
| pyparsing.ParserElement.callPreparse |
Definition at line 696 of file pyparsing.py.
| pyparsing.ParserElement.copyDefaultWhiteChars |
Definition at line 685 of file pyparsing.py.
| pyparsing.ParserElement.debug |
Definition at line 689 of file pyparsing.py.
| pyparsing.ParserElement.debugActions |
Definition at line 694 of file pyparsing.py.
|
static |
Definition at line 668 of file pyparsing.py.
|
static |
Definition at line 1037 of file pyparsing.py.
| pyparsing.ParserElement.errmsg |
Definition at line 692 of file pyparsing.py.
| pyparsing.ParserElement.failAction |
Definition at line 678 of file pyparsing.py.
| pyparsing.ParserElement.ignoreExprs |
Definition at line 688 of file pyparsing.py.
| pyparsing.ParserElement.keepTabs |
Definition at line 687 of file pyparsing.py.
| pyparsing.ParserElement.mayIndexError |
Definition at line 691 of file pyparsing.py.
| pyparsing.ParserElement.mayReturnEmpty |
Definition at line 686 of file pyparsing.py.
| pyparsing.ParserElement.modalResults |
Definition at line 693 of file pyparsing.py.
| pyparsing.ParserElement.myException |
Definition at line 1415 of file pyparsing.py.
| pyparsing.ParserElement.name |
Definition at line 711 of file pyparsing.py.
| pyparsing.ParserElement.parseAction |
Definition at line 677 of file pyparsing.py.
| pyparsing.ParserElement.re |
Definition at line 695 of file pyparsing.py.
|
static |
Definition at line 1015 of file pyparsing.py.
| pyparsing.ParserElement.resultsName |
Definition at line 681 of file pyparsing.py.
| pyparsing.ParserElement.saveAsList |
Definition at line 682 of file pyparsing.py.
|
static |
Definition at line 674 of file pyparsing.py.
| pyparsing.ParserElement.skipWhitespace |
Definition at line 683 of file pyparsing.py.
| pyparsing.ParserElement.streamlined |
Definition at line 690 of file pyparsing.py.
| pyparsing.ParserElement.strRepr |
Definition at line 680 of file pyparsing.py.
| pyparsing.ParserElement.whiteChars |
Definition at line 684 of file pyparsing.py.