michael@0: // michael@0: // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: #ifndef COMPILER_DIAGNOSTICS_H_ michael@0: #define COMPILER_DIAGNOSTICS_H_ michael@0: michael@0: #include "compiler/preprocessor/DiagnosticsBase.h" michael@0: michael@0: class TInfoSink; michael@0: michael@0: class TDiagnostics : public pp::Diagnostics michael@0: { michael@0: public: michael@0: TDiagnostics(TInfoSink& infoSink); michael@0: virtual ~TDiagnostics(); michael@0: michael@0: TInfoSink& infoSink() { return mInfoSink; } michael@0: michael@0: int numErrors() const { return mNumErrors; } michael@0: int numWarnings() const { return mNumWarnings; } michael@0: michael@0: void writeInfo(Severity severity, michael@0: const pp::SourceLocation& loc, michael@0: const std::string& reason, michael@0: const std::string& token, michael@0: const std::string& extra); michael@0: michael@0: void writeDebug(const std::string& str); michael@0: michael@0: protected: michael@0: virtual void print(ID id, michael@0: const pp::SourceLocation& loc, michael@0: const std::string& text); michael@0: michael@0: private: michael@0: TInfoSink& mInfoSink; michael@0: int mNumErrors; michael@0: int mNumWarnings; michael@0: }; michael@0: michael@0: #endif // COMPILER_DIAGNOSTICS_H_