Ignore:
Timestamp:
Dec 31, 2017, 7:46:49 PM (16 months ago)
Author:
cameron
Message:

Toolchain restructuring; creating a total order for memoizer lessThan

File:
1 edited

Legend:

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

    r5816 r5817  
    6262
    6363RE * resolveModesAndExternalSymbols(RE * r) {
     64    if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowREs)) {
     65        errs() << "Parser:\n" << Printer_RE::PrintRE(r) << '\n';
     66    }
    6467    r = resolveGraphemeMode(r, false /* not in grapheme mode at top level*/);
    6568    if (PrintOptions.isSet(ShowAllREs)) {
     
    8588}
    8689
    87 RE * multiplexing_prepasses(RE * r) {
     90RE * regular_expression_passes(RE * r) {
    8891    std::vector<re::CC *> charclasses;
    89     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowREs)) {
    90         errs() << "Parser:\n" << Printer_RE::PrintRE(r) << '\n';
    91     }
    9292    //Optimization passes to simplify the AST.
    9393    r = RE_Nullable::removeNullablePrefix(r);
     
    116116    return r;
    117117}
    118 
    119 RE * regular_expression_passes(RE * r)  {
    120 
    121     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowREs)) {
    122         errs() << "Parser:\n" << Printer_RE::PrintRE(r) << '\n';
    123     }
    124 
    125     //Optimization passes to simplify the AST.
    126     r = RE_Nullable::removeNullablePrefix(r);
    127     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowStrippedREs)) {
    128         errs() << "RemoveNullablePrefix:\n" << Printer_RE::PrintRE(r) << '\n';
    129     }
    130     r = RE_Nullable::removeNullableSuffix(r);
    131     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowStrippedREs)) {
    132         errs() << "RemoveNullableSuffix:\n" << Printer_RE::PrintRE(r) << '\n';
    133     }
    134     r = RE_Simplifier::simplify(r);
    135 
    136     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowSimplifiedREs)) {
    137         //Print to the terminal the AST that was generated by the simplifier.
    138         errs() << "Simplifier:\n" << Printer_RE::PrintRE(r) << '\n';
    139     }
    140    
    141 //    r = RE_Minimizer::minimize(r);
    142 
    143 //    if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowSimplifiedREs)) {
    144 //        //Print to the terminal the AST that was generated by the simplifier.
    145 //        errs() << "Minimizer:\n" << Printer_RE::PrintRE(r) << '\n';
    146 //    }
    147 
    148     r = RE_Star_Normal::star_normal(r);
    149 
    150     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowSimplifiedREs)) {
    151         //Print to the terminal the AST that was transformed to the star normal form.
    152         errs() << "Star_Normal_Form:\n" << Printer_RE::PrintRE(r) << '\n';
    153     }
    154 
    155     return r;
    156118}
    157    
    158 PabloAST * re2pablo_compiler(PabloKernel * kernel, RE * re_ast) {
    159     Var * const basis = kernel->getInputStreamVar("basis");
    160     cc::CC_Compiler cc_compiler(kernel, basis);
    161     RE_Compiler re_compiler(kernel, cc_compiler);
    162     return re_compiler.compile(re_ast);
    163 }
    164 
    165 }
Note: See TracChangeset for help on using the changeset viewer.