Back to index

enigmail  1.4.3
Public Member Functions | Private Attributes | Static Private Attributes
xpidl.Location Class Reference

List of all members.

Public Member Functions

def __init__
def __eq__
def resolve
def pointerline
def get
def __str__

Private Attributes

 _lineno
 _lexpos
 _lexdata
 _file
 _colno

Static Private Attributes

 _line = None

Detailed Description

Definition at line 175 of file xpidl.py.


Constructor & Destructor Documentation

def xpidl.Location.__init__ (   self,
  lexer,
  lineno,
  lexpos 
)

Definition at line 178 of file xpidl.py.

00178 
00179     def __init__(self, lexer, lineno, lexpos):
00180         self._lineno = lineno
00181         self._lexpos = lexpos
00182         self._lexdata = lexer.lexdata
00183         self._file = getattr(lexer, 'filename', "<unknown>")


Member Function Documentation

def xpidl.Location.__eq__ (   self,
  other 
)

Definition at line 184 of file xpidl.py.

00184 
00185     def __eq__(self, other):
00186         return self._lexpos == other._lexpos and \
00187                self._file == other._file

def xpidl.Location.__str__ (   self)

Definition at line 209 of file xpidl.py.

00209 
00210     def __str__(self):
00211         self.resolve()
00212         return "%s line %s:%s\n%s\n%s" % (self._file, self._lineno, self._colno,
00213                                           self._line, self.pointerline())

def xpidl.Location.get (   self)

Definition at line 205 of file xpidl.py.

00205 
00206     def get(self):
00207         self.resolve()
00208         return "%s line %s:%s" % (self._file, self._lineno, self._colno)

Definition at line 197 of file xpidl.py.

00197 
00198     def pointerline(self):
00199         def i():
00200             for i in xrange(0, self._colno):
00201                 yield " "
00202             yield "^"
00203 
00204         return "".join(i())

Here is the caller graph for this function:

def xpidl.Location.resolve (   self)

Definition at line 188 of file xpidl.py.

00188 
00189     def resolve(self):
00190         if self._line:
00191             return
00192 
00193         startofline = self._lexdata.rfind('\n', 0, self._lexpos) + 1
00194         endofline = self._lexdata.find('\n', self._lexpos, self._lexpos + 80)
00195         self._line = self._lexdata[startofline:endofline]
00196         self._colno = self._lexpos - startofline

Here is the caller graph for this function:


Member Data Documentation

Definition at line 195 of file xpidl.py.

Definition at line 182 of file xpidl.py.

Definition at line 181 of file xpidl.py.

Definition at line 180 of file xpidl.py.

xpidl.Location._line = None [static, private]

Definition at line 176 of file xpidl.py.

Definition at line 179 of file xpidl.py.


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