Ignore:
Timestamp:
Dec 23, 2017, 9:16:39 PM (21 months ago)
Author:
cameron
Message:

Additional Alphabet analysis and transformation

Location:
icGREP/icgrep-devel/icgrep/cc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/cc/multiplex_CCs.cpp

    r5800 r5801  
    134134}
    135135   
    136 re::CC * MultiplexedAlphabet::transformCC(re::CC * sourceCC) {
     136re::CC * MultiplexedAlphabet::transformCC(const re::CC * sourceCC) const {
    137137    if (sourceCC->getAlphabet() != mSourceAlphabet) llvm::report_fatal_error("Mismatched source alphabets for transformCC");
    138138   
     
    145145    return CC_union;
    146146}
     147
     148re::CC * MultiplexedAlphabet::invertCC(const re::CC * transformedCC) const {
     149    if (transformedCC->getAlphabet() != this) llvm::report_fatal_error("invertCC applied to non-transformed CC");
     150    re::CC * CC_union = re::makeCC(mSourceAlphabet);
     151    for (const UCD::interval_t i : *transformedCC) {
     152        for (unsigned cp = re::lo_codepoint(i); cp <= re::hi_codepoint(i); cp++) {
     153            CC_union = re::makeCC(mUnicodeSets[cp], CC_union);
     154        }
     155    }
     156    return CC_union;
     157}
     158   
     159
     160   
    147161}
    148162
  • icGREP/icgrep-devel/icgrep/cc/multiplex_CCs.h

    r5800 r5801  
    2727    std::vector<re::CC *> getMultiplexedCCs();
    2828   
    29     re::CC * transformCC(re::CC * sourceCC);
     29    re::CC * transformCC(const re::CC * sourceCC) const;
     30   
     31    re::CC * invertCC(const re::CC * transformedCC) const;
    3032private:
    3133    const Alphabet * mSourceAlphabet;
Note: See TracChangeset for help on using the changeset viewer.