idaeim studio
 PVL: Parameter Value Language

Public Member Functions | Static Public Attributes
Invalid_Syntax Class Reference

Invalid_Syntax is the base class for PVL exceptions. More...

#include <PVL_Exceptions.hh>

Inheritance diagram for Invalid_Syntax:
Inheritance graph
[legend]
Collaboration diagram for Invalid_Syntax:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

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
A PVL syntax specification violation was encountered. These exceptions may be recoverable if strict mode is not enabled. This Exception will be thrown when an attempt to convert a string to a integer or real value fails due to inappropriate characters in the string.
Aggregate_Closure_Mismatch
The End parameter does not match the specific type of the Begin parameter for an Aggregate of Parameters.
Reserved_Character
An item contains a character reserved for special meaning in the PVL syntax.
Invalid_Aggregate_Value
The value assigned to the PVL parameter that begins an Aggregate of Parameters is not a text name.
Missing_Comment_End
A comment end sequence can not be found for a comment begin sequence.
Multiline_Comment
A comment extends across more than one line.
Missing_Units_End
A units specification end sequence can not be found for a units specification begin sequence.
Missing_Quote_End
A second quoted string character can not be found that matches an initial quoted string character.
Array_Closure_Mismatch
The special character that begins an Array of Values does not match the special character that ends the Array. This usually due to imbalanced SET or SEQENCE enclosures in the PVL syntax.
Invalid_Value
A valid numeric value could not be formed.
Author:
Bradford Castalia
Version:
1.15
See also:
idaeim::Exception

Constructor & Destructor Documentation

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.

Parameters:
messageA string desribing the Exception [default: no message].
locationThe location where the invalid syntax occured [default = -1; no location].
caller_IDA C-string (NULL-terminated char*) providing the identification of the caller.

Member Function Documentation

int location ( ) const throw () [inline]

Gets the location where the invalid syntax occured.

Returns:
A character location in the PVL source.

Member Data Documentation

const char* ID [static]

Class identification name with source code version and date.

Reimplemented from Exception.


The documentation for this class was generated from the following file: