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

Last change on this file since 4244 was 4244, checked in by lindanl, 4 years ago

Change PabloE to PabloAST.

File size: 984 bytes
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    Not(PabloAST * expr)
33    : PabloAST(ClassTypeId::Not)
34    , mExpr(expr) {
35
36    }
37private:
38    PabloAST * const mExpr;
39};
40
41struct OptimizeNot {
42    inline OptimizeNot(PabloBlock & cg) : cg(cg) {}
43    PabloAST * operator()(PabloAST * expr);
44private:
45    PabloBlock & cg;
46
47};
48
49}
50
51#endif // PE_NOT_H
52
53
Note: See TracBrowser for help on using the repository browser.