src/pmc/exception.pmc - Exception PMC
This is the exception base class.
this class is based on
This will change when the full PMC PDD is implemented.
An exception object has these attributes:
- Textual representation of the exception.
- The exception type,
- The severity of the exception,
- Additional data for the exception.
- The C code file in which the exception was raised.
- The line of C code on which the exception was raised.
- The PASM/PIR/Perl file in which the exception was raised.
- The line of PASM/PIR/Perl code on which the exception was raised.
- Any information attached by the HL.
This shouldn't start with an underscore (that is reserved for Parrot's internal usage.
These are stored as properties.
- Note: currently,
HLL information must be indexed by number.
Slots 9 and 10 are available for the HLL - This is subject to change.
When an exception handler is called,
the exception object is passed as as the first argument,
the message as the second argument of the call.
These arguments can be retrieved with the
- Initializes the exception with default values.
STRING *get_string_keyed(PMC *key)
- Returns the Parrot string value for
The only current recognized
key is "_message".
- Return the exception message.
INTVAL get_integer_keyed(PMC *key)
- Returns the integer value for
PMC *get_pmc_keyed(PMC *key)
- Returns the PMC value for
PMC *get_pmc_keyed_int(INTVAL key)
- Returns the PMC value of the element at index
but ignores too big negative keys.
void set_string_keyed(PMC *key, STRING *value)
- Sets the Parrot string value for
void set_integer_keyed(PMC *key, INTVAL value)
- Sets the integer value for
void set_pmc_keyed(PMC *key, PMC *value)
- Sets the PMC value for
INTVAL is_equal(PMC *value)
- Compare the passed in Exception with SELF.
Returns True if
- Retrieve an attribute value for the exception object.
- Set an attribute value for the exception object.
- These methods are silently ignored.
Initial revision by leo 2003.07.10.