source: icGREP/icgrep-devel/icgrep/pablo/pe_charclass.h @ 4214

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

Partial implementation of 'PabloBuilder?'.

File size: 1.0 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_CHARCLASS_H
8#define PE_CHARCLASS_H
9
10#include <pablo/pe_pabloe.h>
11#include <pablo/pe_string.h>
12
13namespace pablo {
14
15class CharClass : public PabloE {
16    friend CharClass * makeCharClass(const String *);
17    friend struct CodeGenState;
18public:
19    static inline bool classof(const PabloE * e) {
20        return e->getClassTypeId() == ClassTypeId::CharClass;
21    }
22    static inline bool classof(const void *) {
23        return false;
24    }
25    virtual ~CharClass(){
26    }
27    inline const std::string & getCharClass() const {
28        return *mCharClass;
29    }
30protected:
31    CharClass(const PabloE * cc)
32    : PabloE(ClassTypeId::CharClass)
33    , mCharClass(cast<String>(cc))
34    {
35
36    }
37private:
38    const String * const mCharClass;
39};
40
41inline CharClass * makeCharClass(const String * cc) {
42    return new CharClass(cc);
43}
44
45}
46
47#endif // PE_CHARCLASS_H
48
49
Note: See TracBrowser for help on using the repository browser.