/
runtime_error.h
79 lines (64 loc) · 1.57 KB
/
runtime_error.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
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef RUNTIME_ERROR_20111021_H_
#define RUNTIME_ERROR_20111021_H_
#include "error.h"
struct builtins_cannot_be_entry_points : error {
virtual const char *what() const throw() {
return "builtins_cannot_be_entry_points";
}
};
struct runtime_error : error {
virtual const char *what() const throw() {
return "runtime_error";
}
};
struct divide_by_zero : runtime_error {
virtual const char *what() const throw() {
return "divide_by_zero";
}
};
struct uninitialized_variable_used : runtime_error {
virtual const char *what() const throw() {
return "uninitialized_variable_used";
}
};
struct variable_not_found : runtime_error {
virtual const char *what() const throw() {
return "variable_not_found";
}
};
struct incorrect_param_count : runtime_error {
virtual const char *what() const throw() {
return "incorrect_param_count";
}
};
struct duplicate_function : runtime_error {
virtual const char *what() const throw() {
return "duplicate_function";
}
};
struct duplicate_global : runtime_error {
virtual const char *what() const throw() {
return "duplicate_global";
}
};
struct duplicate_local : runtime_error {
virtual const char *what() const throw() {
return "duplicate_local";
}
};
struct undefined_function : syntax_error {
virtual const char *what() const throw() {
return "undefined_function";
}
};
struct unknown_identifier : syntax_error {
virtual const char *what() const throw() {
return "unknown_identifier";
}
};
struct out_of_bounds : runtime_error {
virtual const char *what() const throw() {
return "out_of_bounds";
}
};
#endif