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

Last change on this file since 4388 was 4358, checked in by cameron, 5 years ago

Clean up various minor issues that generate compiler warnings.

File size: 1.3 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_MATCHSTAR_H
8#define PE_MATCHSTAR_H
9
10#include "pabloAST.h"
11#include <array>
12
13namespace pablo {
14
15class MatchStar : public PabloAST {
16    friend class PabloBlock;
17public:
18    static inline bool classof(const PabloAST * e) {
19        return e->getClassTypeId() == ClassTypeId::MatchStar;
20    }
21    static inline bool classof(const void *) {
22        return false;
23    }
24    virtual ~MatchStar() {
25    }
26    virtual PabloAST * getOperand(const unsigned index) const {
27        assert (index < 2);
28        return mExprs[index];
29    }
30    virtual unsigned getNumOperands() const {
31        return 2;
32    }
33    virtual void setOperand(const unsigned index, PabloAST * value) {
34        assert (index < 2);
35        mExprs[index] = value;
36    }
37    inline PabloAST * getMarker() const {
38        return mExprs[0];
39    }
40    inline PabloAST * getCharClass() const  {
41        return mExprs[1];
42    }
43protected:
44    MatchStar(PabloAST * marker, PabloAST * cc)
45    : PabloAST(ClassTypeId::MatchStar)
46    , mExprs({{marker, cc}})
47    {
48
49    }
50private:
51    std::array<PabloAST*, 2> mExprs;
52};
53
54}
55
56#endif // PE_MATCHSTAR_H
57
58
59
Note: See TracBrowser for help on using the repository browser.