Changeset 4255


Ignore:
Timestamp:
Oct 21, 2014, 9:54:49 AM (3 years ago)
Author:
nmedfort
Message:

Added Diff to RE Compiler/Parser?. Removed CC.negate()

Location:
icGREP/icgrep-devel/icgrep
Files:
1 added
13 edited

Legend:

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

    r4252 r4255  
    55#include <re/re_seq.h>
    66#include <re/re_rep.h>
    7 
     7#include <re/re_diff.h>
    88#include <re/printer_re.h>
    99#include <iostream>
     
    3737        rep->setRE(process(rep->getRE()));
    3838    }
     39    else if (Diff * diff = dyn_cast<Diff>(re)) {
     40        diff->setRH(process(diff->getRH()));
     41        diff->setLH(process(diff->getLH()));
     42    }
    3943    else if (Name * name = dyn_cast<Name>(re)) {
    4044        RE * cc = name->getCC();
  • icGREP/icgrep-devel/icgrep/icgrep-devel.files

    r4252 r4255  
    221221pablo/symbol_generator.cpp
    222222pablo/symbol_generator.h
     223re/re_diff.h
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.cpp

    r4254 r4255  
    1111/// UNARY CREATE FUNCTIONS
    1212
    13 Advance * PabloBlock::createAdvance(PabloAST * expr) {
     13PabloAST * PabloBlock::createAdvance(PabloAST * expr) {
     14//    if (isa<Zeroes>(expr)) {
     15//        return createZeroes();
     16//    }
    1417    return mUnary.findOrMake<Advance>(PabloAST::ClassTypeId::Advance, expr);
    1518}
     
    2023
    2124PabloAST * PabloBlock::createNot(PabloAST * expr) {
     25//    if (isa<Zeroes>(expr)) {
     26//        return createOnes();
     27//    }
     28//    else if (isa<Ones>(expr)) {
     29//        return createZeroes();
     30//    }
    2231    return mUnary.findOrCall<OptimizeNot>(PabloAST::ClassTypeId::Not, expr);
    2332}
     
    3544}
    3645
    37 MatchStar * PabloBlock::createMatchStar(PabloAST * marker, PabloAST * charclass) {
     46PabloAST * PabloBlock::createMatchStar(PabloAST * marker, PabloAST * charclass) {
     47//    if (isa<Zeroes>(marker)) {
     48//        return createZeroes();
     49//    }
     50//    else if (isa<Zeroes>(charclass)) {
     51//        return marker;
     52//    }
    3853    return mBinary.findOrMake<MatchStar>(PabloAST::ClassTypeId::MatchStar, marker, charclass);
    3954}
    4055
    41 ScanThru * PabloBlock::createScanThru(PabloAST * from, PabloAST * thru) {
     56PabloAST * PabloBlock::createScanThru(PabloAST * from, PabloAST * thru) {
     57//    if (isa<Zeroes>(from)) {
     58//        return createZeroes();
     59//    }
     60//    else if (isa<Zeroes>(thru)) {
     61//        return marker;
     62//    }
    4263    return mBinary.findOrMake<ScanThru>(PabloAST::ClassTypeId::ScanThru, from, thru);
    4364}
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.h

    r4254 r4255  
    6161    }
    6262
    63     Advance * createAdvance(PabloAST * expr);
     63    PabloAST * createAdvance(PabloAST * expr);
    6464
    6565    inline Zeroes * createZeroes() const {
     
    114114    PabloAST * createXor(PabloAST * expr1, PabloAST * expr2);
    115115
    116     MatchStar * createMatchStar(PabloAST * marker, PabloAST * charclass);
    117 
    118     ScanThru * createScanThru(PabloAST * from, PabloAST * thru);
     116    PabloAST * createMatchStar(PabloAST * marker, PabloAST * charclass);
     117
     118    PabloAST * createScanThru(PabloAST * from, PabloAST * thru);
    119119
    120120    PabloAST * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr);
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r4254 r4255  
    297297                                              /*isVarArg=*/false);
    298298
    299     mFunc_llvm_uadd_with_overflow = mMod->getFunction("llvm.uadd.with.overflow.carryin.i##BLOCK_SIZE");
     299    mFunc_llvm_uadd_with_overflow = mMod->getFunction("llvm.uadd.with.overflow.carryin.i"##BLOCK_SIZE);
    300300    if (!mFunc_llvm_uadd_with_overflow) {
    301301        mFunc_llvm_uadd_with_overflow = Function::Create(
    302302          /*Type=*/ FuncTy_1,
    303303          /*Linkage=*/ GlobalValue::ExternalLinkage,
    304           /*Name=*/ "llvm.uadd.with.overflow.carryin.i##BLOCK_SIZE", mMod); // (external, no body)
     304          /*Name=*/ "llvm.uadd.with.overflow.carryin.i"##BLOCK_SIZE, mMod); // (external, no body)
    305305        mFunc_llvm_uadd_with_overflow->setCallingConv(CallingConv::C);
    306306    }
     
    731731
    732732    //CarryQ - carry in.
    733     int this_carry_idx = mCarryQueueIdx++;
    734     Value* carryq_value = genCarryInLoad(mCarryQueuePtr, this_carry_idx);
     733    const int carryIdx = mCarryQueueIdx++;
     734    Value* carryq_value = genCarryInLoad(mCarryQueuePtr, carryIdx);
    735735
    736736#ifdef USE_UADD_OVERFLOW
     
    761761    Value* carry_out = genShiftHighbitToLow(b.CreateOr(carrygen, b.CreateAnd(carryprop, genNot(sum))), "carry_out");
    762762#endif
    763     genCarryOutStore(carry_out, mCarryQueuePtr, this_carry_idx);
     763    genCarryOutStore(carry_out, mCarryQueuePtr, carryIdx);
    764764    return sum;
    765765}
  • icGREP/icgrep-devel/icgrep/re/printer_re.cpp

    r4245 r4255  
    88
    99//Regular Expressions
    10 #include "re/re_re.h"
    11 #include "re/re_alt.h"
    12 #include "re/re_any.h"
    13 #include "re/re_cc.h"
    14 #include "re/re_name.h"
    15 #include "re/re_end.h"
    16 #include "re/re_rep.h"
    17 #include "re/re_seq.h"
    18 #include "re/re_start.h"
     10#include <re/re_re.h>
     11#include <re/re_alt.h>
     12#include <re/re_any.h>
     13#include <re/re_cc.h>
     14#include <re/re_name.h>
     15#include <re/re_end.h>
     16#include <re/re_rep.h>
     17#include <re/re_seq.h>
     18#include <re/re_start.h>
     19#include <re/re_diff.h>
    1920
    2021using namespace re;
     
    2526
    2627    if (re == nullptr) {
    27         retVal = "--> RE NullPtr! <--";
     28        retVal = "<NULL>";
    2829    }
    2930    else if (const Alt* re_alt = dyn_cast<const Alt>(re))
     
    5960        retVal += re_name->getName();
    6061        retVal += "\" ";
     62    }
     63    else if (const Diff* diff = dyn_cast<const Diff>(re))
     64    {
     65        retVal = "Diff (";
     66        retVal += PrintRE(diff->getLH());
     67        retVal += " , ";
     68        retVal += PrintRE(diff->getRH());
     69        retVal += ") ";
    6170    }
    6271    else if (isa<const End>(re))
     
    102111    else
    103112    {
    104         retVal = "--> RE Unknown <--";
     113        retVal = "???";
    105114    }
    106115    return std::move(retVal);
  • icGREP/icgrep-devel/icgrep/re/re_cc.cpp

    r4194 r4255  
    5454}
    5555
    56 void CC::negate() {
    57     CharSetVector negated;
    58     negated.reserve(mSparseCharSet.size() + 1);
    59     CodePointType lo_codepoint = 0;
    60     for (const CharSetItem & item : mSparseCharSet) {
    61         negated.push_back(std::move(CharSetItem(lo_codepoint, item.lo_codepoint - 1)));
    62         lo_codepoint = item.hi_codepoint + 1;
    63     }
    64     if (lo_codepoint <= UNICODE_MAX) {
    65         negated.push_back(std::move(CharSetItem(lo_codepoint, UNICODE_MAX)));
    66     }
    67     mSparseCharSet.assign(negated.begin(), negated.end());
    68 }
    69 
    7056void CC::remove_range(const CodePointType lo_codepoint, const CodePointType hi_codepoint) {
    7157    for (auto i = mSparseCharSet.begin(); i != mSparseCharSet.end(); ) {
  • icGREP/icgrep-devel/icgrep/re/re_cc.h

    r4206 r4255  
    4747
    4848    void insert_range(const CodePointType lo_codepoint, const CodePointType hi_codepoint);
    49 
    50     void negate();
    5149
    5250    void remove_range(const CodePointType lo_codepoint, const CodePointType hi_codepoint);
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r4253 r4255  
    1515#include <re/re_seq.h>
    1616#include <re/re_rep.h>
     17#include <re/re_diff.h>
    1718#include <cc/cc_namemap.hpp>
    1819#include <pablo/codegenstate.h>
     
    3839}
    3940
    40 void RE_Compiler::compile(RE * re, PabloBlock & cg) {
     41void RE_Compiler::compile(RE * re, PabloBlock & pb) {
    4142
    4243    mLineFeed = mNameMap["LineFeed"]->getVar();
     
    5152        PabloAST * u8pfx3 = mNameMap["UTF8-Prefix3"]->getVar();
    5253        PabloAST * u8pfx4 = mNameMap["UTF8-Prefix4"]->getVar();
    53         PabloAST * u8pfx = cg.createOr(cg.createOr(u8pfx2, u8pfx3), u8pfx4);
    54         mInitial = cg.createVar(cg.createAssign(initial, cg.createOr(u8pfx, u8single)));
     54        PabloAST * u8pfx = pb.createOr(pb.createOr(u8pfx2, u8pfx3), u8pfx4);
     55        mInitial = pb.createVar(pb.createAssign(initial, pb.createOr(u8pfx, u8single)));
    5556        #ifdef USE_IF_FOR_NONFINAL
    56         mNonFinal = cg.createVar(cg.createAssign(gs_nonfinal, cg.createZeroes()));
     57        mNonFinal = pb.createVar(pb.createAssign(gs_nonfinal, pb.createZeroes()));
    5758        #endif
    58         PabloAST * u8scope32 = cg.createAdvance(u8pfx3);
    59         PabloAST * u8scope42 = cg.createAdvance(u8pfx4);
    60         PabloAST * u8scope43 = cg.createAdvance(u8scope42);
     59        PabloAST * u8scope32 = pb.createAdvance(u8pfx3);
     60        PabloAST * u8scope42 = pb.createAdvance(u8pfx4);
     61        PabloAST * u8scope43 = pb.createAdvance(u8scope42);
    6162        #ifdef USE_IF_FOR_NONFINAL
    62         PabloBlock it(cg);
     63        PabloBlock it(pb);
    6364        it.createAssign(gs_nonfinal, it.createOr(it.createOr(u8pfx, u8scope32), it.createOr(u8scope42, u8scope43)));
    64         cg.createIf(u8pfx, std::move(it));
     65        pb.createIf(u8pfx, std::move(it));
    6566        #else       
    66         mNonFinal = cg.createVar(cg.createAssign(nonfinal, cg.createOr(cg.createOr(u8pfx, u8scope32), cg.createOr(u8scope42, u8scope43))));
     67        mNonFinal = pb.createVar(pb.createAssign(nonfinal, pb.createOr(pb.createOr(u8pfx, u8scope32), pb.createOr(u8scope42, u8scope43))));
    6768        #endif
    6869    }
    6970    else {
    70         mInitial = cg.createZeroes();
    71         mNonFinal = cg.createZeroes();
    72     }
    73 
    74     Assign * start_marker = cg.createAssign("start", cg.createOnes());
    75     PabloAST * result = process(re, start_marker, cg);
     71        mInitial = pb.createZeroes();
     72        mNonFinal = pb.createZeroes();
     73    }
     74
     75    Assign * start_marker = pb.createAssign("start", pb.createOnes());
     76    PabloAST * result = process(re, start_marker, pb);
    7677
    7778    //These three lines are specifically for grep.
    78     cg.createAssign("matches", cg.createAnd(cg.createMatchStar(cg.createVar(result), cg.createNot(mLineFeed)), mLineFeed));
    79 }
    80 
    81 
    82 Assign * RE_Compiler::process(RE * re, Assign * target, PabloBlock & cg) {
     79    pb.createAssign("matches", pb.createAnd(pb.createMatchStar(pb.createVar(result), pb.createNot(mLineFeed)), mLineFeed));
     80}
     81
     82
     83Assign * RE_Compiler::process(RE * re, Assign * target, PabloBlock & pb) {
    8384    if (Name * name = dyn_cast<Name>(re)) {
    84         target = process(name, target, cg);
     85        target = process(name, target, pb);
    8586    }
    8687    else if (Seq* seq = dyn_cast<Seq>(re)) {
    87         target = process(seq, target, cg);
     88        target = process(seq, target, pb);
    8889    }
    8990    else if (Alt * alt = dyn_cast<Alt>(re)) {
    90         target = process(alt, target, cg);
     91        target = process(alt, target, pb);
    9192    }
    9293    else if (Rep * rep = dyn_cast<Rep>(re)) {
    93         target = process(rep, target, cg);
     94        target = process(rep, target, pb);
    9495    }
    9596    else if (isa<Any>(re)) {
    9697        // Move the markers forward through any nonfinal UTF-8 bytes to the final position of each character.
    97                 PabloAST * marker = cg.createVar(target);
    98         marker = cg.createAnd(marker, mInitial);
    99         marker = cg.createScanThru(marker, mNonFinal);
    100         PabloAST * dot = cg.createNot(mLineFeed);
    101         target = cg.createAssign("dot", cg.createAdvance(cg.createAnd(marker, dot)));
     98        PabloAST * marker = pb.createVar(target);
     99        marker = pb.createAnd(marker, mInitial);
     100        marker = pb.createScanThru(marker, mNonFinal);
     101        PabloAST * dot = pb.createNot(mLineFeed);
     102        target = pb.createAssign("dot", pb.createAdvance(pb.createAnd(marker, dot)));
     103    }
     104    else if (Diff * diff = dyn_cast<Diff>(re)) {
     105        target = process(diff, target, pb);
    102106    }
    103107    else if (isa<Start>(re)) {
    104         PabloAST * const sol = cg.createNot(cg.createAdvance(cg.createNot(mLineFeed)));
    105         target = cg.createAssign("sol", cg.createAnd(cg.createVar(target), sol));
     108        PabloAST * const sol = pb.createNot(pb.createAdvance(pb.createNot(mLineFeed)));
     109        target = pb.createAssign("sol", pb.createAnd(pb.createVar(target), sol));
    106110    }
    107111    else if (isa<End>(re)) {
    108         target = cg.createAssign("eol", cg.createAnd(cg.createVar(target), mLineFeed));
    109     }
    110 
    111     return target;
    112 }
    113 
    114 inline Assign * RE_Compiler::process(Name * name, Assign * target, PabloBlock & cg) {
    115     PabloAST * marker = cg.createVar(target);
     112        target = pb.createAssign("eol", pb.createAnd(pb.createVar(target), mLineFeed));
     113    }
     114    return target;
     115}
     116
     117inline Assign * RE_Compiler::process(Name * name, Assign * target, PabloBlock & pb) {
     118    PabloAST * marker = pb.createVar(target);
    116119    if (name->getType() != Name::Type::FixedLength) {
    117120        // Move the markers forward through any nonfinal UTF-8 bytes to the final position of each character.
    118         marker = cg.createAnd(marker, mInitial);
    119         marker = cg.createScanThru(marker, mNonFinal);
     121        marker = pb.createAnd(marker, mInitial);
     122        marker = pb.createScanThru(marker, mNonFinal);
    120123    }
    121124    PabloAST * cc = nullptr;
    122125    if (name->getType() == Name::Type::UnicodeCategory) {
    123         cc = cg.createCall(name->getName());
    124     }
    125     else {
    126         cc = cg.createVar(name->getName());
     126        cc = pb.createCall(name->getName());
     127    }
     128    else {
     129        cc = pb.createVar(name->getName());
    127130    }
    128131    if (name->isNegated()) {
    129         cc = cg.createNot(cg.createOr(cg.createOr(cc, mLineFeed), mNonFinal));
    130     }
    131     return cg.createAssign("m", cg.createAdvance(cg.createAnd(cc, marker)));
    132 }
    133 
    134 inline Assign * RE_Compiler::process(Seq * seq, Assign *target, PabloBlock & cg) {
     132        cc = pb.createNot(pb.createOr(pb.createOr(cc, mLineFeed), mNonFinal));
     133    }
     134    return pb.createAssign("m", pb.createAdvance(pb.createAnd(cc, marker)));
     135}
     136
     137inline Assign * RE_Compiler::process(Seq * seq, Assign *target, PabloBlock & pb) {
    135138    for (RE * re : *seq) {
    136         target = process(re, target, cg);
    137     }
    138     return target;
    139 }
    140 
    141 inline Assign * RE_Compiler::process(Alt * alt, Assign * target, PabloBlock & cg) {
     139        target = process(re, target, pb);
     140    }
     141    return target;
     142}
     143
     144inline Assign * RE_Compiler::process(Alt * alt, Assign * target, PabloBlock & pb) {
    142145    if (alt->empty()) {
    143         target = cg.createAssign("fail", cg.createZeroes()); // always fail (note: I'm not sure this ever occurs. How do I create a 0-element alternation?)
     146        target = pb.createAssign("fail", pb.createZeroes()); // always fail (note: I'm not sure this ever occurs. How do I create a 0-element alternation?)
    144147    }
    145148    else {
    146149        auto i = alt->begin();
    147150        Assign * const base = target;
    148         target = process(*i, base, cg);
     151        target = process(*i, base, pb);
    149152        while (++i != alt->end()) {
    150             Assign * other = process(*i, base, cg);
    151             target = cg.createAssign("alt", cg.createOr(cg.createVar(target), cg.createVar(other)));
     153            Assign * other = process(*i, base, pb);
     154            target = pb.createAssign("alt", pb.createOr(pb.createVar(target), pb.createVar(other)));
    152155        }
    153156    }   
     
    155158}
    156159
    157 inline Assign * RE_Compiler::process(Rep * rep, Assign * target, PabloBlock & cg) {
     160inline Assign * RE_Compiler::process(Diff * diff, Assign * target, PabloBlock & pb) {
     161    RE * lh = diff->getLH();
     162    RE * rh = diff->getRH();
     163    if ((isa<Any>(lh) || isa<Name>(lh)) && (isa<Any>(rh) || isa<Name>(rh))) {
     164        Assign * t1 = process(lh, target, pb);
     165        Assign * t2 = process(rh, target, pb);
     166        return pb.createAssign("diff", pb.createAnd(pb.createVar(t1), pb.createNot(pb.createVar(t2))));
     167    }
     168    throw std::runtime_error("Unsupported Diff operands: " + Printer_RE::PrintRE(diff));
     169}
     170
     171inline Assign * RE_Compiler::process(Rep * rep, Assign * target, PabloBlock & pb) {
    158172    if (rep->getUB() == Rep::UNBOUNDED_REP) {
    159         target = processUnboundedRep(rep->getRE(), rep->getLB(), target, cg);
     173        target = processUnboundedRep(rep->getRE(), rep->getLB(), target, pb);
    160174    }
    161175    else { // if (rep->getUB() != Rep::UNBOUNDED_REP)
    162         target = processBoundedRep(rep->getRE(), rep->getLB(), rep->getUB(), target, cg);
     176        target = processBoundedRep(rep->getRE(), rep->getLB(), rep->getUB(), target, pb);
    163177    }   
    164178    return target;
    165179}
    166180
    167 inline Assign * RE_Compiler::processUnboundedRep(RE * repeated, int lb, Assign * target, PabloBlock & cg) {
     181inline Assign * RE_Compiler::processUnboundedRep(RE * repeated, int lb, Assign * target, PabloBlock & pb) {
    168182
    169183    PabloAST * unbounded = nullptr;
    170184
    171185    while (lb-- != 0) {
    172         target = process(repeated, target, cg);
     186        target = process(repeated, target, pb);
    173187    }
    174188
     
    178192        PabloAST * cc;
    179193        if (rep_name->getType() == Name::Type::UnicodeCategory) {
    180             cc = cg.createCall(rep_name->getName());
     194            cc = pb.createCall(rep_name->getName());
    181195        }
    182196        else {
    183             cc = cg.createVar(rep_name->getName());
     197            cc = pb.createVar(rep_name->getName());
    184198        }
    185199
    186200        if (rep_name->isNegated()) {
    187             cc = cg.createNot(cg.createOr(cc, cg.createOr(mLineFeed, mNonFinal)));
    188         }
    189 
    190         unbounded = cg.createVar(target);
     201            cc = pb.createNot(pb.createOr(cc, pb.createOr(mLineFeed, mNonFinal)));
     202        }
     203
     204        unbounded = pb.createVar(target);
    191205        if (rep_name->getType() == Name::Type::FixedLength) {
    192             unbounded = cg.createMatchStar(unbounded, cc);
     206            unbounded = pb.createMatchStar(unbounded, cc);
    193207        }
    194208        else { // Name::Unicode and Name::UnicodeCategory
    195             unbounded = cg.createAnd(cg.createMatchStar(unbounded, cg.createOr(mNonFinal, cc)), mInitial);
     209            unbounded = pb.createAnd(pb.createMatchStar(unbounded, pb.createOr(mNonFinal, cc)), mInitial);
    196210        }       
    197211    }
    198212    else if (isa<Any>(repeated)) {
    199         PabloAST * dot = cg.createNot(mLineFeed);
    200         unbounded = cg.createVar(target);
    201         unbounded = cg.createAnd(cg.createMatchStar(unbounded, cg.createOr(mNonFinal, dot)), mInitial);
    202     }
    203     else {
    204 
    205         Var * targetVar = cg.createVar(target);
    206 
    207         Assign * whileTest = cg.createAssign("test", targetVar);
    208         Assign * whileAccum = cg.createAssign("accum", targetVar);
    209 
    210         PabloBlock wt(cg);
     213        PabloAST * dot = pb.createNot(mLineFeed);
     214        unbounded = pb.createVar(target);
     215        unbounded = pb.createAnd(pb.createMatchStar(unbounded, pb.createOr(mNonFinal, dot)), mInitial);
     216    }
     217    else {
     218
     219        Var * targetVar = pb.createVar(target);
     220
     221        Assign * whileTest = pb.createAssign("test", targetVar);
     222        Assign * whileAccum = pb.createAssign("accum", targetVar);
     223
     224        PabloBlock wt(pb);
    211225
    212226        Var * loopComputation = wt.createVar(process(repeated, whileTest, wt));
     
    218232        wt.createNext(whileAccum, wt.createOr(loopComputation, whileAccumVar));
    219233
    220         cg.createWhile(cg.createVar(whileTest), std::move(wt));
     234        pb.createWhile(pb.createVar(whileTest), std::move(wt));
    221235
    222236        unbounded = whileAccumVar;
    223237    }   
    224     return cg.createAssign("unbounded", unbounded);
    225 }
    226 
    227 inline Assign * RE_Compiler::processBoundedRep(RE * repeated, int lb, int ub, Assign * target, PabloBlock & cg) {
     238    return pb.createAssign("unbounded", unbounded);
     239}
     240
     241inline Assign * RE_Compiler::processBoundedRep(RE * repeated, int lb, int ub, Assign * target, PabloBlock & pb) {
    228242    ub -= lb;
    229243    while(lb-- != 0) {
    230         target = process(repeated, target, cg);
     244        target = process(repeated, target, pb);
    231245    }
    232246    while (ub-- != 0) {
    233         Assign * alt = process(repeated, target, cg);
    234         target = cg.createAssign("m", cg.createOr(cg.createVar(target), cg.createVar(alt)));
     247        Assign * alt = process(repeated, target, pb);
     248        target = pb.createAssign("m", pb.createOr(pb.createVar(target), pb.createVar(alt)));
    235249    }
    236250    return target;
     
    244258    }
    245259    else if (isa<Any>(re)) {
     260        found = true;
     261    }
     262    else if (isa<Diff>(re)) {
    246263        found = true;
    247264    }
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r4249 r4255  
    3939    void compile(RE * re, pablo::PabloBlock & cg);
    4040
    41     pablo::Assign * process(RE * re, pablo::Assign *target, pablo::PabloBlock & cg_state);
    42     pablo::Assign * process(Name * name, pablo::Assign * target, pablo::PabloBlock & cg_state);
    43     pablo::Assign * process(Seq * seq, pablo::Assign * target, pablo::PabloBlock & cg_state);
    44     pablo::Assign * process(Alt * alt, pablo::Assign * target, pablo::PabloBlock & cg_state);
    45     pablo::Assign * process(Rep * rep, pablo::Assign *target, pablo::PabloBlock & cg_state);
    46     pablo::Assign * processUnboundedRep(RE * repeated, int lb, pablo::Assign * target, pablo::PabloBlock & cg_state);
    47     pablo::Assign * processBoundedRep(RE * repeated, int lb, int ub, pablo::Assign * target, pablo::PabloBlock & cg_state);
     41    pablo::Assign * process(RE * re, pablo::Assign *target, pablo::PabloBlock & pb);
     42    pablo::Assign * process(Name * name, pablo::Assign * target, pablo::PabloBlock & pb);
     43    pablo::Assign * process(Seq * seq, pablo::Assign * target, pablo::PabloBlock & pb);
     44    pablo::Assign * process(Alt * alt, pablo::Assign * target, pablo::PabloBlock & pb);
     45    pablo::Assign * process(Rep * rep, pablo::Assign *target, pablo::PabloBlock & pb);
     46    pablo::Assign * process(Diff * diff, pablo::Assign * target, pablo::PabloBlock & cg);
     47    pablo::Assign * processUnboundedRep(RE * repeated, int lb, pablo::Assign * target, pablo::PabloBlock & pb);
     48    pablo::Assign * processBoundedRep(RE * repeated, int lb, int ub, pablo::Assign * target, pablo::PabloBlock & pb);
    4849
    4950
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r4249 r4255  
    55 */
    66
    7 #include "re_parser.h"
    8 #include "re_alt.h"
    9 #include "re_end.h"
    10 #include "re_rep.h"
    11 #include "re_seq.h"
    12 #include "re_start.h"
    13 #include "parsefailure.h"
     7#include <re/re_parser.h>
     8#include <re/re_alt.h>
     9#include <re/re_end.h>
     10#include <re/re_rep.h>
     11#include <re/re_seq.h>
     12#include <re/re_start.h>
     13#include <re/re_diff.h>
     14#include <re/parsefailure.h>
    1415#include <algorithm>
    1516
     
    289290                    break;
    290291                }
     292                ++_cursor;
    291293                if (negated) {
    292                     negate_cc(cc);
    293                 }
    294                 ++_cursor;
     294                    return makeDiff(makeAny(), cc.release());
     295                }
    295296                return cc.release();
    296297            // The hyphen (-) is not treated as a range separator if it appears first or last, or as the
     
    407408}
    408409
    409 inline void RE_Parser::negate_cc(std::unique_ptr<CC> & cc) {
    410     cc->negate();
    411     cc->remove(10);
    412 }
    413 
    414410inline void RE_Parser::throw_incomplete_expression_error_if_end_of_stream() const {
    415411    if (_cursor == _end) throw IncompleteRegularExpression();
  • icGREP/icgrep-devel/icgrep/re/re_parser.h

    r4245 r4255  
    5858    unsigned parse_int();
    5959
    60     static void negate_cc(std::unique_ptr<CC> & cc);
    61 
    6260    inline void throw_incomplete_expression_error_if_end_of_stream() const;
    6361
  • icGREP/icgrep-devel/icgrep/re/re_start.h

    r4206 r4255  
    88#define START_H
    99
    10 #include "re_re.h"
    11 
    12 #include "re_re.h"
     10#include <re/re_re.h>
    1311
    1412namespace re {
Note: See TracChangeset for help on using the changeset viewer.