Ignore:
Timestamp:
Dec 21, 2017, 9:01:44 PM (17 months ago)
Author:
cameron
Message:

makeByte uses the Byte alphabet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5757 r5797  
    9292
    9393    // The logic for processing non-ASCII bytes will be embedded within an if-hierarchy.
    94     PabloAST * nonASCII = ccc.compileCC(re::makeCC(0x80, 0xFF));
     94    PabloAST * nonASCII = ccc.compileCC(re::makeByte(0x80, 0xFF));
    9595
    9696    // Builder for the if statement handling all non-ASCII logic
     
    105105
    106106    // Entry condition for 3 or 4 byte sequences: we have a prefix byte in the range 0xE0-0xFF.
    107     PabloAST * pfx34 = ccc.compileCC(re::makeCC(0xE0, 0xFF), nAb);
     107    PabloAST * pfx34 = ccc.compileCC(re::makeByte(0xE0, 0xFF), nAb);
    108108    // Builder for the if statement handling all logic for 3- and 4-byte sequences.
    109109    PabloBuilder p34b = PabloBuilder::Create(nAb);
     
    124124    //
    125125    // Entry condition  or 4 byte sequences: we have a prefix byte in the range 0xF0-0xFF.
    126     PabloAST * pfx4 = ccc.compileCC(re::makeCC(0xF0, 0xFF), p34b);
     126    PabloAST * pfx4 = ccc.compileCC(re::makeByte(0xF0, 0xFF), p34b);
    127127    // Builder for the if statement handling all logic for 4-byte sequences only.
    128128    PabloBuilder p4b = PabloBuilder::Create(p34b);
    129129    // Illegal 4-byte sequences
    130     PabloAST * F0 = ccc.compileCC(re::makeCC(0xF0), p4b);
    131     PabloAST * F4 = ccc.compileCC(re::makeCC(0xF4), p4b);
    132     PabloAST * F0_err = p4b.createAnd(p4b.createAdvance(F0, 1), ccc.compileCC(re::makeCC(0x80, 0x8F), p4b));
    133     PabloAST * F4_err = p4b.createAnd(p4b.createAdvance(F4, 1), ccc.compileCC(re::makeCC(0x90, 0xBF), p4b));
    134     PabloAST * F5_FF = ccc.compileCC(re::makeCC(0xF5, 0xFF), p4b);
     130    PabloAST * F0 = ccc.compileCC(re::makeByte(0xF0), p4b);
     131    PabloAST * F4 = ccc.compileCC(re::makeByte(0xF4), p4b);
     132    PabloAST * F0_err = p4b.createAnd(p4b.createAdvance(F0, 1), ccc.compileCC(re::makeByte(0x80, 0x8F), p4b));
     133    PabloAST * F4_err = p4b.createAnd(p4b.createAdvance(F4, 1), ccc.compileCC(re::makeByte(0x90, 0xBF), p4b));
     134    PabloAST * F5_FF = ccc.compileCC(re::makeByte(0xF5, 0xFF), p4b);
    135135
    136136    Var * FX_err = p34b.createVar("FX_err", zeroes);
     
    181181    // Combined logic for 3 and 4 byte sequences
    182182    //
    183     PabloAST * pfx3 = ccc.compileCC(re::makeCC(0xE0, 0xEF), p34b);
     183    PabloAST * pfx3 = ccc.compileCC(re::makeByte(0xE0, 0xEF), p34b);
    184184
    185185    p34b.createAssign(u8scope32, p34b.createAdvance(pfx3, 1));
     
    187187
    188188    // Illegal 3-byte sequences
    189     PabloAST * E0 = ccc.compileCC(re::makeCC(0xE0), p34b);
    190     PabloAST * ED = ccc.compileCC(re::makeCC(0xED), p34b);
    191     PabloAST * E0_err = p34b.createAnd(p34b.createAdvance(E0, 1), ccc.compileCC(re::makeCC(0x80, 0x9F), p34b));
    192     PabloAST * ED_err = p34b.createAnd(p34b.createAdvance(ED, 1), ccc.compileCC(re::makeCC(0xA0, 0xBF), p34b));
     189    PabloAST * E0 = ccc.compileCC(re::makeByte(0xE0), p34b);
     190    PabloAST * ED = ccc.compileCC(re::makeByte(0xED), p34b);
     191    PabloAST * E0_err = p34b.createAnd(p34b.createAdvance(E0, 1), ccc.compileCC(re::makeByte(0x80, 0x9F), p34b));
     192    PabloAST * ED_err = p34b.createAnd(p34b.createAdvance(ED, 1), ccc.compileCC(re::makeByte(0xA0, 0xBF), p34b));
    193193    Var * EX_FX_err = nAb.createVar("EX_FX_err", zeroes);
    194194
     
    217217    Var * u8lastscope = main.createVar("u8lastscope", zeroes);
    218218
    219     PabloAST * pfx2 = ccc.compileCC(re::makeCC(0xC0, 0xDF), nAb);
     219    PabloAST * pfx2 = ccc.compileCC(re::makeByte(0xC0, 0xDF), nAb);
    220220    PabloAST * u8scope22 = nAb.createAdvance(pfx2, 1);
    221221    nAb.createAssign(u8lastscope, nAb.createOr(u8scope22, nAb.createOr(u8scope33, u8scope44)));
    222222    PabloAST * u8anyscope = nAb.createOr(u8lastscope, p34del);
    223223
    224     PabloAST * C0_C1_err = ccc.compileCC(re::makeCC(0xC0, 0xC1), nAb);
    225     PabloAST * scope_suffix_mismatch = nAb.createXor(u8anyscope, ccc.compileCC(re::makeCC(0x80, 0xBF), nAb));
     224    PabloAST * C0_C1_err = ccc.compileCC(re::makeByte(0xC0, 0xC1), nAb);
     225    PabloAST * scope_suffix_mismatch = nAb.createXor(u8anyscope, ccc.compileCC(re::makeByte(0x80, 0xBF), nAb));
    226226    nAb.createAssign(error_mask, nAb.createOr(scope_suffix_mismatch, nAb.createOr(C0_C1_err, EX_FX_err)));
    227     nAb.createAssign(delmask, nAb.createOr(p34del, ccc.compileCC(re::makeCC(0xC0, 0xFF), nAb)));
     227    nAb.createAssign(delmask, nAb.createOr(p34del, ccc.compileCC(re::makeByte(0xC0, 0xFF), nAb)));
    228228
    229229    // The low 3 bits of the high byte of the UTF-16 code unit as well as the high bit of the
     
    241241    //
    242242    //
    243     PabloAST * ASCII = ccc.compileCC(re::makeCC(0x0, 0x7F));
     243    PabloAST * ASCII = ccc.compileCC(re::makeByte(0x0, 0x7F));
    244244    PabloAST * last_byte = main.createOr(ASCII, u8lastscope);
    245245    main.createAssign(u16_lo[1], main.createOr(main.createAnd(ASCII, u8_bits[1]), p234_lo1));
Note: See TracChangeset for help on using the changeset viewer.