YAP 7.1.0
Error Handling in the YAP interface.

error handling in C++ and OO languages More...

Detailed Description

error handling in C++ and OO languages

These classes define an object that we can then throw when an error or unexoected event interrupts YAP Often, the object is built by YAP itself One can also define one's own error objects

Errors will be thrown from the C++ code, and may be processed in very different ways The error object should provide as much data as possible


Class Documentation

◆ YAPError

class YAPError

take information on a Prolog error:

Definition at line 31 of file yapie.hh.

Public Member Functions

 YAPError ()
 wraps the default error descriptor More...
 
 YAPError (yap_error_descriptor_t *des)
 if des != nullptr, wrap a preexisting error descriptor; otherwise, generate a new one More...
 
 YAPError (const char *file, const char *function, int lineno, yap_error_number id, YAP_Term culprit, const char *txt)
 error handler object with initial data when receiving the error term More...
 
yap_error_number getID ()
 we just know the error number exact error ID More...
 
yap_error_class_number getErrorClass ()
 class of error More...
 
const char * getFile ()
 where in the code things happened; More...
 
Int getLine ()
 predicate things happened; More...
 
std::string text ()
 the term that caused the bug More...
 

Constructor & Destructor Documentation

◆ YAPError() [1/3]

YAPError ( )
inline

wraps the default error descriptor

Definition at line 37 of file yapie.hh.

◆ YAPError() [2/3]

YAPError ( yap_error_descriptor_t des)
inline

if des != nullptr, wrap a preexisting error descriptor; otherwise, generate a new one

Definition at line 46 of file yapie.hh.

◆ YAPError() [3/3]

YAPError ( const char *  file,
const char *  function,
int  lineno,
yap_error_number  id,
YAP_Term  culprit,
const char *  txt 
)
inline

error handler object with initial data when receiving the error term

error handler object with initial data when receiving the error term

Definition at line 64 of file yapie.hh.

Member Function Documentation

◆ getErrorClass()

yap_error_class_number getErrorClass ( )
inline

class of error

Definition at line 77 of file yapie.hh.

◆ getFile()

const char * getFile ( )
inline

where in the code things happened;

Definition at line 81 of file yapie.hh.

◆ getID()

yap_error_number getID ( )
inline

we just know the error number exact error ID

Definition at line 75 of file yapie.hh.

◆ getLine()

Int getLine ( )
inline

predicate things happened;

Definition at line 83 of file yapie.hh.

◆ text()

std::string text ( void  )

the term that caused the bug

text describing the Error

Definition at line 1202 of file yapi.cpp.

Variable Documentation

◆ YAPPPredicate

class X_API YAPPPredicate

Definition at line 26 of file yapie.hh.

Variables

class X_API YAPPPredicate