source: icGREP/icgrep-devel/icgrep/pablo/pe_and.h @ 4244

Last change on this file since 4244 was 4244, checked in by lindanl, 5 years ago

Change PabloE to PabloAST.

File size: 1.1 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_AND_H
8#define PE_AND_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class PabloBlock;
15
16class And : public PabloAST {
17    friend struct OptimizeAnd;
18    friend class PabloBlock;
19public:
20    static inline bool classof(const PabloAST * e) {
21        return e->getClassTypeId() == ClassTypeId::And;
22    }
23    static inline bool classof(const void *) {
24        return false;
25    }
26    virtual ~And() {
27    }
28    PabloAST * getExpr1() const {
29        return mExpr1;
30    }
31    PabloAST * getExpr2() const {
32        return mExpr2;
33    }
34protected:
35    And(PabloAST * expr1, PabloAST * expr2)
36    : PabloAST(ClassTypeId::And)
37    , mExpr1(expr1)
38    , mExpr2(expr2)
39    {
40
41    }
42private:
43    PabloAST * const mExpr1;
44    PabloAST * const mExpr2;
45};
46
47struct OptimizeAnd {
48    inline OptimizeAnd(PabloBlock & cg) : cg(cg) {}
49    PabloAST * operator()(PabloAST * expr1, PabloAST * expr2);
50private:
51    PabloBlock & cg;
52};
53
54}
55
56#endif // PE_AND_H
57
58
Note: See TracBrowser for help on using the repository browser.