Ignore:
Timestamp:
Dec 24, 2017, 7:31:39 AM (13 months ago)
Author:
cameron
Message:

Regular expression toolchain progress

File:
1 edited

Legend:

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

    r5795 r5803  
    6161                         cl::cat(RegexOptions));
    6262
     63RE * resolveModesAndExternalSymbols(RE * r) {
     64    r = resolveGraphemeMode(r, false /* not in grapheme mode at top level*/);
     65    if (PrintOptions.isSet(ShowAllREs)) {
     66        errs() << "resolveGraphemeMode:\n" << Printer_RE::PrintRE(r) << '\n';
     67    }
     68    r = re::resolveUnicodeProperties(r);
     69    if (PrintOptions.isSet(ShowAllREs)) {
     70        errs() << "resolveUnicodeProperties:\n" << Printer_RE::PrintRE(r) << '\n';
     71    }
     72    r = resolveCaseInsensitiveMode(r, grep::IgnoreCaseFlag);
     73    if (PrintOptions.isSet(ShowAllREs)) {
     74        errs() << "resolveCaseInsensitiveMode:\n" << Printer_RE::PrintRE(r) << '\n';
     75    }
     76}
     77
     78RE * excludeUnicodeLineBreak(RE * r) {
     79    r = exclude_CC(r, re::makeCC(re::makeCC(0x0A, 0x0D), re::makeCC(re::makeCC(0x85), re::makeCC(0x2028, 0x2029))));
     80    if (PrintOptions.isSet(ShowAllREs)) {
     81        errs() << "excludeUnicodeLineBreak:\n" << Printer_RE::PrintRE(r) << '\n';
     82    }
     83}
    6384
    6485RE * multiplexing_prepasses(RE * r) {
     
    81102    }
    82103    r = RE_Star_Normal::star_normal(r);
    83 
    84     r = resolveGraphemeMode(r, false /* not in grapheme mode at top level*/);
    85     if (PrintOptions.isSet(ShowAllREs)) {
    86         errs() << "resolveGraphemeMode:\n" << Printer_RE::PrintRE(r) << '\n';
    87     }
    88     r = re::resolveUnicodeProperties(r);
    89     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowStrippedREs)) {
    90         errs() << "resolveUnicodeProperties:\n" << Printer_RE::PrintRE(r) << '\n';
    91     }
    92 
    93     r = RE_Simplifier::simplify(r);
    94    
    95     if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowSimplifiedREs)) {
    96         //Print to the terminal the AST that was generated by the simplifier.
    97         errs() << "Simplifier:\n" << Printer_RE::PrintRE(r) << '\n';
    98     }
    99104    if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowSimplifiedREs)) {
    100105        //Print to the terminal the AST that was transformed to the star normal form.
    101106        errs() << "Star_Normal_Form:\n" << Printer_RE::PrintRE(r) << '\n';
    102     }
    103     r = resolveCaseInsensitiveMode(r, grep::IgnoreCaseFlag);
    104     if (PrintOptions.isSet(ShowAllREs)) {
    105         errs() << "resolveCaseInsensitiveMode:\n" << Printer_RE::PrintRE(r) << '\n';
    106107    }
    107108    r = re::resolveNames(r);
     
    109110        errs() << "resolveNames:\n" << Printer_RE::PrintRE(r) << '\n';
    110111    }
    111     r = exclude_CC(r, re::makeCC(re::makeCC(0x0A, 0x0D), re::makeCC(re::makeCC(0x85), re::makeCC(0x2028, 0x2029))));
    112     if (PrintOptions.isSet(ShowAllREs)) {
    113         errs() << "exclude_CC:\n" << Printer_RE::PrintRE(r) << '\n';
     112
     113    r = RE_Simplifier::simplify(r);
     114    if (PrintOptions.isSet(ShowAllREs) || PrintOptions.isSet(ShowSimplifiedREs)) {
     115        //Print to the terminal the AST that was generated by the simplifier.
     116        errs() << "Simplifier:\n" << Printer_RE::PrintRE(r) << '\n';
    114117    }
    115118    return r;
Note: See TracChangeset for help on using the changeset viewer.