NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
mu::ParserError Class Reference

Error class of the parser. More...

#include <muParserError.h>

Collaboration diagram for mu::ParserError:

Public Member Functions

 ParserError ()
 Default constructor. More...
 
 ParserError (EErrorCodes a_iErrc)
 This Constructor is used for internal exceptions only. More...
 
 ParserError (const string_type &sMsg)
 Construct an error from a message text. More...
 
 ParserError (EErrorCodes a_iErrc, const string_type &sTok, const string_type &sFormula=string_type(_nrT("(formula is not available)")), int a_iPos=-1)
 Construct an error object. More...
 
 ParserError (EErrorCodes a_iErrc, int a_iPos, const string_type &sTok)
 Construct an error object. More...
 
 ParserError (const char_type *a_szMsg, int a_iPos=-1, const string_type &sTok=string_type())
 Construct an error object. More...
 
 ParserError (const ParserError &a_Obj)
 Copy constructor. More...
 
ParserErroroperator= (const ParserError &a_Obj)
 Assignment operator. More...
 
 ~ParserError ()
 
void SetFormula (const string_type &a_strFormula)
 Set the expression related to this error. More...
 
const string_typeGetExpr () const
 gets the expression related tp this error. More...
 
const string_typeGetMsg () const
 Returns the message string for this error. More...
 
std::size_t GetPos () const
 Return the formula position related to the error. More...
 
const string_typeGetToken () const
 Return string related with this token (if available). More...
 
EErrorCodes GetCode () const
 Return the error code. More...
 

Private Member Functions

void ReplaceSubString (string_type &strSource, const string_type &strFind, const string_type &strReplaceWith)
 Replace all ocuurences of a substring with another string. More...
 
void Reset ()
 Reset the erro object. More...
 

Private Attributes

string_type m_strMsg
 The message string. More...
 
string_type m_strFormula
 Formula string. More...
 
string_type m_strTok
 Token related with the error. More...
 
int m_iPos
 Formula position related to the error. More...
 
EErrorCodes m_iErrc
 Error code. More...
 
const ParserErrorMsgm_ErrMsg
 

Detailed Description

Error class of the parser.

Author
Ingo Berg

Part of the math parser package.

Definition at line 129 of file muParserError.h.

Constructor & Destructor Documentation

◆ ParserError() [1/7]

mu::ParserError::ParserError ( )

Default constructor.

Definition at line 118 of file muParserError.cpp.

◆ ParserError() [2/7]

mu::ParserError::ParserError ( EErrorCodes  a_iErrc)
explicit

This Constructor is used for internal exceptions only.

It does not contain any information but the error code.

Definition at line 133 of file muParserError.cpp.

References _nrT, m_strMsg, and Reset().

Here is the call graph for this function:

◆ ParserError() [3/7]

mu::ParserError::ParserError ( const string_type sMsg)
explicit

Construct an error from a message text.

Definition at line 142 of file muParserError.cpp.

References m_strMsg, and Reset().

Here is the call graph for this function:

◆ ParserError() [4/7]

mu::ParserError::ParserError ( EErrorCodes  iErrc,
const string_type sTok,
const string_type sExpr = string_type(_nrT("(formula is not available)")),
int  iPos = -1 
)

Construct an error object.

Parameters
[in]a_iErrcthe error code.
[in]sTokThe token string related to this error.
[in]sExprThe expression related to the error.
[in]a_iPosthe position in the expression where the error occured.

Definition at line 156 of file muParserError.cpp.

References _lang, _nrT, Language::get(), m_ErrMsg, m_iErrc, m_iPos, m_strMsg, m_strTok, and ReplaceSubString().

Here is the call graph for this function:

◆ ParserError() [5/7]

mu::ParserError::ParserError ( EErrorCodes  iErrc,
int  iPos,
const string_type sTok 
)

Construct an error object.

Parameters
[in]iErrcthe error code.
[in]iPosthe position in the expression where the error occured.
[in]sTokThe token string related to this error.

Definition at line 180 of file muParserError.cpp.

References _nrT, m_ErrMsg, m_iErrc, m_iPos, m_strMsg, m_strTok, and ReplaceSubString().

Here is the call graph for this function:

◆ ParserError() [6/7]

