Ignore:
Timestamp:
Jan 29, 2018, 1:08:42 PM (21 months ago)
Author:
cameron
Message:

Unify Parabix CC compiler and Direct CC compiler with a common superclass

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.cpp

    r5842 r5847  
    148148    CC *  suffix = makeByte(0x80, 0xBF);
    149149    assert (!suffix->empty());
    150     mSuffixVar = mCharacterClassCompiler.compileCC(suffix, entry);
     150    mSuffixVar = mCodeUnitCompiler.compileCC(suffix, entry);
    151151    generateRange(ifRanges, 0, UNICODE_MAX, entry);
    152152}
     
    257257            // We have a single byte remaining to match for all code points in this CC.
    258258            // Use the byte class compiler to generate matches for these codepoints.
    259             PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(byteDefinitions(ranges, byte_no, isUTF_16), &Byte), builder);
     259            PabloAST * var = mCodeUnitCompiler.compileCC(makeCC(byteDefinitions(ranges, byte_no, isUTF_16), &Byte), builder);
    260260            if (byte_no > 1) {
    261261                var = builder.createAnd(var, builder.createAdvance(makePrefix(lo, byte_no, builder, prefix), 1));
     
    279279                        target = sequenceGenerator(mid, hi, byte_no, builder, target, prefix);
    280280                    } else { // we have a prefix group of type (a)
    281                         PabloAST * var = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     281                        PabloAST * var = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    282282                        if (byte_no > 1) {
    283283                            var = builder.createAnd(builder.createAdvance(prefix, 1), var);
     
    289289                    }
    290290                } else { // lbyte == hbyte
    291                     PabloAST * var = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     291                    PabloAST * var = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    292292                    if (byte_no > 1) {
    293293                        var = builder.createAnd(builder.createAdvance(prefix ? prefix : var, 1), var);
     
    335335            }
    336336        }
    337         PabloAST * cc = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     337        PabloAST * cc = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    338338        target = builder.createAnd(cc, target);
    339339    } else if (lo_byte == hi_byte) {
    340         PabloAST * cc = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
     340        PabloAST * cc = mCodeUnitCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    341341        target = builder.createAnd(cc, target);
    342342        target = builder.createAdvance(target, 1);
     
    369369    for (unsigned i = 1; i != byte_no; ++i) {
    370370        const CC * const cc = makeByte(encodingByte(cp, i, isUTF_16));
    371         PabloAST * var = mCharacterClassCompiler.compileCC(cc, builder);
     371        PabloAST * var = mCodeUnitCompiler.compileCC(cc, builder);
    372372        if (i > 1) {
    373373            var = builder.createAnd(var, builder.createAdvance(prefix, 1));
     
    537537 ** ------------------------------------------------------------------------------------------------------------- */
    538538UCDCompiler::UCDCompiler(cc::CC_Compiler & ccCompiler)
    539 : mCharacterClassCompiler(ccCompiler)
     539: mCodeUnitCompiler(ccCompiler)
    540540, mSuffixVar(nullptr) { }
    541541
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.hpp

    r5748 r5847  
    8181
    8282private:
    83     cc::CC_Compiler &       mCharacterClassCompiler;
     83    cc::CC_Compiler &       mCodeUnitCompiler;
    8484    PabloAST *              mSuffixVar;
    8585    TargetMap               mTarget;
Note: See TracChangeset for help on using the changeset viewer.