Ignore:
Timestamp:
Jan 6, 2015, 6:29:25 PM (4 years ago)
Author:
cameron
Message:

AST support for Lookahead/Lookbehind? assertions

File:
1 edited

Legend:

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

    r4337 r4405  
    1919#include <re/re_diff.h>
    2020#include <re/re_intersect.h>
     21#include <re/re_assertion.h>
    2122
    2223using namespace re;
     
    6263        retVal += "\" ";
    6364    }
     65    else if (const Assertion * a = dyn_cast<const Assertion>(re)) {
     66        retVal = (a->getSense() == Assertion::Sense::Positive) ? "" : "Negative";
     67        retVal += (a->getKind() == Assertion::Kind::Lookahead) ? "Lookahead" : "Lookbehind";
     68        retVal += "Assertion(";
     69        retVal += PrintRE(a->getAsserted());
     70        retVal += ") ";
     71    }
    6472    else if (const Diff* diff = dyn_cast<const Diff>(re))
    6573    {
     
    93101        }
    94102        else {
    95             retVal.append(std::to_string(re_rep->getUB()));           
     103            retVal.append(std::to_string(re_rep->getUB()));
    96104        }
    97105        retVal.append(")");
Note: See TracChangeset for help on using the changeset viewer.