| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
pyparsing.Dict Class Reference
Inheritance diagram for pyparsing.Dict:
[legend]
Collaboration diagram for pyparsing.Dict:
[legend]

## Public Member Functions
def | __init__
def | postParse
Public Member Functions inherited from pyparsing.TokenConverter
def | __init__
Public Member Functions inherited from pyparsing.ParseElementEnhance
def | __init__
def | parseImpl
def | leaveWhitespace
def | ignore
def | streamline
def | checkRecursion
def | validate
def | __str__
Public Member Functions inherited from pyparsing.ParserElement
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__

## Public Attributes
| saveAsList
Public Attributes inherited from pyparsing.TokenConverter
| saveAsList
Public Attributes inherited from pyparsing.ParseElementEnhance
| expr
| strRepr
| mayIndexError
| mayReturnEmpty
| skipWhitespace
| saveAsList
| callPreparse
Public Attributes inherited from pyparsing.ParserElement
| parseAction
| failAction
| strRepr
| resultsName
| saveAsList
| skipWhitespace
| whiteChars
| copyDefaultWhiteChars
| mayReturnEmpty
| keepTabs
| ignoreExprs
| debug
| streamlined
| mayIndexError
| errmsg
| modalResults
| debugActions
| re
| callPreparse
| callDuringTry
| name
| myException

## Additional Inherited Members
Static Public Attributes inherited from pyparsing.ParserElement
string | DEFAULT_WHITE_CHARS " \n\t\r"
tuple | setDefaultWhitespaceChars staticmethod(setDefaultWhitespaceChars)
tuple | resetCache staticmethod(resetCache)
tuple | enablePackrat staticmethod(enablePackrat)

## Detailed Description

    Converter to return a repetitive expression as a list, but also as a dictionary.
       Each element can also be referenced using the first token in the expression as its key.
       Useful for tabular report scraping when the first column can be used as a item key.

Definition at line 3022 of file pyparsing.py.

## Constructor & Destructor Documentation

def pyparsing.Dict.__init__ | ( |  | self,
|  |  | exprs
| ) |  |

Definition at line 3027 of file pyparsing.py.

3027
3028 def __init__( self, exprs ):
3029 super(Dict,self).__init__( exprs )
3030 self.saveAsList = True

## Member Function Documentation

def pyparsing.Dict.postParse | ( |  | self,
|  |  | instring,
|  |  | loc,
|  |  | tokenlist
| ) |  |

Definition at line 3031 of file pyparsing.py.

3031
3032 def postParse( self, instring, loc, tokenlist ):
3033 for i,tok in enumerate(tokenlist):
3034 if len(tok) == 0:
3035 continue
3036 ikey = tok[0]
3037 if isinstance(ikey,int):
3038 ikey = _ustr(tok[0]).strip()
3039 if len(tok)==1:
3040 tokenlist[ikey] = _ParseResultsWithOffset("",i)
3041 elif len(tok)==2 and not isinstance(tok[1],ParseResults):
3042 tokenlist[ikey] = _ParseResultsWithOffset(tok[1],i)
3043 else:
3044 dictvalue = tok.copy() #ParseResults(i)
3045 del dictvalue[0]
3046 if len(dictvalue)!= 1 or (isinstance(dictvalue,ParseResults) and dictvalue.keys()):
3047 tokenlist[ikey] = _ParseResultsWithOffset(dictvalue,i)
3048 else:
3049 tokenlist[ikey] = _ParseResultsWithOffset(dictvalue[0],i)
3050
3051 if self.resultsName:
3052 return [ tokenlist ]
3053 else:
3054 return tokenlist
3055

## Member Data Documentation

pyparsing.Dict.saveAsList

Definition at line 3029 of file pyparsing.py.

The documentation for this class was generated from the following file:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/cmake/cmt2cmake/pyparsing.py