1 #ifndef SOURCEPOS_H 2 #define SOURCEPOS_H 3 4 #include <string> 5 6 using namespace std; 7 8 class SourcePos 9 { 10 public: 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 26 extern const SourcePos GENERATED_POS; 27 28 #endif // SOURCEPOS_H 29