parserFwk.pyparsing.ParseResults

Package parserFwk :: Module pyparsing :: Class ParseResults |
[frames | no frames]

## Type ParseResults

    object --+
             |
            ParseResults

Structured parse results, to provide multiple means of access to the parsed data:

- as a list (len(results))
- by list index (results[0], results[1], etc.)
- by attribute (results.<resultsName>)

Method Summary
| `__init__(self, toklist, name, asList, modal)`
| `__add__(self, other)`
| `__bool__(self)`
| `__contains__(self, k)`
| `__delitem__(self, i)`
| `__getattr__(self, name)`
| `__getitem__(self, i)`
| `__getstate__(self)`
| `__iadd__(self, other)`
| `__iter__(self)`
| `__len__(self)`
| `__new__(cls, toklist, name, asList, modal)` (Static method)
| `__nonzero__(self)`
| `__repr__(self)`
| `__setitem__(self, k, v)`
| `__setstate__(self, state)`
| `__str__(self)`
| ``asDict`(self)` Returns the named parse results as dictionary.
| ``asList`(self)` Returns the parse results as a nested list of matching tokens, all converted to strings.
| ``asXML`(self, doctag, namedItemsOnly, indent, formatted)` Returns the parse results as XML.
| ``copy`(self)` Returns a new copy of a ParseResults object.
| ``dump`(self, indent, depth)` Diagnostic method for listing out the contents of a ParseResults.
| ``getName`(self)` Returns the results name for this token expression.
| ``items`(self)` Returns all named result keys and values as a list of tuples.
| ``keys`(self)` Returns all named result keys.
| ``values`(self)` Returns all named result values.
Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Class Variable Summary
`tuple` | `__slots__` = `('__toklist', '__tokdict', '__doinit', '__na...`

Instance Method Details

### asDict(self) Returns the named parse results as dictionary.

### asList(self) Returns the parse results as a nested list of matching tokens, all converted to strings.

### asXML(self, doctag=None, namedItemsOnly=False, indent='', formatted=True) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.

### copy(self) Returns a new copy of a ParseResults object.

### dump(self, indent='', depth=0) Diagnostic method for listing out the contents of a ParseResults. Accepts an optional indent argument so that this string can be embedded in a nested display of other data.

### getName(self) Returns the results name for this token expression.

### items(self) Returns all named result keys and values as a list of tuples.

### keys(self) Returns all named result keys.

### values(self) Returns all named result values.

Class Variable Details

    ### __slots__ Type: `tuple` Value:
        ('__toklist',
         '__tokdict',
         '__doinit',
         '__name',
         '__parent',
         '__accumNames',
         '__weakref__')

Generated by Epydoc 2.1 on Sun Oct 07 01:31:52 2007 | http://epydoc.sf.net