|
Gaudi Framework, version v23r6 |
| Home | Generated: Wed Jan 30 2013 |
Classes | |
| class | _Constants |
| class | ParseBaseException |
| class | ParseException |
| class | ParseFatalException |
| class | ParseSyntaxException |
| class | RecursiveGrammarException |
| class | _ParseResultsWithOffset |
| class | ParseResults |
| class | ParserElement |
| class | Token |
| class | Empty |
| class | NoMatch |
| class | Literal |
| class | Keyword |
| class | CaselessLiteral |
| class | CaselessKeyword |
| class | Word |
| class | Regex |
| class | QuotedString |
| class | CharsNotIn |
| class | White |
| class | _PositionToken |
| class | GoToColumn |
| class | LineStart |
| class | LineEnd |
| class | StringStart |
| class | StringEnd |
| class | WordStart |
| class | WordEnd |
| class | ParseExpression |
| class | And |
| class | Or |
| class | MatchFirst |
| class | Each |
| class | ParseElementEnhance |
| class | FollowedBy |
| class | NotAny |
| class | ZeroOrMore |
| class | OneOrMore |
| class | _NullToken |
| class | Optional |
| class | SkipTo |
| class | Forward |
| class | _ForwardNoRecurse |
| class | TokenConverter |
| class | Upcase |
| class | Combine |
| class | Group |
| class | Dict |
| class | Suppress |
| class | OnlyOnce |
Functions | |
| def | _ustr |
| def | _str2dict |
| def | _xml_escape |
| def | col |
| def | lineno |
| def | line |
| def | _defaultStartDebugAction |
| def | _defaultSuccessDebugAction |
| def | _defaultExceptionDebugAction |
| def | nullDebugAction |
| def | traceParseAction |
| def | delimitedList |
| def | countedArray |
| def | _flatten |
| def | matchPreviousLiteral |
| def | matchPreviousExpr |
| def | _escapeRegexRangeChars |
| def | oneOf |
| def | dictOf |
| def | originalTextFor |
| def | srange |
| def | matchOnlyAtCol |
| def | replaceWith |
| def | removeQuotes |
| def | upcaseTokens |
| def | downcaseTokens |
| def | keepOriginalText |
| def | getTokensEndLoc |
| def | _makeTags |
| def | makeHTMLTags |
| def | makeXMLTags |
| def | withAttribute |
| def | operatorPrecedence |
|
private |
Definition at line 659 of file pyparsing.py.
|
private |
Definition at line 653 of file pyparsing.py.
|
private |
Definition at line 656 of file pyparsing.py.
|
private |
Definition at line 3189 of file pyparsing.py.
|
private |
|
private |
Internal helper to construct opening and closing tag expressions, given a tag name
Definition at line 3390 of file pyparsing.py.
|
private |
Definition at line 139 of file pyparsing.py.
|
private |
Drop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >.
Definition at line 108 of file pyparsing.py.
|
private |
| def pyparsing.col | ( | loc, | |
| strg | |||
| ) |
Returns current column within a string, counting newlines as line separators.
The first column is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.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 619 of file pyparsing.py.
| def pyparsing.countedArray | ( | expr | ) |
Helper to define a counted list of expressions.
This helper defines a pattern of the form::
integer expr expr expr...
where the leading integer tells how many expr expressions follow.
The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.
Definition at line 3118 of file pyparsing.py.
| def pyparsing.delimitedList | ( | expr, | |
delim = ", |
|||
combine = False |
|||
| ) |
Helper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing 'combine=True' in the constructor. If combine is set to True, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed.
Definition at line 3104 of file pyparsing.py.
| def pyparsing.dictOf | ( | key, | |
| value | |||
| ) |
Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the Dict, ZeroOrMore, and Group tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the Dict results can include named token fields.
Definition at line 3256 of file pyparsing.py.
| def pyparsing.downcaseTokens | ( | s, | |
| l, | |||
| t | |||
| ) |
| def pyparsing.getTokensEndLoc | ( | ) |
Method to be called from within a parse action to determine the end location of the parsed tokens.
Definition at line 3374 of file pyparsing.py.
| def pyparsing.keepOriginalText | ( | s, | |
| startLoc, | |||
| t | |||
| ) |
Helper parse action to preserve original parsed text, overriding any nested parse actions.
Definition at line 3363 of file pyparsing.py.
| def pyparsing.line | ( | loc, | |
| strg | |||
| ) |
Returns the line of text containing loc within a string, counting newlines as line separators.
Definition at line 643 of file pyparsing.py.
| def pyparsing.lineno | ( | loc, | |
| strg | |||
| ) |
Returns current line number within a string, counting newlines as line separators.
The first line is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.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 631 of file pyparsing.py.
| def pyparsing.makeHTMLTags | ( | tagStr | ) |
Helper to construct opening and closing tag expressions for HTML, given a tag name
Definition at line 3418 of file pyparsing.py.
| def pyparsing.makeXMLTags | ( | tagStr | ) |
Helper to construct opening and closing tag expressions for XML, given a tag name
Definition at line 3422 of file pyparsing.py.
| def pyparsing.matchOnlyAtCol | ( | n | ) |
Helper method for defining parse actions that require matching at a specific column in the input text.
Definition at line 3331 of file pyparsing.py.
| def pyparsing.matchPreviousExpr | ( | expr | ) |
Helper to define an expression that is indirectly defined from
the tokens matched in a previous expression, that is, it looks
for a 'repeat' of a previous expression. For example::
first = Word(nums)
second = matchPreviousExpr(first)
matchExpr = first + ":" + second
will match "1:1", but not "1:2". Because this matches by
expressions, will *not* match the leading "1:1" in "1:10";
the expressions are evaluated first, and then compared, so
"1" is compared with "10".
Do *not* use with packrat parsing enabled.
Definition at line 3163 of file pyparsing.py.
| def pyparsing.matchPreviousLiteral | ( | expr | ) |
Helper to define an expression that is indirectly defined from
the tokens matched in a previous expression, that is, it looks
for a 'repeat' of a previous expression. For example::
first = Word(nums)
second = matchPreviousLiteral(first)
matchExpr = first + ":" + second
will match "1:1", but not "1:2". Because this matches a
previous literal, will also match the leading "1:1" in "1:10".
If this is not desired, use matchPreviousExpr.
Do *not* use with packrat parsing enabled.
Definition at line 3137 of file pyparsing.py.
| def pyparsing.nullDebugAction | ( | args | ) |
'Do-nothing' debug action, to suppress debugging output during parsing.
Definition at line 662 of file pyparsing.py.
| def pyparsing.oneOf | ( | strs, | |
caseless = False, |
|||
useRegex = True |
|||
| ) |
Helper to quickly define a set of alternative Literals, and makes sure to do
longest-first testing when there is a conflict, regardless of the input order,
but returns a MatchFirst for best performance.
Parameters:
- strs - a string of space-delimited literals, or a list of string literals
- caseless - (default=False) - treat all literals as caseless
- useRegex - (default=True) - as an optimization, will generate a Regex
object; otherwise, will generate a MatchFirst object (if caseless=True, or
if creating a Regex raises an exception)
Definition at line 3197 of file pyparsing.py.
| def pyparsing.operatorPrecedence | ( | baseExpr, | |
| opList | |||
| ) |
Helper method for constructing grammars of expressions made up of
operators working in a precedence hierarchy. Operators may be unary or
binary, left- or right-associative. Parse actions can also be attached
to operator expressions.
Parameters:
- baseExpr - expression representing the most basic element for the nested
- opList - list of tuples, one for each operator precedence level in the
expression grammar; each tuple is of the form
(opExpr, numTerms, rightLeftAssoc, parseAction), where:
- opExpr is the pyparsing expression for the operator;
may also be a string, which will be converted to a Literal;
if numTerms is 3, opExpr is a tuple of two expressions, for the
two operators separating the 3 terms
- numTerms is the number of terms for this operator (must
be 1, 2, or 3)
- rightLeftAssoc is the indicator whether the operator is
right or left associative, using the pyparsing-defined
constants opAssoc.RIGHT and opAssoc.LEFT.
- parseAction is the parse action to be associated with
expressions matching this operator expression (the
parse action tuple member may be omitted)
Definition at line 3461 of file pyparsing.py.
| def pyparsing.originalTextFor | ( | expr, | |
asString = True |
|||
| ) |
Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. Simpler to use than the parse action keepOriginalText, and does not require the inspect module to chase up the call stack. By default, returns a string containing the original parsed text. If the optional asString argument is passed as False, then the return value is a ParseResults containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to originalTextFor contains expressions with defined results names, you must set asString to False if you want to preserve those results name values.
Definition at line 3266 of file pyparsing.py.
| def pyparsing.removeQuotes | ( | s, | |
| l, | |||
| t | |||
| ) |
Helper parse action for removing quotation marks from parsed quoted strings.
To use, add this parse action to quoted string using::
quotedString.setParseAction( removeQuotes )
Definition at line 3348 of file pyparsing.py.
| def pyparsing.replaceWith | ( | replStr | ) |
Helper method for common parse actions that simply return a literal value. Especially useful when used with transformString().
Definition at line 3340 of file pyparsing.py.
| def pyparsing.srange | ( | s | ) |
Definition at line 3310 of file pyparsing.py.
| def pyparsing.traceParseAction | ( | f | ) |
| def pyparsing.upcaseTokens | ( | s, | |
| l, | |||
| t | |||
| ) |
| def pyparsing.withAttribute | ( | args, | |
| attrDict | |||
| ) |
Helper to create a validating parse action to be used with start tags created
with makeXMLTags or makeHTMLTags. Use withAttribute to qualify a starting tag
with a required attribute value, to avoid false matches on common tags such as
<TD> or <DIV>.
Call withAttribute with a series of attribute names and values. Specify the list
of filter attributes names and values as:
- keyword arguments, as in (class="Customer",align="right"), or
- a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") )
For attribute names with a namespace prefix, you must use the second form. Attribute
names are matched insensitive to upper/lower case.
To verify that the attribute exists, but without specifying a value, pass
withAttribute.ANY_VALUE as the value.
Definition at line 3426 of file pyparsing.py.
| list pyparsing.__all__ |
Definition at line 74 of file pyparsing.py.
| string pyparsing.__author__ "Paul McGuire <ptmcg@users.sourceforge.net>" |
Definition at line 63 of file pyparsing.py.
| pyparsing.__doc__ \ |
Definition at line 26 of file pyparsing.py.
| string pyparsing.__version__ "1.5.2" |
Definition at line 61 of file pyparsing.py.
| string pyparsing.__versionTime__ "17 February 2009 19:45" |
Definition at line 62 of file pyparsing.py.
| tuple pyparsing._bslash chr(92) |
Definition at line 164 of file pyparsing.py.
| tuple pyparsing._charRange Group(_singleChar + Suppress("-") + _singleChar) |
Definition at line 3305 of file pyparsing.py.
Definition at line 3302 of file pyparsing.py.
Definition at line 3303 of file pyparsing.py.
Definition at line 3300 of file pyparsing.py.
| tuple pyparsing._expanded lambdap:(isinstance(p,ParseResults) and ''.join([ unichr(c) for c in range(ord(p[0]),ord(p[1])+1) ]) or p) |
Definition at line 3308 of file pyparsing.py.
| pyparsing._L Literal |
Definition at line 1515 of file pyparsing.py.
| pyparsing._MAX_INT sys.maxsize |
Definition at line 101 of file pyparsing.py.
| tuple pyparsing._optionalNotMatched _NullToken() |
Definition at line 2788 of file pyparsing.py.
| string pyparsing._printables_less_backslash "" |
Definition at line 3301 of file pyparsing.py.
| pyparsing._PY3K True |
Definition at line 100 of file pyparsing.py.
| tuple pyparsing._reBracketExpr Literal("[") |
Definition at line 3306 of file pyparsing.py.
| tuple pyparsing._singleChar _escapedPunc|_escapedHexChar|_escapedOctChar|Word(_printables_less_backslash,exact=1) |
Definition at line 3304 of file pyparsing.py.
| pyparsing._str2dict set |
Definition at line 142 of file pyparsing.py.
| pyparsing._ustr str |
Definition at line 135 of file pyparsing.py.
Definition at line 163 of file pyparsing.py.
| pyparsing.alphas string.lowercase+string.uppercase |
Definition at line 158 of file pyparsing.py.
| pyparsing.basestring str |
Definition at line 102 of file pyparsing.py.
| tuple pyparsing.dblQuotedString Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\x[0-9a-fA-F]+)|(?:\\.)) |
Definition at line 3532 of file pyparsing.py.
| tuple pyparsing.empty Empty() |
Definition at line 3294 of file pyparsing.py.
| string pyparsing.hexnums "ABCDEFabcdef" |
Definition at line 162 of file pyparsing.py.
| tuple pyparsing.lineEnd LineEnd() |
Definition at line 3296 of file pyparsing.py.
| tuple pyparsing.lineStart LineStart() |
Definition at line 3295 of file pyparsing.py.
| pyparsing.nums string.digits |
Definition at line 161 of file pyparsing.py.
| tuple pyparsing.opAssoc _Constants() |
Definition at line 3457 of file pyparsing.py.
| string pyparsing.printables "" |
Definition at line 165 of file pyparsing.py.
| tuple pyparsing.stringEnd StringEnd() |
Definition at line 3298 of file pyparsing.py.
| tuple pyparsing.stringStart StringStart() |
Definition at line 3297 of file pyparsing.py.
| pyparsing.unichr chr |
Definition at line 136 of file pyparsing.py.