-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherror.hpp
40 lines (33 loc) · 1.32 KB
/
error.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Written by : Nikolaos S. Papaspyrou
* Modified by : Nikoletta Barmpa, Andreas Evangelatos
*/
#ifndef __ERROR_HPP__
#define __ERROR_HPP__
#include <string>
#include <set>
//====================================================================================//
// Prototyped For Error Handling //
//====================================================================================//
void internal (const char * fmt, ...);
void fatal (const char * fmt, ...);
void error (const char * fmt, ...);
void warning (const char * fmt, ...);
//====================================================================================//
// Info Carrying Class for Error Messaginh //
//====================================================================================//
class ErrorInfo {
public:
// this is inhereted by all AST classes and carry the line and column where each node appeared
// it also a pointer in the fileSet to indicate the file where it appeared.
ErrorInfo();
~ErrorInfo();
int getLineAppeared();
// fatal version for AST nodes to also print line, column and the file of the error
void fatal(const char * fmt, ...);
private:
int _lineappeared;
int _columnappeared;
std::set<std::string>::iterator _fileappeared;
};
#endif