| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
pyparsing.ParseBaseException Class Reference
Inheritance diagram for pyparsing.ParseBaseException:
[legend]
Collaboration diagram for pyparsing.ParseBaseException:
[legend]

## Public Member Functions
def | __init__
def | __getattr__
def | __str__
def | __repr__
def | markInputline
def | __dir__

## Public Attributes
| loc
| msg
| pstr
| parserElement

## Detailed Description

    base exception class for all parsing runtime exceptions

Definition at line 167 of file pyparsing.py.

## Constructor & Destructor Documentation

def pyparsing.ParseBaseException.__init__ | ( |  | self,
|  |  | pstr,
|  |  | loc = `0`,
|  |  | msg = `None`,
|  |  | elem = `None`
| ) |  |

Definition at line 171 of file pyparsing.py.

171
172 def __init__( self, pstr, loc=0, msg=None, elem=None ):
173 self.loc = loc
174 if msg is None:
175 self.msg = pstr
176 self.pstr = ""
177 else:
178 self.msg = msg
179 self.pstr = pstr
180 self.parserElement = elem

## Member Function Documentation

def pyparsing.ParseBaseException.__dir__ | ( |  | self | ) |

Definition at line 211 of file pyparsing.py.

211
212 def __dir__(self):
213 return "loc msg pstr parserElement lineno col line " \
214 "markInputLine __str__ __repr__".split()

def pyparsing.ParseBaseException.__getattr__ | ( |  | self,
|  |  | aname
| ) |  |

    supported attributes by name are:
        - lineno - returns the line number of the exception text
        - col - returns the column number of the exception text
        - line - returns the line containing the exception text

Definition at line 181 of file pyparsing.py.

181
182 def __getattr__( self, aname ):
183 """supported attributes by name are:
184 - lineno - returns the line number of the exception text
185 - col - returns the column number of the exception text
186 - line - returns the line containing the exception text
187 """
188 if( aname == "lineno" ):
189 return lineno( self.loc, self.pstr )
190 elif( aname in ("col", "column") ):
191 return col( self.loc, self.pstr )
192 elif( aname == "line" ):
193 return line( self.loc, self.pstr )
194 else:
195 raise AttributeError(aname)

def pyparsing.ParseBaseException.__repr__ | ( |  | self | ) |

Definition at line 199 of file pyparsing.py.

199
200 def __repr__( self ):
return _ustr(self)

def pyparsing.ParseBaseException.__str__ | ( |  | self | ) |

Definition at line 196 of file pyparsing.py.

196
197 def __str__( self ):
198 return "%s (at char %d), (line:%d, col:%d)" % \
( self.msg, self.loc, self.lineno, self.column )

def pyparsing.ParseBaseException.markInputline | ( |  | self,
|  |  | markerString = `">!<"`
| ) |  |

    Extracts the exception line from the input string, and marks
       the location of the exception with a special symbol.

Definition at line 201 of file pyparsing.py.

201
202 def markInputline( self, markerString = ">!<" ):
203 """Extracts the exception line from the input string, and marks
204 the location of the exception with a special symbol.
205 """
206 line_str = self.line
207 line_column = self.column - 1
208 if markerString:
209 line_str = "".join( [line_str[:line_column],
210 markerString, line_str[line_column:]])
return line_str.strip()

## Member Data Documentation

pyparsing.ParseBaseException.loc

Definition at line 172 of file pyparsing.py.

pyparsing.ParseBaseException.msg

Definition at line 174 of file pyparsing.py.

pyparsing.ParseBaseException.parserElement

Definition at line 179 of file pyparsing.py.

pyparsing.ParseBaseException.pstr

Definition at line 175 of file pyparsing.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/cmake/cmt2cmake/pyparsing.py