-
Notifications
You must be signed in to change notification settings - Fork 11
/
MBAChecker.h
78 lines (42 loc) · 1.29 KB
/
MBAChecker.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
#ifndef MBACHECKER_H
#define MBACHECKER_H
#include <string>
namespace LSiMBA {
enum ExpressionType { bitwise = 0, arithmetic = 1, mixed = 2 };
class MBAChecker {
public:
MBAChecker();
bool check_expression(const std::string &expression);
bool check_inclusive_disjunction(ExpressionType &ExprType);
bool check_exclusive_disjunction(ExpressionType &ExprType);
bool check_conjunction(ExpressionType &ExprType);
bool check_sum(ExpressionType &ExprType);
bool check_product(ExpressionType &ExprType);
bool check_factor(ExpressionType &ExprType);
bool check_bitwise_negated_expression(ExpressionType &ExprType);
bool check_negative_expression(ExpressionType &ExprType);
bool check_terminal(ExpressionType &ExprType);
bool check_variable();
bool check_constant();
bool check_binary_constant();
bool check_hex_constant();
bool check_decimal_constant();
char get();
void skip_space();
char peek();
bool has_bitwise_negated_expression();
bool has_negative_expression();
bool has_binary_constant();
bool has_hex_constant();
bool has_hex_digit();
bool has_decimal_digit();
bool has_variable();
bool has_letter();
bool has_space();
char peek_next();
private:
int idx;
std::string expr;
};
} // namespace LSiMBA
#endif // MBACHECKER_H