zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TDiagnostics Class Reference

#include <Diagnostics.h>

Inherits pp::Diagnostics.

Public Member Functions

 TDiagnostics (TInfoSink &infoSink)
 
virtual ~TDiagnostics ()
 
TInfoSinkinfoSink ()
 
int numErrors () const
 
int numWarnings () const
 
void writeDebug (const std::string &str)
 
void writeInfo (Severity severity, const pp::SourceLocation &loc, const std::string &reason, const std::string &token, const std::string &extra)
 
- Public Member Functions inherited from pp::Diagnostics
virtual ~Diagnostics ()
 
void report (ID id, const SourceLocation &loc, const std::string &text)
 

Protected Member Functions

virtual void print (ID id, const pp::SourceLocation &loc, const std::string &text)
 
- Protected Member Functions inherited from pp::Diagnostics
std::string message (ID id)
 
Severity severity (ID id)
 

Additional Inherited Members

- Public Types inherited from pp::Diagnostics
enum  ID {
  ERROR_BEGIN, INTERNAL_ERROR, OUT_OF_MEMORY, INVALID_CHARACTER,
  INVALID_NUMBER, INTEGER_OVERFLOW, FLOAT_OVERFLOW, TOKEN_TOO_LONG,
  INVALID_EXPRESSION, DIVISION_BY_ZERO, EOF_IN_COMMENT, UNEXPECTED_TOKEN,
  DIRECTIVE_INVALID_NAME, MACRO_NAME_RESERVED, MACRO_REDEFINED, MACRO_PREDEFINED_REDEFINED,
  MACRO_PREDEFINED_UNDEFINED, MACRO_UNTERMINATED_INVOCATION, MACRO_TOO_FEW_ARGS, MACRO_TOO_MANY_ARGS,
  CONDITIONAL_ENDIF_WITHOUT_IF, CONDITIONAL_ELSE_WITHOUT_IF, CONDITIONAL_ELSE_AFTER_ELSE, CONDITIONAL_ELIF_WITHOUT_IF,
  CONDITIONAL_ELIF_AFTER_ELSE, CONDITIONAL_UNTERMINATED, INVALID_EXTENSION_NAME, INVALID_EXTENSION_BEHAVIOR,
  INVALID_EXTENSION_DIRECTIVE, INVALID_VERSION_NUMBER, INVALID_VERSION_DIRECTIVE, VERSION_NOT_FIRST_STATEMENT,
  INVALID_LINE_NUMBER, INVALID_FILE_NUMBER, INVALID_LINE_DIRECTIVE, ERROR_END,
  WARNING_BEGIN, EOF_IN_DIRECTIVE, CONDITIONAL_UNEXPECTED_TOKEN, UNRECOGNIZED_PRAGMA,
  WARNING_END
}
 
enum  Severity { ERROR, WARNING }
 

Detailed Description

Definition at line 14 of file Diagnostics.h.

Constructor & Destructor Documentation

TDiagnostics::TDiagnostics ( TInfoSink infoSink)

Definition at line 13 of file Diagnostics.cpp.

TDiagnostics::~TDiagnostics ( )
virtual

Definition at line 20 of file Diagnostics.cpp.

Member Function Documentation

TInfoSink& TDiagnostics::infoSink ( )
inline

Definition at line 20 of file Diagnostics.h.

Referenced by TParseContext::infoSink().

int TDiagnostics::numErrors ( ) const
inline

Definition at line 22 of file Diagnostics.h.

Referenced by TParseContext::numErrors().

int TDiagnostics::numWarnings ( ) const
inline

Definition at line 23 of file Diagnostics.h.

void TDiagnostics::print ( ID  id,
const pp::SourceLocation loc,
const std::string text 
)
protectedvirtual

Implements pp::Diagnostics.

Definition at line 58 of file Diagnostics.cpp.

References pp::Diagnostics::message(), pp::Diagnostics::severity(), and writeInfo().

void TDiagnostics::writeDebug ( const std::string str)

Definition at line 53 of file Diagnostics.cpp.

References TInfoSink::debug, and str.

Referenced by TParseContext::trace().


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