source: icGREP/icgrep-devel/icgrep/re/re_rep.h @ 6141

Last change on this file since 6141 was 5991, checked in by cameron, 17 months ago

REs managed by slab allocator

File size: 1.4 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 RE_REP_H
8#define RE_REP_H
9
10#include "re_re.h"
11
[4194]12namespace re {
13
[4187]14class Rep : public RE {
15public:
[4194]16    static inline bool classof(const RE * re) {
17        return re->getClassTypeId() == ClassTypeId::Rep;
18    }
19    static inline bool classof(const void *) {
20        return false;
21    }
[4187]22    enum { UNBOUNDED_REP = -1 };
23    RE * getRE() const;
24    void setRE(RE * re = nullptr);
[4182]25    int getLB() const;
[4194]26    void setLB(const int lb);
[4182]27    int getUB() const;
[4194]28    void setUB(const int ub);
[5991]29    virtual ~Rep() {}
[4194]30protected:
[4203]31    friend RE * makeRep(RE *, const int, const int);
[4194]32    Rep(RE * re, const int lb, const int ub);
[3850]33private:
34    RE* mRE;
35    int mLB;
[3914]36    int mUB;
[3850]37};
38
[4194]39inline Rep::Rep(RE * re, const int lb, const int ub)
40: RE(ClassTypeId::Rep)
41, mRE(re)
[4187]42, mLB(lb)
43, mUB(ub)
44{
45
46}
47
48inline RE * Rep::getRE() const {
49    return mRE;
50}
51
52inline void Rep::setRE(RE * re) {
53    mRE = re;
54}
55
56inline int Rep::getLB() const {
57    return mLB;
58}
59
[4194]60inline void Rep::setLB(const int lb) {
[4187]61    mLB = lb;
62}
63
64inline int Rep::getUB() const {
65    return mUB;
66}
67
[4194]68inline void Rep::setUB(const int ub) {
[4187]69    mUB = ub;
70}
71
[4203]72RE * makeRep(RE * re, const int lower_bound, const int upper_bound);
[5725]73   
74RE * unrollFirst(Rep * re);
[4194]75
[5725]76RE * unrollLast(Rep * re);
77
[4194]78}
79
[3850]80#endif
Note: See TracBrowser for help on using the repository browser.