blob: 5027129f8149530d11b7c0514b90901fcd54897b [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001#ifndef SOURCEPOS_H
2#define SOURCEPOS_H
3
4#include <string>
5
6using namespace std;
7
8class SourcePos
9{
10public:
11 string file;
12 int line;
13
14 SourcePos(const string& f, int l);
15 SourcePos(const SourcePos& that);
16 SourcePos();
17 ~SourcePos();
18
19 string ToString() const;
20 int Error(const char* fmt, ...) const;
21
22 static bool HasErrors();
23 static void PrintErrors(FILE* to);
24};
25
26extern const SourcePos GENERATED_POS;
27
28#endif // SOURCEPOS_H