NEST  2.6.0,not_revisioned_source_dir@0
Functions
Raising (and displaying) errors

Functions

void SLIInterpreter::raiseerror (const char *err)
 Cause the SLI interpreter to raise an error. More...
 
void SLIInterpreter::raiseerror (Name err)
 Cause the SLI interpreter to raise an error. More...
 
void SLIInterpreter::raiseerror (Name cmd, Name err)
 Cause the SLI interpreter to raise an error. More...
 
void SLIInterpreter::raiseagain (void)
 Re-raise the last error. More...
 
void SLIInterpreter::raisesignal (int)
 TO BE DOCUMENTED. More...
 

Detailed Description

Function Documentation

void SLIInterpreter::raiseagain ( void  )

Re-raise the last error.

raiseagain re-raises a previously raised error. This is useful if an error handler cannot cope with a particular error (e.g. a signal) and wants to pass it to an upper level handler. Thus, nestet error handlers are possible.

See also
raiseerror(const char*), raiseerror(Name), raiseerror(Name,Name)

References assert(), SLIInterpreter::BadErrorHandler, SLIInterpreter::baselookup(), SLIInterpreter::commandname_name, Token::empty(), SLIInterpreter::errordict, SLIInterpreter::EStack, Dictionary::insert(), Dictionary::known(), Dictionary::lookup(), SLIInterpreter::newerror_name, SLIInterpreter::OStack, TokenStack::push(), TokenStack::push_move(), SLIInterpreter::raiseerror(), SLIInterpreter::stop_name, and SLIInterpreter::true_name.

Referenced by RaiseagainFunction::execute().

void SLIInterpreter::raiseerror ( const char *  err)
inline

Cause the SLI interpreter to raise an error.

This function is used by classes derived from SLIFunction to raise an error.
raiseerror() is an interface to the SLI interpreter's error handling mechanism (see The Red Book for details). If an error is raised, the following actions are performed:

  • the value of errordict /newerror is set to true
  • the value of errordict /command is set to the name of the command which raised the error
  • If the value of errordict /recorstack is true, the state of the interpreter is saved:
    • the operand stack is copied to errordict /ostack
    • the execution stack is copied to errordict /estack
    • the dictionary stack is copied to errordict /dstack
  • the dictionary stack is cleared.
  • stop is called. Stop then tries to find an enclosing stopped context and calls the associated function.

This mechanism is explained in detail in The PostScript Reference Manual.
If the user did not establish any stopped context, the default stopped context for the SLI interpreter will be executed, which includes display of an error message and stopping program execution.
Please note that before raiserror() is called, the state of the operand and execution stack shall be restored to their initial state.

Parameters
errThe argument is the name of the error, specified as a string. The name of the currently active function will be used as the function name.
See also
raiseerror(Name), raiseerror(Name,Name), raiseagain()

References SLIInterpreter::raiseerror().

