| # 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 | Static Public Attributes | List of all members
pyparsing.White Class Reference
Inheritance diagram for pyparsing.White:
[legend]
Collaboration diagram for pyparsing.White:
[legend]

## Public Member Functions
def | __init__
def | parseImpl
Public Member Functions inherited from pyparsing.Token
def | __init__
def | setName
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
| matchWhite
| name
| mayReturnEmpty
| errmsg
| minLen
| maxLen
Public Attributes inherited from pyparsing.Token
| errmsg
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

## Static Public Attributes
dictionary | whiteStrs

## Detailed Description

    Special matching class for matching whitespace.  Normally, whitespace is ignored
       by pyparsing grammars.  This class is included when some whitespace structures
       are significant.  Define with a string containing the whitespace characters to be
       matched; default is " \\t\\r\\n".  Also takes optional min, max, and exact arguments,
       as defined for the Word class.

Definition at line 1986 of file pyparsing.py.

## Constructor & Destructor Documentation

def pyparsing.White.__init__ | ( |  | self,
|  |  | ws = `" \t\r\n"`,
|  |  | min = `1`,
|  |  | max = `0`,
|  |  | exact = `0`
| ) |  |

Definition at line 1999 of file pyparsing.py.

1999
2000 def __init__(self, ws=" \t\r\n", min=1, max=0, exact=0):
2001 super(White,self).__init__()
2002 self.matchWhite = ws
2003 self.setWhitespaceChars( "".join([c for c in self.whiteChars if c not in self.matchWhite]) )
2004 #~ self.leaveWhitespace()
2005 self.name = ("".join([White.whiteStrs[c] for c in self.matchWhite]))
2006 self.mayReturnEmpty = True
2007 self.errmsg = "Expected " + self.name
2008 #self.myException.msg = self.errmsg
2009
2010 self.minLen = min
2011
2012 if max > 0:
2013 self.maxLen = max
2014 else:
2015 self.maxLen = _MAX_INT
2016
2017 if exact > 0:
2018 self.maxLen = exact
2019 self.minLen = exact

## Member Function Documentation

def pyparsing.White.parseImpl | ( |  | self,
|  |  | instring,
|  |  | loc,
|  |  | doActions = `True`
| ) |  |

Definition at line 2020 of file pyparsing.py.

2020
2021 def parseImpl( self, instring, loc, doActions=True ):
2022 if not(instring[ loc ] in self.matchWhite):
2023 #~ raise ParseException( instring, loc, self.errmsg )
2024 exc = self.myException
2025 exc.loc = loc
2026 exc.pstr = instring
2027 raise exc
2028 start = loc
2029 loc += 1
2030 maxloc = start + self.maxLen
2031 maxloc = min( maxloc, len(instring) )
2032 while loc < maxloc and instring[loc] in self.matchWhite:
2033 loc += 1
2034
2035 if loc - start < self.minLen:
2036 #~ raise ParseException( instring, loc, self.errmsg )
2037 exc = self.myException
2038 exc.loc = loc
2039 exc.pstr = instring
2040 raise exc
2041
2042 return loc, instring[start:loc]
2043

## Member Data Documentation

pyparsing.White.errmsg

Definition at line 2006 of file pyparsing.py.

pyparsing.White.matchWhite

Definition at line 2001 of file pyparsing.py.

pyparsing.White.maxLen

Definition at line 2012 of file pyparsing.py.

pyparsing.White.mayReturnEmpty

Definition at line 2005 of file pyparsing.py.

pyparsing.White.minLen

Definition at line 2009 of file pyparsing.py.

pyparsing.White.name

Definition at line 2004 of file pyparsing.py.

dictionary pyparsing.White.whiteStrs
| static

Initial value:
1 {
2 " " : "<SPC>",
3 "\t": "<TAB>",
4 "\n": "<LF>",
5 "\r": "<CR>",
6 "\f": "<FF>",
7 }

Definition at line 1992 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