blob: 71e584ebf4a88d1f29cdbcaab1398d465f376382 [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Bill Wendling and is distributed under the
6// University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This is a concrete diagnostic client, which prints the diagnostics to
11// standard error.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef TEXT_DIAGNOSTIC_PRINTER_H_
16#define TEXT_DIAGNOSTIC_PRINTER_H_
17
18#include "TextDiagnostics.h"
19#include "clang/Basic/SourceLocation.h"
20
21namespace clang {
22class SourceManager;
23
24class TextDiagnosticPrinter : public TextDiagnostics {
25 SourceLocation LastWarningLoc;
26public:
27 TextDiagnosticPrinter(SourceManager &sourceMgr)
28 : TextDiagnostics(sourceMgr) {}
29
30 void PrintIncludeStack(SourceLocation Pos);
31 void HighlightRange(const SourceRange &R, unsigned LineNo,
32 std::string &CaratLine,
33 const std::string &SourceLine);
34 unsigned GetTokenLength(SourceLocation Loc);
35
36 virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
37 SourceLocation Pos,
38 diag::kind ID, const std::string *Strs,
39 unsigned NumStrs,
40 const SourceRange *Ranges,
41 unsigned NumRanges);
42};
43
44} // end namspace clang
45
46#endif