Ignore:
Timestamp:
Jun 29, 2015, 3:53:32 PM (4 years ago)
Author:
nmedfort
Message:

Temporary check-in

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

Legend:

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

    r4622 r4623  
    2121#include <cc/cc_namemap.hpp>
    2222#include <pablo/codegenstate.h>
    23 #include <UCD/ucd_compiler.hpp>
    24 
     23#include <UCD/DerivedGeneralCategory.h>
    2524#include <assert.h>
    2625#include <stdexcept>
     
    3534static cl::opt<bool> DisableMatchStar("disable-matchstar", cl::init(false),
    3635                     cl::desc("disable MatchStar optimization"), cl::cat(fREcompilationOptions));
    37 static cl::opt<bool> DisableUnicodeMatchStar("disable-Unicode-matchstar", cl::init(false),
     36static cl::opt<bool> DisableUnicodeMatchStar("disable-unicode-matchstar", cl::init(false),
    3837                     cl::desc("disable Unicode MatchStar optimization"), cl::cat(fREcompilationOptions));
    39 
    40 static cl::opt<bool> DisableUnicodeLineBreak("disable-Unicode-linebreak", cl::init(false),
     38static cl::opt<bool> DisableUnicodeLineBreak("disable-unicode-linebreak", cl::init(false),
    4139                     cl::desc("disable Unicode line breaks - use LF only"), cl::cat(fREcompilationOptions));
     40static cl::opt<bool> DisablePregeneratedUnicode("disable-pregenerated-unicode", cl::init(false),
     41                     cl::desc("disable use of pregenerated Unicode character class sets"), cl::cat(fREcompilationOptions));
    4242
    4343
     
    4949RE_Compiler::RE_Compiler(cc::CC_Compiler & ccCompiler)
    5050: mCCCompiler(ccCompiler)
    51 , mPB(ccCompiler.getBuilder().getPabloBlock(), ccCompiler.getBuilder())
    5251, mLineFeed(nullptr)
     52, mCRLF(nullptr)
     53, mUnicodeLineBreak(nullptr)
    5354, mInitial(nullptr)
    5455, mNonFinal(nullptr)
    5556, mFinal(nullptr)
     57, mWhileTest(nullptr)
    5658, mStarDepth(0)
     59, mPB(ccCompiler.getBuilder().getPabloBlock(), ccCompiler.getBuilder())
     60, mUCDCompiler(ccCompiler)
    5761{
    5862
     
    265269    }
    266270    else if (name->getType() == Name::Type::UnicodeProperty) {
    267         var = mPB.createCall(name->getName());
    268         // UCD::UCDCompiler ucdCompiler(mCCCompiler);
     271        if (DisablePregeneratedUnicode) {
     272            // Note: using a fixed set while testing whether the UCD compiler works.
     273            var = mUCDCompiler.generateWithDefaultIfHierarchy(UCD::GC_ns::z_Set, pb);
     274        }
     275        else {
     276            var = mPB.createCall(name->getName());
     277        }
    269278    }
    270279    else {
    271280        throw std::runtime_error("Unresolved name " + name->getName());
    272281    }
    273 
    274282    var = pb.createAnd(var, pb.createNot(UNICODE_LINE_BREAK ? mUnicodeLineBreak : mLineFeed));
    275283    name->setCompiled(var);
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r4622 r4623  
    1212#include <cc/cc_compiler.h>
    1313#include <pablo/builder.hpp>
     14#include <UCD/ucd_compiler.hpp>
    1415#include <string>
    1516#include <list>
     
    8687
    8788    cc::CC_Compiler &                               mCCCompiler;
    88     pablo::PabloBuilder                             mPB;
    8989    pablo::Assign *                                 mLineFeed;
    9090    pablo::PabloAST *                               mCRLF;
     
    9595    pablo::PabloAST *                               mWhileTest;
    9696    int                                             mStarDepth;
     97    pablo::PabloBuilder                             mPB;
     98    UCD::UCDCompiler                                mUCDCompiler;
    9799};
    98100
Note: See TracChangeset for help on using the changeset viewer.