| |
- SyntaxError(StandardError)
-
- ParserSyntaxError
class ParserSyntaxError(SyntaxError) |
|
Sub-class of SyntaxError for use by SimpleParse parsers
Every instance will have the following attributes:
buffer -- pointer to the source buffer
position -- integer position in buffer where error occured or -1
production -- the production which failed
expected -- string (currently taken from grammar) describing
what production/element token failed to match
the following will be calculated in order to display
human-friendly error messages:
line -- ~ text line-number or -1
lineChar -- ~ character on line where parsing failed or -1 |
|
- Method resolution order:
- ParserSyntaxError
- SyntaxError
- StandardError
- Exception
- BaseException
- object
Methods defined here:
- __str__(self)
- Create a string representation of the error
- getLineCoordinate(self)
- Get (line number, line character) for the error
- messageFormat(self, template=None)
- Create a default message for this syntax error
Data descriptors defined here:
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- DEFAULTTEMPLATE = 'Failed parsing production "%(production)s" @pos ...\nExpected syntax: %(expected)s\nGot text: %(text)s'
- buffer = ''
- error_message = None
- expected = ''
- line = -1
- position = -1
- production = ''
Methods inherited from SyntaxError:
- __init__(...)
- x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Data descriptors inherited from SyntaxError:
- filename
- exception filename
- lineno
- exception lineno
- msg
- exception msg
- offset
- exception offset
- print_file_and_line
- exception print_file_and_line
- text
- exception text
Data and other attributes inherited from SyntaxError:
- __new__ = <built-in method __new__ of type object at 0x812460>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
Methods inherited from BaseException:
- __delattr__(...)
- x.__delattr__('name') <==> del x.name
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __reduce__(...)
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setattr__(...)
- x.__setattr__('name', value) <==> x.name = value
- __setstate__(...)
- __unicode__(...)
Data descriptors inherited from BaseException:
- __dict__
- args
- message
| |