Ignore:
Timestamp:
Oct 3, 2015, 4:48:15 PM (4 years ago)
Author:
nmedfort
Message:

Bug fixes and removal of byte class compiler.

Location:
icGREP/icgrep-devel/icgrep/cc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r4812 r4815  
    4747}
    4848
    49 void CC_Compiler::compileByteClasses(RE * re) {
    50     if (Alt * alt = dyn_cast<Alt>(re)) {
    51         for (auto i = alt->begin(); i != alt->end(); ++i) {
    52             compileByteClasses(*i);
    53         }
    54     }
    55     else if (Seq * seq = dyn_cast<Seq>(re)) {
    56         for (auto i = seq->begin(); i != seq->end(); ++i) {
    57             compileByteClasses(*i);
    58         }
    59     }
    60     else if (Rep * rep = dyn_cast<Rep>(re)) {
    61         compileByteClasses(rep->getRE());
    62     }
    63     else if (Assertion * a = dyn_cast<Assertion>(re)) {
    64         compileByteClasses(a->getAsserted());
    65     }
    66     else if (Diff * diff = dyn_cast<Diff>(re)) {
    67         compileByteClasses(diff->getRH());
    68         compileByteClasses(diff->getLH());
    69     }
    70     else if (Intersect * e = dyn_cast<Intersect>(re)) {
    71         compileByteClasses(e->getRH());
    72         compileByteClasses(e->getLH());
    73     }
    74     else if (Name * name = dyn_cast<Name>(re)) {
    75         RE * def = name->getDefinition();
    76         if (def) {
    77             if (!isa<CC>(def)) {
    78                 compileByteClasses(def);
    79             }
    80             else if (name->getCompiled() == nullptr) {
    81                 name->setCompiled(compileCC(cast<CC>(def)));
    82             }
    83         }
    84     }
    85     else if (isa<CC>(re)) {
    86         throw std::runtime_error("icgrep internal error: unexpected CC object \"" + Printer_RE::PrintRE(re) + "\" found in compileByteClasses.");
    87     }
    88 }
    89 
    9049template<typename PabloBlockOrBuilder>
    9150PabloAST * CC_Compiler::charset_expr(const CC * cc, PabloBlockOrBuilder & pb) {
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.h

    r4681 r4815  
    3838
    3939    pablo::Assign * compileCC(const std::string && canonicalName, const re::CC *cc, pablo::PabloBuilder & builder);
    40 
    41     void compileByteClasses(re::RE * re);
    4240
    4341    pablo::PabloBuilder & getBuilder();
Note: See TracChangeset for help on using the changeset viewer.