parrotcode: Exception PMC | |
Contents | PMCs |
src/pmc/exception.pmc - Exception PMC
This is the exception base class.
As we are still lacking objects,
this class is based on ResziablePMCArray
.
This will probably change.
Please note (#39744):
Keyed access to exception objects should be very forgiving of mistakes, returning the equivalent of 'null' for invalid keys.
This issue *may* be revisited when exception objects get their new pdd23 interface.
An exception object has these attributes:
_message
_type
_severity
unused
unused
Optional:
_C_file
_C_line
_P_file
_P_line
unused
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 get_results
opcode.
This is experimental code.
The enum_class
of the Exception
isn't fixed.
The interface isn't fixed.
void init()
STRING *get_string_keyed(PMC *key)
*key
.
The only current recognized key
is "_message".STRING *get_string()
INTVAL get_integer_keyed(PMC *key)
*key
.PMC *get_pmc_keyed(PMC *key)
*key
.PMC *get_pmc_keyed_int(INTVAL key)
key
,
but ignores too big negative keys.void set_string_keyed(PMC *key, STRING *value)
*key
.void set_integer_keyed(PMC *key, INTVAL value)
*key
.void set_pmc_keyed(PMC *key, PMC *value)
*key
.INTVAL is_equal(PMC *value)
SELF
isa value
shift_*
,
unshift_*
,
pop_*
,
push_*
Initial revision by leo 2003.07.10.
|