-
Notifications
You must be signed in to change notification settings - Fork 0
/
excep.h
66 lines (56 loc) · 1.52 KB
/
excep.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include <string>
#include "marco.h"
using namespace std;
class Excep {
protected:
string inform;
public:
Excep(string inform) : inform(inform) {}
string getInform() { return inform; }
};
class unassignedEvalExcep : public Excep {
public:
unassignedEvalExcep() : Excep("unassigned Eval") {}
};
class unassignedAssignedExcep : public Excep {
public:
unassignedAssignedExcep() : Excep("unassigned Assigned") {}
};
class cannotAssignedExcep : public Excep { //这个或许应该加上类型存储
public:
cannotAssignedExcep() : Excep("cannot Assigned") {}
};
class cannotEvaledExcep : public Excep {
public:
cannotEvaledExcep() : Excep("cannot Evaled") {}
};
class VarRefUnbindExcep : public Excep {
public:
VarRefUnbindExcep() : Excep("VarRef Unbind") {}
};
class argumentNumExceedingExcep : public Excep {
public:
argumentNumExceedingExcep() : Excep("argument Num Exceeding") {}
};
class parameterNumExceedingExcep : public Excep {
public:
parameterNumExceedingExcep() : Excep("parameter Num Exceeding") {}
};
enum callCheckMismatchType{NumberMismatch,TypeMisMatch};
class callCheckMismatchExcep : public Excep
{
private:
int type;
public:
callCheckMismatchExcep(int type) : Excep("callCheck Mismatch:"), type(type) { inform+=to_string(type); }
int getType() {return this->type;}
};
class addSonExcep : public Excep
{
private:
int type;
public:
addSonExcep(int type) : Excep("add Son Excep:"), type(type) { inform+=to_string(type); }
int getType() {return this->type;}
};