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

Use Alphabet=Byte in to_utf8, u8u32, UCD compiler

File:
1 edited

Legend:

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

    r5748 r5798  
    11#include "ucd_compiler.hpp"
     2#include <cc/alphabet.h>
    23#include <cc/cc_compiler.h>
    34#include <UCD/unicode_set.h>
     
    145146    // Pregenerate the suffix var outside of the if ranges. The DCE pass will either eliminate it if it's not used or the
    146147    // code sinking pass will move appropriately into an inner if block.
    147     CC *  suffix = makeCC(0x80, 0xBF);
     148    CC *  suffix = makeByte(0x80, 0xBF);
    148149    assert (!suffix->empty());
    149150    mSuffixVar = mCharacterClassCompiler.compileCC(suffix, entry);
     
    256257            // We have a single byte remaining to match for all code points in this CC.
    257258            // Use the byte class compiler to generate matches for these codepoints.
    258             PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(byteDefinitions(ranges, byte_no, isUTF_16)), builder);
     259            PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(byteDefinitions(ranges, byte_no, isUTF_16), &Byte), builder);
    259260            if (byte_no > 1) {
    260261                var = builder.createAnd(var, builder.createAdvance(makePrefix(lo, byte_no, builder, prefix), 1));
     
    278279                        target = sequenceGenerator(mid, hi, byte_no, builder, target, prefix);
    279280                    } else { // we have a prefix group of type (a)
    280                         PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(lo_byte, hi_byte), builder);
     281                        PabloAST * var = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    281282                        if (byte_no > 1) {
    282283                            var = builder.createAnd(builder.createAdvance(prefix, 1), var);
     
    288289                    }
    289290                } else { // lbyte == hbyte
    290                     PabloAST * var = mCharacterClassCompiler.compileCC(makeCC(lo_byte, hi_byte), builder);
     291                    PabloAST * var = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    291292                    if (byte_no > 1) {
    292293                        var = builder.createAnd(builder.createAdvance(prefix ? prefix : var, 1), var);
     
    334335            }
    335336        }
    336         PabloAST * cc = mCharacterClassCompiler.compileCC(makeCC(lo_byte, hi_byte), builder);
     337        PabloAST * cc = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    337338        target = builder.createAnd(cc, target);
    338339    } else if (lo_byte == hi_byte) {
    339         PabloAST * cc = mCharacterClassCompiler.compileCC(makeCC(lo_byte, hi_byte), builder);
     340        PabloAST * cc = mCharacterClassCompiler.compileCC(makeByte(lo_byte, hi_byte), builder);
    340341        target = builder.createAnd(cc, target);
    341342        target = builder.createAdvance(target, 1);
     
    367368    bool isUTF_16 = mCharacterClassCompiler.isUTF_16();
    368369    for (unsigned i = 1; i != byte_no; ++i) {
    369         const CC * const cc = makeCC(encodingByte(cp, i, isUTF_16));
     370        const CC * const cc = makeByte(encodingByte(cp, i, isUTF_16));
    370371        PabloAST * var = mCharacterClassCompiler.compileCC(cc, builder);
    371372        if (i > 1) {
Note: See TracChangeset for help on using the changeset viewer.