source: icGREP/icgrep-devel/icgrep/re/re_range.h @ 6171

Last change on this file since 6171 was 6171, checked in by cameron, 8 months ago

NullablePrefix/Suffix? removal using RE_Transformer; clean out some setters

File size: 866 bytes
Line 
1#ifndef RE_RANGE_H
2#define RE_RANGE_H
3
4#include <re/re_re.h>
5
6//
7// Ranges generally represent CCs, but might not be able to be
8// converted to CCs during parsing, if one or both endpoints are
9// symbolic.   [\N{some name}-\N{some other name}],  [\q(ch)-k]
10namespace re {
11
12class Range : public RE {
13public:
14    static inline bool classof(const RE * re) {
15        return re->getClassTypeId() == ClassTypeId::Range;
16    }
17    static inline bool classof(const void *) {
18        return false;
19    }
20    RE * getLo() const {
21        return mLo;
22    }
23    RE * getHi() const {
24        return mHi;
25    }
26protected:
27    friend RE * makeRange(RE*, RE*);
28    Range(RE * lh, RE * rh)
29    : RE(ClassTypeId::Range)
30    , mLo(lh)
31    , mHi(rh)
32    {
33
34    }
35    virtual ~Range() {}
36private:
37    RE * mLo;
38    RE * mHi;
39};
40
41RE * makeRange(RE * lh, RE * rh);
42}
43
44#endif // RE_RANGE_H
Note: See TracBrowser for help on using the repository browser.