Ignore:
Timestamp:
Nov 8, 2014, 10:56:44 AM (5 years ago)
Author:
cameron
Message:

Set Intersection back-end support

File:
1 edited

Legend:

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

    r4283 r4298  
    1616#include <re/re_rep.h>
    1717#include <re/re_diff.h>
     18#include <re/re_intersect.h>
    1819#include <cc/cc_namemap.hpp>
    1920#include <pablo/codegenstate.h>
     
    161162}
    162163
     164inline Assign * RE_Compiler::process(Intersect * x, Assign * marker, PabloBlock & pb) {
     165    RE * lh = x->getLH();
     166    RE * rh = x->getRH();
     167    if ((isa<Any>(lh) || isa<Name>(lh)) && (isa<Any>(rh) || isa<Name>(rh))) {
     168        Assign * t1 = process(lh, marker, pb);
     169        Assign * t2 = process(rh, marker, pb);
     170        return pb.createAssign("intersect", pb.createAnd(pb.createVar(t1), pb.createVar(t2)));
     171    }
     172    throw std::runtime_error("Unsupported Intersect operands: " + Printer_RE::PrintRE(x));
     173}
     174
    163175inline Assign * RE_Compiler::process(Rep * rep, Assign * marker, PabloBlock & pb) {
    164176    int lb = rep->getLB();
Note: See TracChangeset for help on using the changeset viewer.