mu::ParserError::ParserError ( const char_type szMsg,
int  iPos = -1,
const string_type sTok = string_type() 
)

Construct an error object.

Parameters
[in]szMsgThe error message text.
[in]iPosthe position related to the error.
[in]sTokThe token string related to this error.

Definition at line 201 of file muParserError.cpp.

References _nrT, m_iPos, m_strMsg, m_strTok, and ReplaceSubString().

Here is the call graph for this function:

◆ ParserError() [7/7]

mu::ParserError::ParserError ( const ParserError a_Obj)

Copy constructor.

Definition at line 217 of file muParserError.cpp.

◆ ~ParserError()

mu::ParserError::~ParserError ( )

Definition at line 243 of file muParserError.cpp.

Member Function Documentation

◆ GetCode()

EErrorCodes mu::ParserError::GetCode ( ) const

Return the error code.

Definition at line 324 of file muParserError.cpp.

References m_iErrc.

Referenced by mu::Test::ParserTester::ThrowTest().

◆ GetExpr()

const string_type & mu::ParserError::GetExpr ( ) const

gets the expression related tp this error.

Definition at line 293 of file muParserError.cpp.

References m_strFormula.

Referenced by Procedure::catchExceptionForTest(), mu::Test::ParserTester::EqnTestInt(), and NumeReKernel::MainLoop().

◆ GetMsg()

◆ GetPos()

std::size_t mu::ParserError::GetPos ( ) const

Return the formula position related to the error.

If the error is not related to a distinct position this will return -1

Definition at line 310 of file muParserError.cpp.

References m_iPos.

Referenced by NumeReKernel::MainLoop().

◆ GetToken()

const string_type & mu::ParserError::GetToken ( ) const

Return string related with this token (if available).

Definition at line 317 of file muParserError.cpp.

References m_strTok.

Referenced by NumeReKernel::MainLoop(), and mu::Test::ParserTester::Run().

◆ operator=()

ParserError & mu::ParserError::operator= ( const ParserError a_Obj)

Assignment operator.

Definition at line 229 of file muParserError.cpp.

References m_iErrc, m_iPos, m_strFormula, m_strMsg, and m_strTok.

◆ ReplaceSubString()

void mu::ParserError::ReplaceSubString ( string_type strSource,
const string_type strFind,
const string_type strReplaceWith 
)
private

Replace all ocuurences of a substring with another string.

Parameters
strFindThe string that shall be replaced.
strReplaceWithThe string that should be inserted instead of strFind

Definition at line 251 of file muParserError.cpp.

Referenced by ParserError().

◆ Reset()

void mu::ParserError::Reset ( )
private

Reset the erro object.

Definition at line 275 of file muParserError.cpp.

References _nrT, mu::ecUNDEFINED, m_iErrc, m_iPos, m_strFormula, m_strMsg, and m_strTok.

Referenced by ParserError().

◆ SetFormula()

void mu::ParserError::SetFormula ( const string_type a_strFormula)

Set the expression related to this error.

Definition at line 286 of file muParserError.cpp.

References m_strFormula.

Member Data Documentation

◆ m_ErrMsg

const ParserErrorMsg& mu::ParserError::m_ErrMsg
private

Definition at line 171 of file muParserError.h.

Referenced by ParserError().

◆ m_iErrc

EErrorCodes mu::ParserError::m_iErrc
private

Error code.

Definition at line 170 of file muParserError.h.

Referenced by GetCode(), operator=(), ParserError(), and Reset().

◆ m_iPos

int mu::ParserError::m_iPos
private

Formula position related to the error.

Definition at line 169 of file muParserError.h.

Referenced by GetPos(), operator=(), ParserError(), and Reset().

◆ m_strFormula

string_type mu::ParserError::m_strFormula
private

Formula string.

Definition at line 167 of file muParserError.h.

Referenced by GetExpr(), operator=(), Reset(), and SetFormula().

◆ m_strMsg

string_type mu::ParserError::m_strMsg
private

The message string.

Definition at line 166 of file muParserError.h.

Referenced by GetMsg(), operator=(), ParserError(), and Reset().

◆ m_strTok

string_type mu::ParserError::m_strTok
private

Token related with the error.

Definition at line 168 of file muParserError.h.

Referenced by GetToken(), operator=(), ParserError(), and Reset().


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