source: icGREP/icgrep-devel/icgrep/pablo/pe_advance.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.0 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_ADVANCE_H
8#define PE_ADVANCE_H
9
10#include "pabloAST.h"
11
12namespace pablo {
13
14class Advance : public PabloAST {
15    friend class PabloBlock;
16public:
17    static inline bool classof(const PabloAST * e) {
18        return e->getClassTypeId() == ClassTypeId::Advance;
19    }
20    static inline bool classof(const void *) {
21        return false;
22    }
23    virtual ~Advance() {
24    }
25    inline PabloAST * getExpr() const {
26        return mExpr;
27    }
28    inline int getAdvanceAmount() const {
29        return mShiftAmount;
30    }
31protected:
32    void* operator new (std::size_t size) noexcept {
33        return mAllocator.allocate(size);
34    }
35    Advance(PabloAST * expr, int shiftAmount)
36    : PabloAST(ClassTypeId::Advance)
37    , mExpr(expr)
38        , mShiftAmount(shiftAmount) {
39
40    }
41private:
42    PabloAST * const mExpr;
43        int const mShiftAmount;
44};
45
46}
47
48#endif // PE_ADVANCE_H
49
50
51
Note: See TracBrowser for help on using the repository browser.