Ignore:
Timestamp:
Oct 3, 2015, 3:31:16 PM (4 years ago)
Author:
nmedfort
Message:

Added union/diff/intersection functionality to RE_Compiler. Removed toUTF8 pass in favour of using the UCD_Compiler.

File:
1 edited

Legend:

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

    r4812 r4814  
    1414CC::CC(const CC * cc1, const CC * cc2)
    1515: RE(ClassTypeId::CC)
    16 , mSparseCharSet(std::move(cc1->mSparseCharSet + cc2->mSparseCharSet)) {
     16, UCD::UnicodeSet(std::move(*cc1 + *cc2)) {
    1717
    1818}
     
    2020CC::CC(const CC & cc)
    2121: RE(ClassTypeId::CC)
    22 , mSparseCharSet(cc.mSparseCharSet) {
     22, UCD::UnicodeSet(cc) {
    2323
    2424}
     
    3333    }
    3434    char separator = '_';
    35     for (const interval_t & i : mSparseCharSet) {
     35    for (const interval_t & i : *this) {
    3636        name << separator;
    3737        if (lo_codepoint(i) == hi_codepoint(i)) {
     
    4545    return name.str();
    4646}
    47 
    48 CC * subtractCC(const CC * a, const CC * b) {
    49     return makeCC(a->mSparseCharSet - b->mSparseCharSet);
    50 }
    51    
    52 CC * intersectCC(const CC * a, const CC * b) {
    53     return makeCC(a->mSparseCharSet & b->mSparseCharSet);
    54 }
    5547   
    5648CC * caseInsensitize(const CC * cc) {
Note: See TracChangeset for help on using the changeset viewer.