c86c6c2a0c26b26e32a2693dbf3cd27c5864ed47
[satune.git] / src / AST / predicate.h
1 #ifndef PREDICATE_H
2 #define PREDICATE_H
3 #include "classlist.h"
4 #include "mymemory.h"
5 #include "ops.h"
6 #include "structs.h"
7
8 #define GETPREDICATETYPE(o) (((Predicate *)(o))->type)
9
10 class Predicate {
11 public:
12         Predicate(PredicateType _type) : type(_type) {}
13         virtual ~Predicate() {}
14         virtual Predicate * clone(CloneMap *map);
15         PredicateType type;
16         MEMALLOC;
17 };
18
19 class PredicateOperator : public Predicate {
20 public:
21         PredicateOperator(CompOp op, Set **domain, uint numDomain);
22         bool evalPredicateOperator(uint64_t *inputs);
23         Predicate * clone(CloneMap *map);
24         CompOp op;
25         Array<Set *> domains;
26         MEMALLOC;
27 };
28
29 class PredicateTable : public Predicate {
30 public:
31         PredicateTable(Table *table, UndefinedBehavior undefBehavior);
32         Predicate * clone(CloneMap *map);
33         Table *table;
34         UndefinedBehavior undefinedbehavior;
35         MEMALLOC;
36 };
37 #endif