Ignore:
Timestamp:
Sep 27, 2015, 1:32:27 AM (4 years ago)
Author:
nmedfort
Message:

Progress on multi-target UCD compiler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.hpp

    r4736 r4797  
    22#define UCDCOMPILER_HPP
    33
     4#include <re/re_cc.h>
    45#include <vector>
    5 #include <re/re_cc.h>
     6#ifdef USE_BOOST
     7#include <boost/container/flat_map.hpp>
     8#else
     9#include <unordered_map>
     10#endif
    611
    712namespace cc {
     
    2530    using codepoint_t = re::codepoint_t;
    2631    using RangeList = std::vector<re::interval_t>;
     32    #ifdef USE_BOOST
     33    using TargetMap = boost::container::flat_map<const UnicodeSet *, PabloAST *>;
     34    #else
     35    using TargetMap = std::unordered_map<const UnicodeSet *, PabloAST *>;
     36    #endif
     37    using Target = TargetMap::value_type;
     38    using TargetVector = std::vector<Target>;
    2739
    2840public:
     
    3345    PabloAST * generateWithoutIfHierarchy(const UnicodeSet & set, PabloBuilder & entry);
    3446
    35     PabloAST * generateWithIfHierarchy(const RangeList & ifRanges, const UnicodeSet & set, PabloBuilder & entry);
    36 
    3747protected:
    3848
    39     PabloAST * generateWithIfHierarchy(const RangeList & ifRanges, const UnicodeSet & set, const codepoint_t lo, const codepoint_t hi, PabloBuilder & builder);
     49    void generateRange(const RangeList & ifRanges, PabloBuilder & entry);
    4050
    41     PabloAST * generateSubRanges(const UnicodeSet & set, const codepoint_t lo, const codepoint_t hi, PabloBuilder & builder, PabloAST * target);
     51    void generateRange(const RangeList & ifRanges, const codepoint_t lo, const codepoint_t hi, PabloBuilder & builder);
     52
     53    void generateSubRanges(const codepoint_t lo, const codepoint_t hi, PabloBuilder & builder);
    4254
    4355    PabloAST * sequenceGenerator(const RangeList && ranges, const unsigned byte_no, PabloBuilder & builder, PabloAST * target, PabloAST * prefix);
     
    5062
    5163    PabloAST * makePrefix(const codepoint_t cp, const unsigned byte_no, PabloBuilder & builder, PabloAST * prefix);
     64
     65    void addTarget(const UnicodeSet & set);
    5266
    5367    static RangeList byteDefinitions(const RangeList & list, const unsigned byte_no);
     
    6579    cc::CC_Compiler &       mCharacterClassCompiler;
    6680    PabloAST *              mSuffixVar;
     81    TargetMap               mTargetMap;
    6782};
    6883
Note: See TracChangeset for help on using the changeset viewer.