Changeset 5763


Ignore:
Timestamp:
Dec 8, 2017, 6:16:53 PM (18 months ago)
Author:
cameron
Message:

Range RE objects

Location:
icGREP/icgrep-devel/icgrep
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5756 r5763  
    9494add_library(CodeGen ${TOOLCHAIN_SRC} ${DRIVER_SRC} ${OBJECT_CACHE_SRC} ${KERNEL_SRC} ${IDISA_SRC})
    9595add_library(PabloADT ${PABLO_SRC})
    96 add_library(RegExpADT re/re_re.cpp re/re_cc.cpp re/re_rep.cpp re/re_diff.cpp re/re_intersect.cpp re/re_assertion.cpp re/printer_re.cpp)
    97 add_library(RegExpCompiler re/re_parser.cpp re/re_memoizer.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_star_normal.cpp re/re_minimizer.cpp re/re_local.cpp re/re_compiler.cpp re/re_analysis.cpp re/re_toolchain.cpp re/re_name_resolve.cpp re/re_name_gather.cpp re/re_collect_unicodesets.cpp re/re_multiplex.cpp re/re_parser_pcre.cpp re/re_parser_ere.cpp re/re_parser_bre.cpp re/re_parser_prosite.cpp re/parse_fixed_strings.cpp re/re_utility.cpp ${GREP_CORE_SRC})
     96add_library(RegExpADT re/re_re.cpp re/re_cc.cpp re/re_rep.cpp re/re_diff.cpp re/re_intersect.cpp re/re_range.cpp re/re_assertion.cpp re/printer_re.cpp)
     97add_library(RegExpCompiler re/to_utf8.cpp re/re_parser.cpp re/re_memoizer.cpp re/re_nullable.cpp re/re_simplifier.cpp re/re_star_normal.cpp re/re_minimizer.cpp re/re_local.cpp re/re_compiler.cpp re/re_analysis.cpp re/re_toolchain.cpp re/re_name_resolve.cpp re/re_name_gather.cpp re/re_collect_unicodesets.cpp re/re_multiplex.cpp re/re_parser_pcre.cpp re/re_parser_ere.cpp re/re_parser_bre.cpp re/re_parser_prosite.cpp re/parse_fixed_strings.cpp re/re_utility.cpp ${GREP_CORE_SRC})
    9898add_library(CCADT cc/cc_compiler.cpp utf8_encoder.cpp utf16_encoder.cpp UCD/CaseFolding.cpp cc/alphabet.cpp cc/multiplex_CCs.cpp)
    9999add_library(UCDlib UCD/unicode_set.cpp UCD/ucd_compiler.cpp UCD/PropertyObjects.cpp UCD/resolve_properties.cpp)
  • icGREP/icgrep-devel/icgrep/re/re_memoizer.cpp

    r5706 r5763  
    44#include <re/re_seq.h>
    55#include <re/re_rep.h>
     6#include <re/re_range.h>
    67#include <re/re_diff.h>
    78#include <re/re_intersect.h>
     
    5455}
    5556
     57inline bool lessThan(const Range * const lh, const Range * const rh) {
     58    return compare(lh->getLo(), rh->getLo()) || compare(lh->getHi(), rh->getHi());
     59}
     60
    5661static bool lessThan(const Intersect * const lh, const Intersect * const rh) {
    5762    return compare(lh->getLH(), rh->getLH()) || compare(lh->getRH(), rh->getRH());
     
    8590        case Type::Name:
    8691            return *cast<Name>(lh) < *cast<Name>(rh);
     92        case Type::Range:
     93            return lessThan(cast<Range>(lh), cast<Range>(rh));
    8794        case Type::Diff:
    8895            return lessThan(cast<Diff>(lh), cast<Diff>(rh));
  • icGREP/icgrep-devel/icgrep/re/re_name_gather.cpp

    r5565 r5763  
    55#include <re/re_seq.h>
    66#include <re/re_rep.h>
     7#include <re/re_range.h>
    78#include <re/re_diff.h>
    89#include <re/re_intersect.h>
     
    4950        } else if (isa<Assertion>(re)) {
    5051            gather(cast<Assertion>(re)->getAsserted());
     52        } else if (Range * rg = dyn_cast<Range>(re)) {
     53            gather(rg->getLo());
     54            gather(rg->getHi());
    5155        } else if (isa<Diff>(re)) {
    5256            gather(cast<Diff>(re)->getLH());
  • icGREP/icgrep-devel/icgrep/re/re_name_resolve.cpp

    r5751 r5763  
    55#include <re/re_seq.h>
    66#include <re/re_rep.h>
     7#include <re/re_range.h>
    78#include <re/re_diff.h>
    89#include <re/re_intersect.h>
     
    8889        } else if (Assertion * a = dyn_cast<Assertion>(re)) {
    8990            a->setAsserted(resolve(a->getAsserted()));
     91        } else if (Range * rg = dyn_cast<Range>(re)) {
     92            rg->setLo(resolve(rg->getLo()));
     93            rg->setHi(resolve(rg->getHi()));
    9094        } else if (Diff * diff = dyn_cast<Diff>(re)) {
    9195            diff->setLH(resolve(diff->getLH()));
  • icGREP/icgrep-devel/icgrep/re/re_re.h

    r5755 r5763  
    2222        , Assertion
    2323        , CC
     24        , Range
    2425        , Diff
    2526        , End
  • icGREP/icgrep-devel/icgrep/re/re_reverse.cpp

    r5630 r5763  
    1414#include <re/re_alt.h>
    1515#include <re/re_rep.h>
     16#include <re/re_range.h>
    1617#include <re/re_diff.h>
    1718#include <re/re_intersect.h>
     
    3031    if (CC * cc = dyn_cast<CC>(re)) {
    3132        return makeCC(cc, makeCC());
     33    } else if (Range * rg = dyn_cast<Range>(re)) {
     34        return makeRange(rg->getLo(), rg->getHi());
    3235    } else if (Seq * seq = dyn_cast<Seq>(re)) {
    3336        std::vector<RE*> list;
  • icGREP/icgrep-devel/icgrep/re/re_simplifier.cpp

    r5755 r5763  
    44#include <re/re_seq.h>
    55#include <re/re_rep.h>
     6#include <re/re_range.h>
    67#include <re/re_diff.h>
    78#include <re/re_intersect.h>
     
    4849        } else if (Diff * diff = dyn_cast<Diff>(re)) {
    4950            re = makeDiff(simplify(diff->getLH()), simplify(diff->getRH()));
     51        } else if (Range * rg = dyn_cast<Range>(re)) {
     52            re = makeRange(simplify(rg->getLo()), simplify(rg->getHi()));
    5053        } else if (Intersect * e = dyn_cast<Intersect>(re)) {
    5154            re = makeIntersect(simplify(e->getLH()), simplify(e->getRH()));
Note: See TracChangeset for help on using the changeset viewer.