Ignore:
Timestamp:
Jun 6, 2017, 6:20:55 PM (2 years ago)
Author:
cameron
Message:

Restore check-ins from the last several days

Location:
icGREP/icgrep-devel/icgrep/re
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_assertion.h

    r5308 r5493  
    2828    void setAsserted(RE * r) {mAsserted = r;}
    2929
     30    static Assertion::Kind reverseKind(Assertion::Kind k);
     31    static Assertion::Sense negateSense(Assertion::Sense s);
    3032
    3133protected:
     
    3941    Sense mSense;
    4042};
     43
     44inline Assertion::Kind Assertion::reverseKind(Assertion::Kind k) {
     45    if (k == Assertion::Kind::Boundary) return k;
     46    return k == Assertion::Kind::Lookahead ? Assertion::Kind::Lookbehind : Assertion::Kind::Lookahead;
     47}
     48
     49inline Assertion::Sense Assertion::negateSense(Assertion::Sense s) {
     50    return s == Assertion::Sense::Positive ? Assertion::Sense::Negative : Assertion::Sense::Positive;
     51}
    4152
    4253inline Assertion * makeAssertion(RE * asserted, Assertion::Kind k, Assertion::Sense s) {
  • icGREP/icgrep-devel/icgrep/re/re_simplifier.cpp

    r5267 r5493  
    4141        re = makeRep(expr, rep->getLB(), rep->getUB());
    4242    } else if (Diff * diff = dyn_cast<Diff>(re)) {
    43         re = makeDiff(simplify(diff->getLH()), diff->getRH());
     43        re = makeDiff(simplify(diff->getLH()), simplify(diff->getRH()));
    4444    } else if (Intersect * e = dyn_cast<Intersect>(re)) {
    45         re = makeIntersect(simplify(e->getLH()), e->getRH());
     45        re = makeIntersect(simplify(e->getLH()), simplify(e->getRH()));
    4646    }
    4747    return re;
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.cpp

    r5473 r5493  
    1010#include <re/re_compiler.h>            // for RE_Compiler
    1111#include <re/re_nullable.h>            // for RE_Nullable
     12#include <re/re_star_normal.h>         // for RE_Star_Normal
    1213#include <re/re_simplifier.h>          // for RE_Simplifier
    1314#include <re/printer_re.h>
     
    8182        std::cerr << "Simplifier:" << std::endl << Printer_RE::PrintRE(re_ast) << std::endl;
    8283    }
     84
     85    re_ast = re::RE_Star_Normal::star_normal(re_ast);
     86    if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowSimplifiedREs)) {
     87        //Print to the terminal the AST that was transformed to the star normal form.
     88        std::cerr << "Star_Normal_Form:" << std::endl << Printer_RE::PrintRE(re_ast) << std::endl;
     89    }   
    8390    return re_ast;
    8491}
Note: See TracChangeset for help on using the changeset viewer.