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

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

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

File size: 1.1 KB
RevLine 
[3850]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
[4244]10#include <pablo/pabloAST.h>
[3850]11
[4199]12namespace pablo {
13
[4227]14class PabloBlock;
[4214]15
[4244]16class Not : public PabloAST {
[4214]17    friend struct OptimizeNot;
[4227]18    friend class PabloBlock;
[3850]19public:
[4244]20    static inline bool classof(const PabloAST * e) {
[4200]21        return e->getClassTypeId() == ClassTypeId::Not;
[4199]22    }
[4200]23    static inline bool classof(const void *) {
24        return false;
25    }
[4214]26    virtual ~Not() {
[4199]27    }
[4244]28    PabloAST * getExpr() const {
[4199]29        return mExpr;
30    }
[4200]31protected:
[4272]32    void* operator new (std::size_t size) noexcept {
33        return mAllocator.allocate(size);
34    }
[4244]35    Not(PabloAST * expr)
36    : PabloAST(ClassTypeId::Not)
[4200]37    , mExpr(expr) {
[4199]38
39    }
[3850]40private:
[4244]41    PabloAST * const mExpr;
[3850]42};
[4215]43
[4214]44struct OptimizeNot {
[4220]45    inline OptimizeNot(PabloBlock & cg) : cg(cg) {}
[4244]46    PabloAST * operator()(PabloAST * expr);
[4214]47private:
[4220]48    PabloBlock & cg;
[3850]49
[4214]50};
[4215]51
[4199]52}
53
[3850]54#endif // PE_NOT_H
55
56
Note: See TracBrowser for help on using the repository browser.