Referenced by eq_execute(), TrieFunction::execute(), OOSupportModule::CallMemberFunction::execute(), PopFunction::execute(), FilesystemModule::FileNamesFunction::execute(), Get_aFunction::execute(), NpopFunction::execute(), AddtotrieFunction::execute(), Get_a_aFunction::execute(), SLIgraphics::ReadPGMFunction::execute(), DupFunction::execute(), SLIArrayModule::IMapFunction::execute(), FilesystemModule::DirectoryFunction::execute(), SLIArrayModule::IMap_ivFunction::execute(), ExchFunction::execute(), SLIgraphics::WritePGMFunction::execute(), Get_pFunction::execute(), DictbeginFunction::execute(), SLIArrayModule::IMap_dvFunction::execute(), IndexFunction::execute(), TypeFunction::execute(), SLIArrayModule::MapThreadFunction::execute(), OfsopenFunction::execute(), Get_lpFunction::execute(), DictendFunction::execute(), LoopFunction::execute(), RollFunction::execute(), SLIArrayModule::IMapThreadFunction::execute(), SpecialFunctionsModule::GammaIncFunction::execute(), ExitFunction::execute(), RolluFunction::execute(), SpecialFunctionsModule::LambertW0Function::execute(), RolldFunction::execute(), SpecialFunctionsModule::LambertWm1Function::execute(), SLIArrayModule::IMapIndexedFunction::execute(), StrSStreamFunction::execute(), SpecialFunctionsModule::ErfFunction::execute(), SLIArrayModule::RangeFunction::execute(), OverFunction::execute(), SLIArrayModule::ArraystoreFunction::execute(), nest::DynamicLoaderModule::UnloadModuleFunction::execute(), SpecialFunctionsModule::ErfcFunction::execute(), StrFunction::execute(), SpecialFunctionsModule::GaussDiskConvFunction::execute(), DictconstructFunction::execute(), SLIArrayModule::ArraycreateFunction::execute(), CopyFunction::execute(), PrintFunction::execute(), Join_sFunction::execute(), PrettyprintFunction::execute(), CloseistreamFunction::execute(), RestoreestackFunction::execute(), CloseostreamFunction::execute(), SLIArrayModule::SortFunction::execute(), Insert_sFunction::execute(), Div_diFunction::execute(), RestoreostackFunction::execute(), FlushFunction::execute(), Insert_aFunction::execute(), Div_iiFunction::execute(), EndlFunction::execute(), InsertElement_sFunction::execute(), SLIArrayModule::PartitionFunction::execute(), EndsFunction::execute(), Div_idFunction::execute(), InsertElement_aFunction::execute(), IparseFunction::execute(), EatwhiteFunction::execute(), Replace_sFunction::execute(), Div_ddFunction::execute(), SLIArrayModule::Put_a_a_tFunction::execute(), SetwFunction::execute(), Replace_aFunction::execute(), SetprecisionFunction::execute(), Mod_iiFunction::execute(), Erase_sFunction::execute(), LoadFunction::execute(), IOSFixedFunction::execute(), Erase_aFunction::execute(), LookupFunction::execute(), IOSScientificFunction::execute(), Erase_pFunction::execute(), IOSDefaultFunction::execute(), IOSShowpointFunction::execute(), RestoredstackFunction::execute(), SLIArrayModule::AreaFunction::execute(), IOSNoshowpointFunction::execute(), IOSShowbaseFunction::execute(), Processes::ForkFunction::execute(), Processes::Sysexec_aFunction::execute(), IOSNoshowbaseFunction::execute(), Processes::WaitPIDFunction::execute(), Ln_dFunction::execute(), IOSDecFunction::execute(), Processes::KillFunction::execute(), RaiseerrorFunction::execute(), IOSHexFunction::execute(), Processes::PipeFunction::execute(), Log_dFunction::execute(), Reserve_aFunction::execute(), SLIArrayModule::Area2Function::execute(), Processes::Dup2_is_isFunction::execute(), IOSOctFunction::execute(), Processes::Dup2_os_osFunction::execute(), SLIArrayModule::Cv1dFunction::execute(), Resize_aFunction::execute(), IOSLeftFunction::execute(), Processes::Dup2_is_osFunction::execute(), SLIArrayModule::Cv2dFunction::execute(), Sqrt_dFunction::execute(), Processes::Dup2_os_isFunction::execute(), IOSRightFunction::execute(), SLIArrayModule::GetMaxFunction::execute(), Pow_ddFunction::execute(), IOSInternalFunction::execute(), SLIArrayModule::GetMinFunction::execute(), Processes::GetPIDFunction::execute(), Processes::GetPPIDFunction::execute(), GetcFunction::execute(), Pow_diFunction::execute(), Processes::GetPGRPFunction::execute(), SLIArrayModule::GaborFunction::execute(), GetsFunction::execute(), Processes::MkfifoFunction::execute(), SLIArrayModule::Gauss2dFunction::execute(), Reserve_sFunction::execute(), Resize_sFunction::execute(), Processes::SetNonblockFunction::execute(), SLIArrayModule::Array2IntVectorFunction::execute(), Getinterval_sFunction::execute(), SLIArrayModule::Array2DoubleVectorFunction::execute(), Getinterval_aFunction::execute(), SwitchFunction::execute(), SLIArrayModule::DoubleVector2ArrayFunction::execute(), SLIArrayModule::IntVector2ArrayFunction::execute(), SLIArrayModule::Add_iv_ivFunction::execute(), SLIArrayModule::Add_i_ivFunction::execute(), SLIArrayModule::Neg_ivFunction::execute(), SLIArrayModule::Sub_iv_ivFunction::execute(), ReadDoubleFunction::execute(), SLIArrayModule::Mul_iv_ivFunction::execute(), Inv_dFunction::execute(), SLIArrayModule::Mul_i_ivFunction::execute(), ReadIntFunction::execute(), SwitchdefaultFunction::execute(), SLIArrayModule::Mul_d_ivFunction::execute(), SLIArrayModule::Div_iv_ivFunction::execute(), SLIArrayModule::Add_dv_dvFunction::execute(), SLIArrayModule::Add_d_dvFunction::execute(), SLIArrayModule::Sub_dv_dvFunction::execute(), SLIArrayModule::Mul_dv_dvFunction::execute(), CaseFunction::execute(), SLIArrayModule::Mul_d_dvFunction::execute(), SLIArrayModule::Div_dv_dvFunction::execute(), CounttomarkFunction::execute(), SLIArrayModule::Neg_dvFunction::execute(), PclocksFunction::execute(), SLIArrayModule::Inv_dvFunction::execute(), SLIArrayModule::Length_dvFunction::execute(), PclockspersecFunction::execute(), SLIArrayModule::Length_ivFunction::execute(), PgetrusageFunction::execute(), SLIArrayModule::Get_iv_iFunction::execute(), SLIArrayModule::Get_iv_ivFunction::execute(), SLIArrayModule::Get_dv_ivFunction::execute(), Get_sFunction::execute(), SLIArrayModule::Get_dv_iFunction::execute(), Put_sFunction::execute(), SLIArrayModule::Put_dv_i_dFunction::execute(), SLIArrayModule::Put_iv_i_iFunction::execute(), Put_aFunction::execute(), SLIArrayModule::Zeros_ivFunction::execute(), Put_pFunction::execute(), SLIArrayModule::Zeros_dvFunction::execute(), Put_lpFunction::execute(), SLIArrayModule::Ones_dvFunction::execute(), SLIArrayModule::Ones_ivFunction::execute(), SLIArrayModule::ArangeFunction::execute(), DebugFunction::execute(), SLIInterpreter::execute_(), SLIInterpreter::execute_debug_(), SLIInterpreter::raiseagain(), SLIInterpreter::raiseerror(), and SLIInterpreter::raisesignal().

