source: icGREP/icgrep-devel/icgrep/re/re_re.h @ 4251

Last change on this file since 4251 was 4251, checked in by nmedfort, 4 years ago

Removed empty cpp files and updated CMakeList.txt.

File size: 2.1 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 RE_H
8#define RE_H
9
10#include <vector>
11#include <assert.h>
12#include <llvm/Support/Casting.h>
13
14using namespace llvm;
15
16namespace re {
17
18class Vector;
19class Pair;
20
21class Alt;
22class Any;
23class CC;
24class Diff;
25class End;
26class Intersect;
27class Name;
28class Permute;
29class Rep;
30class Seq;
31class Start;
32class SymDiff;
33class Union;
34
35class RE {
36public:
37    enum class ClassTypeId : unsigned {
38        Alt
39        , Any
40        , CC
41        , Diff
42        , End
43        , Intersect
44        , Name
45        , Permute
46        , Rep
47        , Seq
48        , Start
49        , SymDiff
50        , Union
51    };
52    inline ClassTypeId getClassTypeId() const {
53        return mClassTypeId;
54    }
55    typedef std::initializer_list<RE *> InitializerList;
56protected:
57    inline RE(const ClassTypeId id)
58    : mClassTypeId(id) {
59
60    }
61    const ClassTypeId mClassTypeId;
62};
63
64class Vector : public RE, public std::vector<RE*> {
65public:
66    virtual ~Vector() {
67    }
68protected:
69    inline Vector(const ClassTypeId id)
70    : RE(id)
71    , std::vector<RE*>()
72    {
73
74    }
75    inline Vector(const ClassTypeId id, const iterator begin, const iterator end)
76    : RE(id)
77    , std::vector<RE*>(begin, end) {
78
79    }
80};
81
82//class Pair : public RE {
83//protected:
84//    inline Pair(const ClassTypeId id)
85//    : RE(id)
86//    , _lh(nullptr)
87//    , _rh(nullptr)
88//    {
89
90//    }
91//    inline Pair(const ClassTypeId id, const RE * lh, const RE * rh)
92//    : RE(id)
93//    , _lh(lh)
94//    , _rh(rh)
95//    {
96
97//    }
98//    virtual ~Pair() {
99//    }
100//protected:
101//    const RE * _lh;
102//    const RE * _rh;
103//};
104
105//static Diff * makeDiff(const RE * lh, const RE * rh);
106
107//static Intersect * makeIntersect(const RE * lh, const RE * rh);
108
109//static Permute * makePermute();
110//static Permute * makePermute(Vector::iterator begin, Vector::iterator end);
111
112//static SymDiff * makeSymDiff(const RE * lh, const RE * rh);
113
114//static Union * makeUnion(const RE * lh, const RE * rh);
115
116}
117
118#endif // RE_H
119
120
Note: See TracBrowser for help on using the repository browser.