Changeset 4844


Ignore:
Timestamp:
Oct 18, 2015, 12:34:03 PM (2 years ago)
Author:
nmedfort
Message:

Fix for \X compiled into loops.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r4843 r4844  
    672672        PabloAST * m1 = pb.createOr(base, starPending);
    673673        PabloAST * m2 = pb.createOr(base, starAccum);
    674         PabloAST * loopComputation = markerVar(AdvanceMarker(process(repeated, makeMarker(MarkerPosition::InitialPostPositionByte, m1), pb), MarkerPosition::InitialPostPositionByte, pb));
     674        MarkerType result = process(repeated, makeMarker(MarkerPosition::InitialPostPositionByte, m1), pb);
     675        result = AdvanceMarker(result, MarkerPosition::InitialPostPositionByte, pb);
     676        PabloAST * loopComputation = markerVar(result);
    675677        Next * nextPending = pb.createNext(starPending, pb.createAnd(loopComputation, pb.createNot(m2)));
    676678        Next * nextStarAccum = pb.createNext(starAccum, pb.createOr(loopComputation, m2));
     
    678680        mLoopVariants.push_back(nextPending);
    679681        mLoopVariants.push_back(nextStarAccum);
    680         mStarDepth--;       
    681         return makeMarker(MarkerPosition::InitialPostPositionByte, pb.createAssign("unbounded", pb.createOr(base, nextStarAccum)));
     682        mStarDepth--;
     683        return makeMarker(markerPos(result), pb.createAssign("unbounded", pb.createOr(base, nextStarAccum)));
    682684    } else {
    683685        Assign * whileTest = pb.createAssign("test", base);
     
    685687        Assign * whileAccum = pb.createAssign("accum", base);
    686688        mWhileTest = pb.createZeroes();
    687 
    688689        PabloBuilder wb = PabloBuilder::Create(pb);
    689690        mStarDepth++;
    690 
    691         PabloAST * loopComputation = markerVar(AdvanceMarker(process(repeated, makeMarker(MarkerPosition::InitialPostPositionByte, whilePending), wb), MarkerPosition::InitialPostPositionByte, wb));
     691        MarkerType result = process(repeated, makeMarker(MarkerPosition::InitialPostPositionByte, whilePending), wb);
     692        result = AdvanceMarker(result, MarkerPosition::InitialPostPositionByte, wb);
     693        PabloAST * loopComputation = markerVar(result);
    692694        Next * nextWhilePending = wb.createNext(whilePending, wb.createAnd(loopComputation, wb.createNot(whileAccum)));
    693695        Next * nextWhileAccum = wb.createNext(whileAccum, wb.createOr(loopComputation, whileAccum));
     
    699701        mStarDepth--;
    700702        mLoopVariants.clear();
    701         return makeMarker(MarkerPosition::InitialPostPositionByte, pb.createAssign("unbounded", nextWhileAccum));
     703        return makeMarker(markerPos(result), pb.createAssign("unbounded", nextWhileAccum));
    702704    }   
    703705}
Note: See TracChangeset for help on using the changeset viewer.