Inter4ql  5.2
BooleanExpression.h
1 #ifndef __BOOLEANEXPRESSION_H__
2 #define __BOOLEANEXPRESSION_H__
3 
4 #include <vector>
5 #include <stack>
6 
7 namespace Inter4ql {
9  {
10  public:
11  BooleanExpression() {};
12  ~BooleanExpression() {};
13 
14  enum Operation_Type { AND, OR, PLUS, MINUS, MUL, DIV};
15  enum Comparison_Type { EQ, NEQ, GT, GTE, LT, LTE };
16  enum Element_Type { NUMBER, T, F, I, U, ALL, OP, COMP};
17  union data_type {
18  int number;
19  Operation_Type operation;
20  Comparison_Type comparison;
21  };
22  typedef struct bool_elem {
23  Element_Type type;
24  data_type data;
25  } bool_elem;
26 
27  void add_element(Element_Type type, data_type data = {0});
28  int calculate(int i, int t, int f, int u);
29  void add_boolean_expression(BooleanExpression b);
30 
31  private:
32  std::vector<bool_elem> elems;
33  };
34 }
35 
36 #endif
Definition: BooleanExpression.h:17
Definition: Application.cc:37
Definition: BooleanExpression.h:22
Definition: BooleanExpression.h:8