source: icGREP/icgrep-devel/icgrep/re_cc.h @ 4122

Last change on this file since 4122 was 4026, checked in by cameron, 5 years ago

Sparce -> Sparse

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 RE_CC_H
8#define RE_CC_H
9
10#include "re_re.h"
11
12#include <iostream>
13#include <string>
14#include <sstream>
15#include <utility>
16#include <vector>
17
18
19struct CharSetItem{
20    int lo_codepoint;
21    int hi_codepoint;
22};
23
24class CC : public RE
25{
26public:
27    CC();
28    CC(int codepoint);
29    CC(int lo_codepoint, int hi_codepoint);
30    CC(CC* cc1, CC* cc2);
31    ~CC();
32    std::vector<CharSetItem> getItems();
33    std::string getName();
34    std::string getId();
35    bool is_member(int codepoint);
36    void insert1(int codepoint);
37    void insert_range(int lo_codepoint,int hi_codepoint);
38    void negate_class();
39    void remove1(int codepoint);
40    void remove_range(int lo_codepoint,int hi_codepoint);
41
42protected:
43    static int msCSIidx;
44private:
45    static const int mUnicodeMax = 0x10FFFF;
46
47    void gensym_name();
48    bool is_member_helper(int codepoint, int idx);
49    void joinCharSets(std::vector<CharSetItem> items1);
50    void joinCharSets_helper(std::vector<CharSetItem> items1, int idx);
51    void insert_range_helper(int lo_codepoint, int hi_codepoint, int idx);
52    void negate_class_helper(int idx, int b);
53    void remove_range_helper(int lo_codepoint, int hi_codepoint, int idx);
54
55    std::vector<CharSetItem> mSparseCharSet;
56    std::string mId;
57};
58
59#endif // RE_CC_H
Note: See TracBrowser for help on using the repository browser.