source: icGREP/icgrep-devel/icgrep/pablo/pe_constant.h @ 5160

Last change on this file since 5160 was 5160, checked in by nmedfort, 3 years ago

Initial work for incorporating Types into Pablo AST.

File size: 772 bytes
Line 
1#ifndef PE_CONSTANT_H
2#define PE_CONSTANT_H
3
4#include <pablo/pabloAST.h>
5
6namespace pablo {
7
8class Constant : public PabloAST {
9    friend class PabloBlock;
10public:
11    static inline bool classof(const PabloAST * e) {
12        return e->getClassTypeId() == ClassTypeId::Ones;
13    }
14    static inline bool classof(const void *) {
15        return false;
16    }
17    virtual ~Constant() {
18    }
19    inline bool operator==(const Ones &) const {
20        return true;
21    }
22    virtual bool operator==(const PabloAST & other) const {
23        return isa<Ones>(other);
24    }
25protected:
26    Constant(const PabloType * type, const PabloAST * const value) : Constant(ClassTypeId::Ones, type), mValue(value) { }
27private:
28
29    const PabloAST * const mValue;
30};
31
32}
33
34#endif // PE_CONSTANT_H
Note: See TracBrowser for help on using the repository browser.