source: icGREP/icgrep-devel/icgrep/pablo/pe_pabloe.h @ 4213

Last change on this file since 4213 was 4213, checked in by nmedfort, 5 years ago

Created internal 'string pool' for Call, CharClass?, Var and Assign pablo classes.

File size: 1.4 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 PE_PABLOE_H
8#define PE_PABLOE_H
9
10#include <llvm/Support/Casting.h>
11
12using namespace llvm;
13
14namespace pablo {
15
16class PabloE
17{
18public:
19    enum class ClassTypeId : unsigned {
20        Advance
21        , All
22        , And
23        , Call
24        , CharClass
25        , MatchStar
26        , Not
27        , Or
28        , ScanThru
29        , Sel
30        , Var
31        , Xor
32        , Assign
33        , If
34        , While
35        , String
36    };
37    inline ClassTypeId getClassTypeId() const {
38        return mClassTypeId;
39    }
40    virtual ~PabloE() = 0;
41protected:
42    inline PabloE(const ClassTypeId id)
43    : mClassTypeId(id) {
44
45    }
46private:
47    const ClassTypeId mClassTypeId;
48};
49
50bool equals(const PabloE * expr1, const PabloE *expr2);
51
52//template <typename To, typename From>
53//inline static bool isa(const From * object) {
54//    return To::classof(object);
55//}
56
57//template <typename To, typename From>
58//inline static To * cast(From * object) {
59//    return reinterpret_cast<To *>(object);
60//}
61
62//template <typename To, typename From>
63//inline static To * dyn_cast(From * object) {
64//    if (isa<To, From>(object)) {
65//        return cast<To, From>(object);
66//    }
67//    return nullptr;
68//}
69
70}
71
72#endif // PE_PABLOE_H
73
74
75
Note: See TracBrowser for help on using the repository browser.