Gaudi Framework, version v23r9

Home   Generated: Thu Jul 18 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.Regex Class Reference
Inheritance diagram for pyparsing.Regex:
Inheritance graph
[legend]
Collaboration diagram for pyparsing.Regex:
Collaboration graph
[legend]

Public Member Functions

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

 pattern
 
 flags
 
 re
 
 reString
 
 name
 
 errmsg
 
 mayIndexError
 
 mayReturnEmpty
 
 strRepr
 
- 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
 

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

Token for matching strings that match a given regular expression.
   Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module.

Definition at line 1742 of file pyparsing.py.

Constructor & Destructor Documentation

def pyparsing.Regex.__init__ (   self,
  pattern,
  flags = 0 
)
The parameters pattern and flags are passed to the re.compile() function as-is. See the Python re module for an explanation of the acceptable patterns and flags.

Definition at line 1746 of file pyparsing.py.

1747  def __init__( self, pattern, flags=0):
1748  """The parameters pattern and flags are passed to the re.compile() function as-is. See the Python re module for an explanation of the acceptable patterns and flags."""
1749  super(Regex,self).__init__()
1750 
1751  if len(pattern) == 0:
1752  warnings.warn("null string passed to Regex; use Empty() instead",
1753  SyntaxWarning, stacklevel=2)
1755  self.pattern = pattern
1756  self.flags = flags
1757 
1758  try:
1759  self.re = re.compile(self.pattern, self.flags)
1760  self.reString = self.pattern
1761  except sre_constants.error:
1762  warnings.warn("invalid pattern (%s) passed to Regex" % pattern,
1763  SyntaxWarning, stacklevel=2)
1764  raise
1766  self.name = _ustr(self)
1767  self.errmsg = "Expected " + self.name
1768  #self.myException.msg = self.errmsg
1769  self.mayIndexError = False
1770  self.mayReturnEmpty = True

Member Function Documentation

def pyparsing.Regex.__str__ (   self)

Definition at line 1787 of file pyparsing.py.

1788  def __str__( self ):
1789  try:
1790  return super(Regex,self).__str__()
1791  except:
1792  pass
1793 
1794  if self.strRepr is None:
1795  self.strRepr = "Re:(%s)" % repr(self.pattern)
1796 
1797  return self.strRepr
1798 
def pyparsing.Regex.parseImpl (   self,
  instring,
  loc,
  doActions = True 
)

Definition at line 1771 of file pyparsing.py.

1772  def parseImpl( self, instring, loc, doActions=True ):
1773  result = self.re.match(instring,loc)
1774  if not result:
1775  exc = self.myException
1776  exc.loc = loc
1777  exc.pstr = instring
1778  raise exc
1779 
1780  loc = result.end()
1781  d = result.groupdict()
1782  ret = ParseResults(result.group())
1783  if d:
1784  for k in d:
1785  ret[k] = d[k]
1786  return loc,ret

Member Data Documentation

pyparsing.Regex.errmsg

Definition at line 1766 of file pyparsing.py.

pyparsing.Regex.flags

Definition at line 1755 of file pyparsing.py.

pyparsing.Regex.mayIndexError

Definition at line 1768 of file pyparsing.py.

pyparsing.Regex.mayReturnEmpty

Definition at line 1769 of file pyparsing.py.

pyparsing.Regex.name

Definition at line 1765 of file pyparsing.py.

pyparsing.Regex.pattern

Definition at line 1754 of file pyparsing.py.

pyparsing.Regex.re

Definition at line 1758 of file pyparsing.py.

pyparsing.Regex.reString

Definition at line 1759 of file pyparsing.py.

pyparsing.Regex.strRepr

Definition at line 1794 of file pyparsing.py.


The documentation for this class was generated from the following file:
Generated at Thu Jul 18 2013 12:18:16 for Gaudi Framework, version v23r9 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004