OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Types | Private Member Functions | Private Attributes | List of all members
Compiler::ErrorHandler Class Referenceabstract

Error handling. More...

#include <errorhandler.hpp>

Inheritance diagram for Compiler::ErrorHandler:
Collaboration diagram for Compiler::ErrorHandler:

Public Member Functions

 ErrorHandler ()
 constructor More...
 
virtual ~ErrorHandler ()
 destructor More...
 
bool isGood () const
 Was compiling successful? More...
 
int countErrors () const
 Return number of errors. More...
 
int countWarnings () const
 Return number of warnings. More...
 
void warning (const std::string &message, const TokenLoc &loc)
 Generate a warning message. More...
 
void error (const std::string &message, const TokenLoc &loc)
 Generate an error message. More...
 
void endOfFile ()
 Generate an error message for an unexpected EOF. More...
 
virtual void reset ()
 Remove all previous error/warning events. More...
 
void setWarningsMode (int mode)
 // 0 ignore, 1 rate as warning, 2 rate as error More...
 
void downgradeErrors (bool downgrade)
 Treat errors as warnings. More...
 

Protected Types

enum  Type { WarningMessage, ErrorMessage }
 

Private Member Functions

virtual void report (const std::string &message, const TokenLoc &loc, Type type)=0
 Report error to the user. More...
 
virtual void report (const std::string &message, Type type)=0
 Report a file related error. More...
 

Private Attributes

int mWarnings
 
int mErrors
 
int mWarningsMode
 
bool mDowngradeErrors
 

Detailed Description

Error handling.

This class collects errors and provides an interface for reporting them to the user.

Member Enumeration Documentation

Enumerator
WarningMessage 
ErrorMessage 

Constructor & Destructor Documentation

Compiler::ErrorHandler::ErrorHandler ( )

constructor

Compiler::ErrorHandler::~ErrorHandler ( )
virtual

destructor

Member Function Documentation

int Compiler::ErrorHandler::countErrors ( ) const

Return number of errors.

int Compiler::ErrorHandler::countWarnings ( ) const

Return number of warnings.

void Compiler::ErrorHandler::downgradeErrors ( bool  downgrade)

Treat errors as warnings.

Here is the caller graph for this function:

void Compiler::ErrorHandler::endOfFile ( )

Generate an error message for an unexpected EOF.

Here is the call graph for this function:

Here is the caller graph for this function:

void Compiler::ErrorHandler::error ( const std::string &  message,
const TokenLoc loc 
)

Generate an error message.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Compiler::ErrorHandler::isGood ( ) const

Was compiling successful?

Here is the caller graph for this function:

virtual void Compiler::ErrorHandler::report ( const std::string &  message,
const TokenLoc loc,
Type  type 
)
privatepure virtual

Report error to the user.

Implemented in MWGui::Console, CSMTools::ScriptCheckStage, CSVWorld::ScriptErrorTable, Compiler::StreamErrorHandler, and Compiler::NullErrorHandler.

Here is the caller graph for this function:

virtual void Compiler::ErrorHandler::report ( const std::string &  message,
Type  type 
)
privatepure virtual
void Compiler::ErrorHandler::reset ( )
virtual

Remove all previous error/warning events.

Here is the caller graph for this function:

void Compiler::ErrorHandler::setWarningsMode ( int  mode)

// 0 ignore, 1 rate as warning, 2 rate as error

Here is the caller graph for this function:

void Compiler::ErrorHandler::warning ( const std::string &  message,
const TokenLoc loc 
)

Generate a warning message.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool Compiler::ErrorHandler::mDowngradeErrors
private
int Compiler::ErrorHandler::mErrors
private
int Compiler::ErrorHandler::mWarnings
private
int Compiler::ErrorHandler::mWarningsMode
private

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