source: icGREP/icgrep-devel/icgrep/re/re_start.h @ 4272

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

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

File size: 777 bytes
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 START_H
8#define START_H
9
10#include <re/re_re.h>
11
12namespace re {
13
14class Start : public RE {
15public:
16    static inline bool classof(const RE * re) {
17        return re->getClassTypeId() == ClassTypeId::Start;
18    }
19    static inline bool classof(const void *) {
20        return false;
21    }
22protected:
23    friend Start * makeStart();
24    void* operator new (std::size_t size) noexcept {
25        return mAllocator.allocate(size);
26    }
27    Start() : RE(ClassTypeId::Start) {}
28    virtual ~Start() {}
29};
30
31inline Start * makeStart() {
32    return new Start();
33}
34
35}
36
37#endif // START_H
38
Note: See TracBrowser for help on using the repository browser.