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

Last change on this file was 6226, checked in by cameron, 9 months ago

Clean-up/refactoring step for REs

File size: 660 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    RE * getLo() const {return mLo;}
15    RE * getHi() const {return mHi;}
16    static Range * Create(RE * lh, RE * rh) {return new Range(lh, rh);}
17    RE_SUBTYPE(Range)
18private:
19    Range(RE * lh, RE * rh) : RE(ClassTypeId::Range), mLo(lh), mHi(rh) {}
20    RE * const mLo;
21    RE * const mHi;
22};
23
24RE * makeRange(RE * lh, RE * rh);
25}
26
27#endif // RE_RANGE_H
Note: See TracBrowser for help on using the repository browser.