Error handling

Top  Previous  Next

Code generation > Error handling

 

There are four events, which force the parser to abort and there is a treatment routine for each of these events, which normally throws a corresponding exception type. These methods are virtual and can be overwritten.

 

void    OnErrorExpected(state_type& xParseState,

                                    int xiSym,

                                    const char* xpProduction,

                                    const char* xpBranch) const;

 

The token with the number xiSym was expected, however, wasn't it found in the production with the name xpProduction at the branch with the name xpBranch.

 

 

void    OnErrorUnexpected(state_type& xParseState,

                                        const char* xpProduction,

                                        const char* xpBranch) const;

 

Another token was expected, however, wasn't it found in the production with the name xpProduction at the branch with the name xpBranch.

 

 

void    OnErrorIncomplete(state_type& xParseState,

                                      const char* xpProduction,

                                      const char* xpBranch) const;

 

The input couldn't be parsed completely by the production with the name xpProduction.

 

void    OnErrorStandstill(state_type& xParseState,

                                     const char* xpProduction,

                                     const char* xpBranch) const;

 

The parser is in an endless loop in the production with the name xpProduction at the branch with the name xpBranch. (This bug cannot occur at the moment, since only tokens covering at least one character are allowed.)

 

 

CTT_Message is the basic class for all messages, warnings, errors and exceptions. It contains a message string and details on the current status of the parser

 

CTT_Message(const std::string& xsWhat,

                     unsigned int xuiLastPosition,

                     unsigned int xuiPosition,

                     const char* xpProduction,

                     const char* xpSymbol = NULL,

                     EMsgType xeMsgType = eMessage,

                     unsigned int xui = 0)

 

 

From CTT_Message directly or indirectly derived are:

 

CTT_Exit

CTT_Warning

CTT_Error

CTT_ParseError

CTT_ErrorExpected

CTT_ErrorUnexpected

CTT_ErrorStandstill

CTT_ErrorIncomplete

CTT_SemError

CTT_NodeError

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German