-
Notifications
You must be signed in to change notification settings - Fork 7
/
errors.h
57 lines (46 loc) · 1.02 KB
/
errors.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
#ifndef INCLUDE_ERRORS_H
#define INCLUDE_ERRORS_H
// errors.h
// Revision 3-feb-2011
#include "token.h"
#include <stdexcept>
class InternalError : public std::runtime_error
{
public:
InternalError(const std::string &msg);
~InternalError() throw () {}
};
class CompileError : public std::runtime_error
{
public:
CompileError(const std::string &msg);
CompileError(const std::string &msg, const Token &where);
~CompileError() throw () {}
unsigned int linenum() const;
std::string file() const;
private:
Token w;
};
class Unsupported : public CompileError
{
public:
Unsupported(const std::string &msg, const Token &where);
};
class UnsupportedInStage : public CompileError
{
public:
UnsupportedInStage(const std::string &msg, const Token &where);
};
class SyntaxError : public CompileError
{
public:
SyntaxError(const std::string &msg, const Token &where);
};
class Expected : public SyntaxError
{
public:
Expected(char msg, const Token &where);
Expected(const std::string &msg, const Token &where);
};
#endif
// End of errors.h