![]() |
PVL: Parameter Value Language
|
Invalid_Syntax is the base class for PVL exceptions. More...
#include <PVL_Exceptions.hh>
Public Member Functions | |
Invalid_Syntax (const std::string &message="", const int location=-1, const char *caller_ID=NULL) | |
Creates an Invalid_Syntax Exception optionally containing a descriptive message string, the location of the exception, and the ID of the caller. | |
int | location () const throw () |
Gets the location where the invalid syntax occured. | |
Static Public Attributes | |
static const char * | ID |
Class identification name with source code version and date. |
Invalid_Syntax is the base class for PVL exceptions.
It is a subclass of idaeim::Exception which provides a message string describing the reason for the Exception. For Invalid_Syntax and its subclasses an optional location may be specified to indicate where the syntax violation occured. If specified it will be included on the message line that an Invalid_Syntax Exception adds to the user's descriptive message.
An Invalid_Syntax exception usually happens when the Parser encounters invalid syntax in a source stream. It can also happen when an attempt is made to convert a string to a number but it is not a valid representation of the numerical type. Subclasses are used to signal the different types of exception conditions:
Invalid_Syntax | ( | const std::string & | message = "" , |
const int | location = -1 , |
||
const char * | caller_ID = NULL |
||
) | [explicit] |
Creates an Invalid_Syntax Exception optionally containing a descriptive message string, the location of the exception, and the ID of the caller.
The Exception message will have the caller ID, if present, on the first line. Next will be the "Invalid PVL Syntax" notation followed on the same line with the stream location of the exception, if present. If a non-empty descriptive message is provided, that is appended starting on the next line.
message | A string desribing the Exception [default: no message]. |
location | The location where the invalid syntax occured [default = -1; no location]. |
caller_ID | A C-string (NULL-terminated char*) providing the identification of the caller. |
int location | ( | ) | const throw () [inline] |
Gets the location where the invalid syntax occured.
const char* ID [static] |
Class identification name with source code version and date.
Reimplemented from Exception.