Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
pyparsing.Optional Class Reference
Inheritance diagram for pyparsing.Optional:
Inheritance graph
[legend]
Collaboration diagram for pyparsing.Optional:
Collaboration graph
[legend]

Public Member Functions

def __init__
 
def parseImpl
 
def __str__
 
- 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

 defaultValue
 
 mayReturnEmpty
 
 strRepr
 
- 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

Optional matching of the given expression.
   A default return string can also be specified, if the optional expression
   is not found.

Definition at line 2789 of file pyparsing.py.

Constructor & Destructor Documentation

def pyparsing.Optional.__init__ (   self,
  exprs,
  default = _optionalNotMatched 
)

Definition at line 2794 of file pyparsing.py.

2795  def __init__( self, exprs, default=_optionalNotMatched ):
2796  super(Optional,self).__init__( exprs, savelist=False )
2797  self.defaultValue = default
2798  self.mayReturnEmpty = True

Member Function Documentation

def pyparsing.Optional.__str__ (   self)

Definition at line 2813 of file pyparsing.py.

2814  def __str__( self ):
2815  if hasattr(self,"name"):
2816  return self.name
2817 
2818  if self.strRepr is None:
2819  self.strRepr = "[" + _ustr(self.expr) + "]"
2820 
2821  return self.strRepr
2822 
def pyparsing.Optional.parseImpl (   self,
  instring,
  loc,
  doActions = True 
)

Definition at line 2799 of file pyparsing.py.

2800  def parseImpl( self, instring, loc, doActions=True ):
2801  try:
2802  loc, tokens = self.expr._parse( instring, loc, doActions, callPreParse=False )
2803  except (ParseException,IndexError):
2804  if self.defaultValue is not _optionalNotMatched:
2805  if self.expr.resultsName:
2806  tokens = ParseResults([ self.defaultValue ])
2807  tokens[self.expr.resultsName] = self.defaultValue
2808  else:
2809  tokens = [ self.defaultValue ]
2810  else:
2811  tokens = []
2812  return loc, tokens

Member Data Documentation

pyparsing.Optional.defaultValue

Definition at line 2796 of file pyparsing.py.

pyparsing.Optional.mayReturnEmpty

Definition at line 2797 of file pyparsing.py.

pyparsing.Optional.strRepr

Definition at line 2818 of file pyparsing.py.


The documentation for this class was generated from the following file:
Generated at Wed Dec 4 2013 14:33:24 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004