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

 skipWhitespace
 
 notChars
 
 minLen
 
 maxLen
 
 name
 
 errmsg
 
 mayReturnEmpty
 
 mayIndexError
 
 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 words composed of characters *not* in a given set.
   Defined with string containing all disallowed characters, and an optional
   minimum, maximum, and/or exact length.  The default value for min is 1 (a
   minimum value < 1 is not valid); the default values for max and exact
   are 0, meaning no maximum or exact length restriction.

Definition at line 1915 of file pyparsing.py.

Constructor & Destructor Documentation

def pyparsing.CharsNotIn.__init__ (   self,
  notChars,
  min = 1,
  max = 0,
  exact = 0 
)

Definition at line 1922 of file pyparsing.py.

1923  def __init__( self, notChars, min=1, max=0, exact=0 ):
1924  super(CharsNotIn,self).__init__()
1925  self.skipWhitespace = False
1926  self.notChars = notChars
1927 
1928  if min < 1:
1929  raise ValueError("cannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permitted")
1931  self.minLen = min
1932 
1933  if max > 0:
1934  self.maxLen = max
1935  else:
1936  self.maxLen = _MAX_INT
1937 
1938  if exact > 0:
1939  self.maxLen = exact
1940  self.minLen = exact
1942  self.name = _ustr(self)
1943  self.errmsg = "Expected " + self.name
1944  self.mayReturnEmpty = ( self.minLen == 0 )
1945  #self.myException.msg = self.errmsg
1946  self.mayIndexError = False

Member Function Documentation

def pyparsing.CharsNotIn.__str__ (   self)

Definition at line 1972 of file pyparsing.py.

1973  def __str__( self ):
1974  try:
1975  return super(CharsNotIn, self).__str__()
1976  except:
1977  pass
1978 
1979  if self.strRepr is None:
1980  if len(self.notChars) > 4:
1981  self.strRepr = "!W:(%s...)" % self.notChars[:4]
1982  else:
1983  self.strRepr = "!W:(%s)" % self.notChars
1984 
1985  return self.strRepr
def pyparsing.CharsNotIn.parseImpl (   self,
  instring,
  loc,
  doActions = True 
)

Definition at line 1947 of file pyparsing.py.

1948  def parseImpl( self, instring, loc, doActions=True ):
1949  if instring[loc] in self.notChars:
1950  #~ raise ParseException( instring, loc, self.errmsg )
1951  exc = self.myException
1952  exc.loc = loc
1953  exc.pstr = instring
1954  raise exc
1955 
1956  start = loc
1957  loc += 1
1958  notchars = self.notChars
1959  maxlen = min( start+self.maxLen, len(instring) )
1960  while loc < maxlen and \
1961  (instring[loc] not in notchars):
1962  loc += 1
1963 
1964  if loc - start < self.minLen:
1965  #~ raise ParseException( instring, loc, self.errmsg )
1966  exc = self.myException
1967  exc.loc = loc
1968  exc.pstr = instring
1969  raise exc
1970 
1971  return loc, instring[start:loc]

Member Data Documentation

pyparsing.CharsNotIn.errmsg

Definition at line 1942 of file pyparsing.py.

pyparsing.CharsNotIn.maxLen

Definition at line 1933 of file pyparsing.py.

pyparsing.CharsNotIn.mayIndexError

Definition at line 1945 of file pyparsing.py.

pyparsing.CharsNotIn.mayReturnEmpty

Definition at line 1943 of file pyparsing.py.

pyparsing.CharsNotIn.minLen

Definition at line 1930 of file pyparsing.py.

pyparsing.CharsNotIn.name

Definition at line 1941 of file pyparsing.py.

pyparsing.CharsNotIn.notChars

Definition at line 1925 of file pyparsing.py.

pyparsing.CharsNotIn.skipWhitespace

Definition at line 1924 of file pyparsing.py.

pyparsing.CharsNotIn.strRepr

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