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

Last change on this file since 6184 was 6173, checked in by nmedfort, 9 months ago

Added RE_Inspector.

Migrated RE passes to RE_Transformer.

Incorporated Memoizer functionality into RE_Transformer/Inspector.

Removed Memoizer.

Bug fix for unicode_set.

File size: 879 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    }
26
27protected:
28    friend RE * makeRange(RE*, RE*);
29    Range(RE * lh, RE * rh)
30    : RE(ClassTypeId::Range)
31    , mLo(lh)
32    , mHi(rh)
33    {
34
35    }
36    virtual ~Range() {}
37private:
38    RE * const mLo;
39    RE * const mHi;
40};
41
42RE * makeRange(RE * lh, RE * rh);
43}
44
45#endif // RE_RANGE_H
Note: See TracBrowser for help on using the repository browser.