source: icGREP/icgrep-devel/icgrep/pablo/pe_not.h @ 4272

Last change on this file since 4272 was 4272, checked in by nmedfort, 4 years ago

Implemented slab allocator based on the original Parabix StringPool?; intergrated it with RE and Pablo AST nodes.

File size: 1.1 KB
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PE_NOT_H
8#define PE_NOT_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class PabloBlock;
15
16class Not : public PabloAST {
17    friend struct OptimizeNot;
18    friend class PabloBlock;
19public:
20    static inline bool classof(const PabloAST * e) {
21        return e->getClassTypeId() == ClassTypeId::Not;
22    }
23    static inline bool classof(const void *) {
24        return false;
25    }
26    virtual ~Not() {
27    }
28    PabloAST * getExpr() const {
29        return mExpr;
30    }
31protected:
32    void* operator new (std::size_t size) noexcept {
33        return mAllocator.allocate(size);
34    }
35    Not(PabloAST * expr)
36    : PabloAST(ClassTypeId::Not)
37    , mExpr(expr) {
38
39    }
40private:
41    PabloAST * const mExpr;
42};
43
44struct OptimizeNot {
45    inline OptimizeNot(PabloBlock & cg) : cg(cg) {}
46    PabloAST * operator()(PabloAST * expr);
47private:
48    PabloBlock & cg;
49
50};
51
52}
53
54#endif // PE_NOT_H
55
56
Note: See TracBrowser for help on using the repository browser.