Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Member Functions
sre_parse.Tokenizer Class Reference

List of all members.

Public Member Functions

def __init__
def match
def get
def tell
def seek

Public Attributes

 string
 index
 next

Private Member Functions

def __next

Detailed Description

Definition at line 178 of file sre_parse.py.


Constructor & Destructor Documentation

def sre_parse.Tokenizer.__init__ (   self,
  string 
)

Definition at line 179 of file sre_parse.py.

00179 
00180     def __init__(self, string):
00181         self.string = string
00182         self.index = 0
        self.__next()

Here is the caller graph for this function:


Member Function Documentation

def sre_parse.Tokenizer.__next (   self) [private]

Definition at line 183 of file sre_parse.py.

00183 
00184     def __next(self):
00185         if self.index >= len(self.string):
00186             self.next = None
00187             return
00188         char = self.string[self.index:self.index+1]
00189         # Special case for the str8, since indexing returns a integer
00190         # XXX This is only needed for test_bug_926075 in test_re.py
00191         if char and isinstance(char, bytes):
00192             char = chr(char[0])
00193         if char == "\\":
00194             try:
00195                 c = self.string[self.index + 1]
00196             except IndexError:
00197                 raise error("bogus escape (end of line)")
00198             if isinstance(self.string, bytes):
00199                 c = chr(c)
00200             char = char + c
00201         self.index = self.index + len(char)
        self.next = char

Here is the caller graph for this function:

def sre_parse.Tokenizer.get (   self)

Definition at line 208 of file sre_parse.py.

00208 
00209     def get(self):
00210         this = self.next
00211         self.__next()
        return this

Here is the call graph for this function:

Here is the caller graph for this function:

def sre_parse.Tokenizer.match (   self,
  char,
  skip = 1 
)

Definition at line 202 of file sre_parse.py.

00202 
00203     def match(self, char, skip=1):
00204         if char == self.next:
00205             if skip:
00206                 self.__next()
00207             return 1
        return 0

Here is the call graph for this function:

def sre_parse.Tokenizer.seek (   self,
  index 
)

Definition at line 214 of file sre_parse.py.

00214 
00215     def seek(self, index):
00216         self.index, self.next = index

Here is the caller graph for this function:

def sre_parse.Tokenizer.tell (   self)

Definition at line 212 of file sre_parse.py.

00212 
00213     def tell(self):
        return self.index, self.next

Member Data Documentation

Definition at line 181 of file sre_parse.py.

Definition at line 185 of file sre_parse.py.

Definition at line 180 of file sre_parse.py.


The documentation for this class was generated from the following file: