This repository has been archived by the owner on Jun 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExceptions.h
62 lines (51 loc) · 1.61 KB
/
Exceptions.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
#ifndef EXCEPTIONS_H
#define EXCEPTIONS_H
#include <exception>
class UnreachableTokenException: public std::exception {
virtual const char *what() const throw () {
return "Error: unreachable token.";
}
};
class NoArgumentException: public std::exception {
};
class NoNumericArgumentException: public NoArgumentException {
virtual const char *what() const throw () {
return "Error: no numeric argument was passed.";
}
};
class NoLabelArgumentException: public NoArgumentException {
virtual const char *what() const throw () {
return "Error: no label argument was passed.";
}
};
class OutOfBoundsException: public NoArgumentException {
virtual const char *what() const throw () {
return "Error: index out of bounds.";
}
};
class PrematureEndException: public std::exception {
virtual const char *what() const throw () {
return "Error: number or label ended prematurely.";
}
};
class UndefinedSignException: public std::exception {
virtual const char *what() const throw () {
return "Error: sign of the number is undefined.";
}
};
class InstructionNotFoundException: public std::exception {
virtual const char *what() const throw () {
return "Error: instruction has not been found.";
}
};
class LabelNotFoundException: public std::exception {
virtual const char *what() const throw () {
return "Error: label has not been found.";
}
};
class SomeException: public std::exception {
virtual const char *what() const throw () {
return "Error: some unspecified exception has occurred. :(";
}
};
#endif