-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.cpp
More file actions
33 lines (28 loc) · 754 Bytes
/
util.cpp
File metadata and controls
33 lines (28 loc) · 754 Bytes
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
#include"stdafx.h"
int errcnt = 0;
void WARNING(string msg)
{
cerr << "WARNING: [Near line " << lc << ", col " << cc << "] " << msg << endl;
}
//TODO: improve the error function
void ERROR(string msg)
{
cerr << "ERROR: [Near line " << lc << ", col " << cc << "] " << msg << endl;
//TODO: only for debug.
/*cerr << "tknchar: " << tknchar << endl
<< "tknstr:" << tknstr << endl
<< "tknval:" << tknval << endl
<< "tkntyp:" << tkntyp << endl;*/
//exit(EXIT_FAILURE);
++errcnt;
}
void FATAL_ERROR(string msg)
{
cerr << "FATAL ERROR: [Near line " << lc << ", col " << cc << "] " << msg << endl;
cerr << "hcc terminated." << endl;
exit(EXIT_FAILURE);
}
void handler()
{
exit(EXIT_FAILURE);
}