Ignore:
Timestamp:
Dec 21, 2017, 3:22:41 PM (15 months ago)
Author:
cameron
Message:

Adding Alphabet to CCs: initial check-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_cc.cpp

    r5781 r5795  
    3333}
    3434   
    35 CC::CC()
     35CC::CC(const cc::Alphabet * alphabet)
    3636: RE(ClassTypeId::CC)
    37 , UnicodeSet() {
     37, UnicodeSet()
     38, mAlphabet(alphabet) {}
    3839
    39 }
    4040
    4141CC::CC(const CC & cc)
    4242: RE(ClassTypeId::CC)
    43 , UCD::UnicodeSet(cc) {
     43, UCD::UnicodeSet(cc)
     44, mAlphabet(cc.getAlphabet()) {}
    4445
    45 }
    4646
    47 CC::CC(const codepoint_t codepoint)
     47CC::CC(const codepoint_t codepoint, const cc::Alphabet * alphabet)
    4848: RE(ClassTypeId::CC)
    49 , UCD::UnicodeSet(codepoint) {
     49, UCD::UnicodeSet(codepoint)
     50, mAlphabet(alphabet) {}
    5051
    51 }
    5252
    53 CC::CC(const codepoint_t lo_codepoint, const codepoint_t hi_codepoint)
     53CC::CC(const codepoint_t lo_codepoint, const codepoint_t hi_codepoint, const cc::Alphabet * alphabet)
    5454: RE(ClassTypeId::CC)
    55 , UCD::UnicodeSet(lo_codepoint, hi_codepoint) {
     55, UCD::UnicodeSet(lo_codepoint, hi_codepoint)
     56, mAlphabet(alphabet) {}
    5657
    57 }
    5858
    5959CC::CC(const CC * cc1, const CC * cc2)
    6060: RE(ClassTypeId::CC)
    61 , UCD::UnicodeSet(std::move(*cc1 + *cc2)) {
     61, UCD::UnicodeSet(std::move(*cc1 + *cc2))
     62, mAlphabet(cc1->getAlphabet()) {
     63    assert (cc1->getAlphabet() == cc2->getAlphabet());
     64}
     65
     66
     67CC::CC(const UCD::UnicodeSet && set, const cc::Alphabet * alphabet)
     68: RE(ClassTypeId::CC)
     69, UCD::UnicodeSet(std::move(set))
     70, mAlphabet(alphabet) {}
     71
     72
     73CC::CC(std::initializer_list<interval_t>::iterator begin, std::initializer_list<interval_t>::iterator end, const cc::Alphabet * alphabet)
     74: RE(ClassTypeId::CC)
     75, UCD::UnicodeSet(begin, end)
     76, mAlphabet(alphabet) {}
     77
     78
     79CC::CC(const std::vector<interval_t>::iterator begin, const std::vector<interval_t>::iterator end, const cc::Alphabet * alphabet)
     80: RE(ClassTypeId::CC)
     81, UCD::UnicodeSet(begin, end)
     82, mAlphabet(alphabet) {}
    6283
    6384}
    64 
    65 CC::CC(const UCD::UnicodeSet && set)
    66 : RE(ClassTypeId::CC)
    67 , UCD::UnicodeSet(std::move(set)) {
    68 
    69 }
    70 
    71 CC::CC(std::initializer_list<interval_t>::iterator begin, std::initializer_list<interval_t>::iterator end)
    72 : RE(ClassTypeId::CC)
    73 , UCD::UnicodeSet(begin, end)
    74 {
    75 
    76 }
    77 
    78 CC::CC(const std::vector<interval_t>::iterator begin, const std::vector<interval_t>::iterator end)
    79 : RE(ClassTypeId::CC)
    80 , UCD::UnicodeSet(begin, end)
    81 {
    82 
    83 }
    84 
    85 }
Note: See TracChangeset for help on using the changeset viewer.