-
Notifications
You must be signed in to change notification settings - Fork 0
/
exception.h
executable file
·44 lines (40 loc) · 817 Bytes
/
exception.h
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
41
42
43
44
#ifndef __ParserException__
#define __ParserException__
#include<string>
using namespace std;
class ParserException{
string message;
string name;
int line;
char buff[10];
public:
ParserException(string mess){
message = mess;
this->name = "";
this->line = 0;
}
ParserException(string mess, int line){
message = mess;
this->name = "";
this->line = line;
}
ParserException(string mess, string name){
message = mess;
this->name = name;
}
ParserException(string mess, string name, int line){
message = mess;
this->name = name;
this->line = line;
}
string getMessage(){
message = message + name + " radek ";
if (line>0){
sprintf(buff,"%d",line);
message =message + buff;
}
return message;
}
~ParserException(){}
};
#endif