void SLIInterpreter::raiseerror ( Name  err)

Cause the SLI interpreter to raise an error.

This function is used by classes derived from SLIFunction to raise an error.
raiseerror() is an interface to the SLI interpreter's error handling mechanism (see The Red Book for details). If an error is raised, the following actions are performed:

  • the value of errordict /newerror is set to true
  • the value of errordict /command is set to the name of the command which raised the error
  • If the value of errordict /recorstack is true, the state of the interpreter is saved:
    • the operand stack is copied to errordict /ostack
    • the execution stack is copied to errordict /estack
    • the dictionary stack is copied to errordict /dstack
  • the dictionary stack is cleared.
  • stop is called. Stop then tries to find an enclosing stopped context and calls the associated function.

This mechanism is explained in detail in The PostScript Reference Manual.
If the user did not establish any stopped context, the default stopped context for the SLI interpreter will be executed, which includes display of an error message and stopping program execution.
Please note that before raiserror() is called, the state of the operand and execution stack shall be restored to their initial state.

Parameters
errThe argument is the name of the error. For conveniency, there is also a variant of this function that takes a string as the argument.
See also
raiseerror(const char*), raiseerror(Name,Name), raiseagain()

References SLIInterpreter::EStack, SLIInterpreter::getcurrentname(), TokenStack::pop(), and SLIInterpreter::raiseerror().

void SLIInterpreter::raiseerror ( Name  cmd,
Name  err 
)

Cause the SLI interpreter to raise an error.

This function is used by classes derived from SLIFunction to raise an error.
raiseerror() is an interface to the SLI interpreter's error handling mechanism (see The Red Book for details). If an error is raised, the following actions are performed:

  • the value of errordict /newerror is set to true
  • the value of errordict /command is set to the name of the command which raised the error
  • If the value of errordict /recorstack is true, the state of the interpreter is saved:
    • the operand stack is copied to errordict /ostack
    • the execution stack is copied to errordict /estack
    • the dictionary stack is copied to errordict /dstack
  • the dictionary stack is cleared.
  • stop is called. Stop then tries to find an enclosing stopped context and calls the associated function.

This mechanism is explained in detail in The PostScript Reference Manual.
If the user did not establish any stopped context, the default stopped context for the SLI interpreter will be executed, which includes display of an error message and stopping program execution.
Please note that before raiserror() is called, the state of the operand and execution stack shall be restored to their initial state.

Parameters
cmdThe first argument is the name of the calling function.
errThe second argument is the name of the error.
See also
raiseerror(const char*), raiseerror(Name), raiseagain()

References assert(), SLIInterpreter::BadErrorHandler, SLIInterpreter::baselookup(), SLIInterpreter::commandname_name, SLIInterpreter::DStack, SLIInterpreter::dstack_name, SLIInterpreter::errordict, SLIInterpreter::errorname_name, SLIInterpreter::EStack, SLIInterpreter::estack_name, SLIInterpreter::false_name, Dictionary::insert(), Dictionary::insert_move(), Dictionary::lookup(), SLIInterpreter::newerror_name, SLIInterpreter::OStack, SLIInterpreter::ostack_name, TokenStack::push(), SLIInterpreter::raiseerror(), SLIInterpreter::recordstacks_name, SLIInterpreter::stop_name, TokenStack::toArray(), DictionaryStack::toArray(), and SLIInterpreter::true_name.

void SLIInterpreter::raisesignal ( int  sig)