source: icGREP/icgrep-devel/icgrep/pablo/pe_advance.h @ 4388

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

Initial stage of pablo metadata inclusion.

File size: 1.2 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    virtual PabloAST * getOperand(const unsigned index) const {
26        assert (index == 0);
27        return mExpr;
28    }
29    virtual void setOperand(const unsigned index, PabloAST * value) {
30        assert (index == 0);
31        mExpr = value;
32    }
33    virtual unsigned getNumOperands() const {
34        return 1;
35    }
36    inline PabloAST * getExpr() const {
37        return mExpr;
38    }
39    inline int getAdvanceAmount() const {
40        return mShiftAmount;
41    }
42protected:
43    Advance(PabloAST * expr, int shiftAmount)
44    : PabloAST(ClassTypeId::Advance)
45    , mExpr(expr)
46        , mShiftAmount(shiftAmount) {
47
48    }
49private:
50    PabloAST * mExpr;
51        int const mShiftAmount;
52};
53
54}
55
56#endif // PE_ADVANCE_H
57
58
59
Note: See TracBrowser for help on using the repository browser.