source: icGREP/icgrep-devel/icgrep/cc/cc_namemap.hpp @ 4712

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

Moved responsibility of handling 'special cases of Unicode TR #18' and 'compatibility properties of UTR #18 Annex C' into RE_Parser.

File size: 1010 bytes
Line 
1#ifndef CC_NAMER_HPP
2#define CC_NAMER_HPP
3
4#include <unordered_map>
5#include <vector>
6#include <string>
7#include "re/re_name.h"
8#include "re/re_cc.h"
9
10
11namespace cc {
12
13class CC_NameMap {
14public:
15
16    typedef std::unordered_map<std::string, re::Name *>          NameMap;
17    typedef std::vector<re::Name*>                              NameVector;
18    typedef NameVector::const_iterator                          iterator;
19
20    CC_NameMap() {}
21
22    re::RE * process(re::RE * re, const re::CC_type t);
23
24    inline iterator begin() const {
25        return mNameVector.begin();
26    }
27
28    inline iterator end() const {
29        return mNameVector.end();
30    }
31
32    std::string printMap();
33   
34private:
35
36    inline re::Name * insert(NameMap::key_type && name, re::Name * re) {
37        mNameMap.insert(std::make_pair(std::move(name), re));
38        mNameVector.push_back(re);
39        return re;
40    }
41
42private:
43    NameMap                 mNameMap;
44    NameVector              mNameVector;
45};
46
47}
48
49#endif // CC_NAMER_HPP
Note: See TracBrowser for help on using the repository browser.