-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.h
76 lines (60 loc) · 2.09 KB
/
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
#ifndef BLIF_VERIFIER_ERROR_H
#define BLIF_VERIFIER_ERROR_H
#include <iosfwd>
#include <string>
namespace blifverifier {
// Top-level error for the namespace/project.
struct Error {
// Generate a human-readable description of the error.
virtual void describe(std::ostream& os) const = 0;
};
// Abstract errors to simplify catching classes of errors;
struct IOError : public Error { };
struct ParseError : public Error {
explicit ParseError(int line);
int mLine;
};
struct LogicError : public Error { };
// Actual errors
struct BadInputStreamError : IOError {
void describe(std::ostream& os) const override;
};
struct DuplicateBlockError : ParseError {
DuplicateBlockError(int line, const std::string& block);
void describe(std::ostream& os) const override;
const std::string mBlock;
};
struct NamesBlockBeforeHeadersError : ParseError {
NamesBlockBeforeHeadersError(int line, const std::string& block);
const std::string mMissing;
void describe(std::ostream& os) const override;
};
struct DuplicateTruthTableError : ParseError {
DuplicateTruthTableError(int line, const std::string& name);
const std::string mName;
void describe(std::ostream& os) const override;
};
struct UnrecognizedSectionError : ParseError {
UnrecognizedSectionError(int line, const std::string& section);
void describe(std::ostream& os) const override;
const std::string mSection;
};
struct MissingLogicDependencyError : LogicError {
MissingLogicDependencyError(const std::string& tt, const std::string& name);
const std::string mTruthtable;
const std::string mInput;
void describe(std::ostream& os) const override;
};
struct UndefinedPrimaryOutputError : LogicError {
explicit UndefinedPrimaryOutputError(const std::string& name);
const std::string mOutput;
void describe(std::ostream& os) const override;
};
struct CircularDependencyError : LogicError {
explicit CircularDependencyError(const std::string& name1,
const std::string& name2);
void describe(std::ostream& os) const override;
const std::string mName1, mName2;
};
} // namespace blifverifier
#endif