| # 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.Or Class Reference
Inheritance diagram for pyparsing.Or:
[legend]
Collaboration diagram for pyparsing.Or:
[legend]

## Public Member Functions
def | __init__
def | parseImpl
def | __ixor__
def | __str__
def | checkRecursion
Public Member Functions inherited from pyparsing.ParseExpression
def | __init__
def | __getitem__
def | append
def | leaveWhitespace
def | ignore
def | __str__
def | streamline
def | setResultsName
def | validate
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
| mayReturnEmpty
| strRepr
Public Attributes inherited from pyparsing.ParseExpression
| exprs
| callPreparse
| strRepr
| skipWhitespace
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

    Requires that at least one ParseExpression is found.
       If two expressions match, the expression that matches the longest string will be used.
       May be constructed using the '^' operator.

Definition at line 2379 of file pyparsing.py.

## Constructor & Destructor Documentation

def pyparsing.Or.__init__ | ( |  | self,
|  |  | exprs,
|  |  | savelist = `False`
| ) |  |

Definition at line 2384 of file pyparsing.py.

2384
2385 def __init__( self, exprs, savelist = False ):
2386 super(Or,self).__init__(exprs, savelist)
2387 self.mayReturnEmpty = False
2388 for e in self.exprs:
2389 if e.mayReturnEmpty:
2390 self.mayReturnEmpty = True
2391 break

## Member Function Documentation

def pyparsing.Or.__ixor__ | ( |  | self,
|  |  | other
| ) |  |

Definition at line 2420 of file pyparsing.py.

2420
2421 def __ixor__(self, other ):
2422 if isinstance( other, basestring ):
2423 other = Literal( other )
2424 return self.append( other ) #Or( [ self, other ] )

def pyparsing.Or.__str__ | ( |  | self | ) |

Definition at line 2425 of file pyparsing.py.

2425
2426 def __str__( self ):
2427 if hasattr(self,"name"):
2428 return self.name
2429
2430 if self.strRepr is None:
2431 self.strRepr = "{" + " ^ ".join( [ _ustr(e) for e in self.exprs ] ) + "}"
2432
2433 return self.strRepr

def pyparsing.Or.checkRecursion | ( |  | self,
|  |  | parseElementList
| ) |  |

Definition at line 2434 of file pyparsing.py.

2434
2435 def checkRecursion( self, parseElementList ):
2436 subRecCheckList = parseElementList[:] + [ self ]
2437 for e in self.exprs:
2438 e.checkRecursion( subRecCheckList )
2439

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

Definition at line 2392 of file pyparsing.py.

2392
2393 def parseImpl( self, instring, loc, doActions=True ):
2394 maxExcLoc = -1
2395 maxMatchLoc = -1
2396 maxException = None
2397 for e in self.exprs:
2398 try:
2399 loc2 = e.tryParse( instring, loc )
2400 except ParseException, err:
2401 if err.loc > maxExcLoc:
2402 maxException = err
2403 maxExcLoc = err.loc
2404 except IndexError:
2405 if len(instring) > maxExcLoc:
2406 maxException = ParseException(instring,len(instring),e.errmsg,self)
2407 maxExcLoc = len(instring)
2408 else:
2409 if loc2 > maxMatchLoc:
2410 maxMatchLoc = loc2
2411 maxMatchExp = e
2412
2413 if maxMatchLoc < 0:
2414 if maxException is not None:
2415 raise maxException
2416 else:
2417 raise ParseException(instring, loc, "no defined alternatives to match", self)
2418
2419 return maxMatchExp._parse( instring, loc, doActions )

## Member Data Documentation

pyparsing.Or.mayReturnEmpty

Definition at line 2386 of file pyparsing.py.

pyparsing.Or.strRepr

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