Ignore:
Timestamp:
Jul 6, 2015, 5:56:51 PM (4 years ago)
Author:
nmedfort
Message:

Simplified While structure. Next nodes are in the AST again but are treated like independent variable assignments; they're only associated with their original Assign by including them in the While instruction.

File:
1 edited

Legend:

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

    r4642 r4643  
    513513        mLoopVariants.push_back(nextPending);
    514514        mLoopVariants.push_back(nextStarAccum);
    515         mWhileTest = pb.createOr(mWhileTest, nextPending->getExpr());
     515        mWhileTest = pb.createOr(mWhileTest, nextPending);
    516516        mStarDepth--;
    517517       
    518         return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", pb.createOr(base, nextStarAccum->getExpr())));
     518        return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", pb.createOr(base, nextStarAccum)));
    519519    }   
    520520    else {
     
    530530        Next * nextWhilePending = wb.createNext(whilePending, wb.createAnd(loopComputation, wb.createNot(whileAccum)));
    531531        Next * nextWhileAccum = wb.createNext(whileAccum, wb.createOr(loopComputation, whileAccum));
    532         Next * nextWhileTest = wb.createNext(whileTest, wb.createOr(mWhileTest, nextWhilePending->getExpr()));
     532        Next * nextWhileTest = wb.createNext(whileTest, wb.createOr(mWhileTest, nextWhilePending));
    533533        mLoopVariants.push_back(nextWhilePending);
    534534        mLoopVariants.push_back(nextWhileAccum);
     
    537537        mStarDepth--;
    538538        mLoopVariants.clear();
    539         return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", nextWhileAccum->getExpr()));
     539        return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", nextWhileAccum));
    540540    }   
    541541} // end of namespace re
Note: See TracChangeset for help on using the changeset viewer.