source: icGREP/icgrep-devel/icgrep/pablo/pabloAST.h @ 4272

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

Implemented slab allocator based on the original Parabix StringPool?; intergrated it with RE and Pablo AST nodes.

File size: 1.2 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_PabloAST_H
8#define PE_PabloAST_H
9
10#include <llvm/Support/Casting.h>
11#include <slab_allocator.h>
12#include <vector>
13
14using namespace llvm;
15
16namespace pablo {
17
18class PabloBlock;
19
20class PabloAST {
21public:
22    typedef SlabAllocator<1024> Allocator;
23    enum class ClassTypeId : unsigned {
24        Advance
25        , And
26        , Assign
27        , Call
28        , If
29        , MatchStar
30        , Next
31        , Not
32        , Ones
33        , Or
34        , ScanThru
35        , Sel
36        , String
37        , Var
38        , While
39        , Xor
40        , Zeroes
41    };
42    inline ClassTypeId getClassTypeId() const {
43        return mClassTypeId;
44    }
45    inline static void release_memory() {
46        mAllocator.release_memory();
47    }
48protected:
49    inline PabloAST(const ClassTypeId id)
50    : mClassTypeId(id)
51    {
52
53    }
54    static Allocator mAllocator;
55private:
56    const ClassTypeId   mClassTypeId;
57};
58
59bool equals(const PabloAST * expr1, const PabloAST *expr2);
60
61typedef std::vector<PabloAST *> StatementList;
62
63}
64
65#endif // PE_PabloAST_H
66
67
68
Note: See TracBrowser for help on using the repository browser.