ELAM
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ELAM::Exception Class Reference

Objects of this class represent an exception in the evaluation of an ELAM expression. More...

#include <elamvalue.h>

Public Types

enum  ErrorType {
  NoError =0, ParserError, UnknownOperatorError, UnknownFunctionError,
  UnknownValueError, TypeMismatchError, ArgumentListError, OperationError
}
 Type of Exception. More...
 

Public Member Functions

 Exception (const Exception &)
 instantiates a copy of an exception More...
 
 Exception (const QVariant &)
 instantiate a copy from a matching variant More...
 
 Exception (ErrorType type=NoError, QString errorText=QString(), Position pos=Position())
 instantiates an exception More...
 
 Exception (ErrorType type, Position pos, QString errorText=QString())
 instantiates an exception More...
 
Exceptionoperator= (const Exception &)
 copies an exception More...
 
QString errorText () const
 returns the describing text of the exception (if existing) More...
 
ErrorType errorType () const
 type of error represented by the exception More...
 
QString errorTypeName () const
 returns a human readable error type name of this exception More...
 
Position errorPos () const
 the position in the original expression where the error originated More...
 
Position position () const
 the position in the original expression where the error originated More...
 
int errorLine () const
 the line in the original expression where the error originated More...
 
int errorColumn () const
 the column in the original expression where the error originated More...
 
void setPosition (Position p)
 overrides the exceptions position More...
 
 operator QVariant () const
 converts the exception to a variant More...
 

Static Public Member Functions

static int metaTypeId ()
 the meta type ID (used with QVariant) of the exception type More...
 

Detailed Description

Objects of this class represent an exception in the evaluation of an ELAM expression.

Member Enumeration Documentation

Type of Exception.

Enumerator
NoError 

not an exception

ParserError 

error while parsing the expression

UnknownOperatorError 

the operator is not known

UnknownFunctionError 

the function is not known

UnknownValueError 

unknown variable or constant

TypeMismatchError 

the operator or function is known, but the type of one of the arguments is not supported

ArgumentListError 

the amount of arguments to a function is wrong or the syntax of arguments

OperationError 

the operation itself failed, e.g. division by zero

Constructor & Destructor Documentation

ELAM::Exception::Exception ( const Exception )

instantiates a copy of an exception

ELAM::Exception::Exception ( const QVariant &  )

instantiate a copy from a matching variant

ELAM::Exception::Exception ( ErrorType  type = NoError,
QString  errorText = QString(),
Position  pos = Position() 
)

instantiates an exception

Parameters
typethe type of exception
errorTextsome human readable text describing the problem
posthe position in the original expression string where the problem occurred
ELAM::Exception::Exception ( ErrorType  type,
Position  pos,
QString  errorText = QString() 
)

instantiates an exception

Parameters
typethe type of exception
errorTextsome human readable text describing the problem
posthe position in the original expression string where the problem occurred

Member Function Documentation

int ELAM::Exception::errorColumn ( ) const
inline

the column in the original expression where the error originated

int ELAM::Exception::errorLine ( ) const
inline

the line in the original expression where the error originated

Position ELAM::Exception::errorPos ( ) const
inline

the position in the original expression where the error originated

QString ELAM::Exception::errorText ( ) const
inline

returns the describing text of the exception (if existing)

ErrorType ELAM::Exception::errorType ( ) const
inline

type of error represented by the exception

QString ELAM::Exception::errorTypeName ( ) const

returns a human readable error type name of this exception

static int ELAM::Exception::metaTypeId ( )
static

the meta type ID (used with QVariant) of the exception type

ELAM::Exception::operator QVariant ( ) const
inline

converts the exception to a variant

Exception& ELAM::Exception::operator= ( const Exception )

copies an exception

Position ELAM::Exception::position ( ) const
inline

the position in the original expression where the error originated

void ELAM::Exception::setPosition ( Position  p)
inline

overrides the exceptions position


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