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
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_ADVANCE_H
8#define PE_ADVANCE_H
9
[4244]10#include "pabloAST.h"
[3850]11
[4199]12namespace pablo {
13
[4244]14class Advance : public PabloAST {
[4227]15    friend class PabloBlock;
[3850]16public:
[4244]17    static inline bool classof(const PabloAST * e) {
[4200]18        return e->getClassTypeId() == ClassTypeId::Advance;
[4199]19    }
[4200]20    static inline bool classof(const void *) {
21        return false;
22    }
[4199]23    virtual ~Advance() {
24    }
[4280]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    }
[4244]36    inline PabloAST * getExpr() const {
[4199]37        return mExpr;
38    }
[4260]39    inline int getAdvanceAmount() const {
40        return mShiftAmount;
41    }
[4200]42protected:
[4260]43    Advance(PabloAST * expr, int shiftAmount)
[4244]44    : PabloAST(ClassTypeId::Advance)
[4260]45    , mExpr(expr)
46        , mShiftAmount(shiftAmount) {
[4199]47
[4200]48    }
[3850]49private:
[4280]50    PabloAST * mExpr;
[4260]51        int const mShiftAmount;
[3850]52};
53
[4199]54}
55
[3850]56#endif // PE_ADVANCE_H
57
58
59
Note: See TracBrowser for help on using the repository browser.